Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
1.1
  • Loading branch information
0ur4n05 authored May 27, 2021
1 parent 00a141c commit 64fa86d
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions ops.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3


from colorama import Fore, Back, Style
import optparse
import os
Expand All @@ -25,14 +26,17 @@ def banner() :
def parse() :
usage = "Usage: python3 ops.py -u [url] -w [wordlist]\n\n\nExamples:\npython3 ops.py -u \"http://example.com/index.php?token=junk&redirection=<url>&token=junk\" \npython3 ops.py -u http://example.com/ -w /usr/share/wordlists/word.txt -q \npython3 ops.py -u http://example.com/ -t 1 -c {'enwiki_session': '17ab96bd8ffbe8ca58a78657a918558'}\n\n"
parser = optparse.OptionParser(usage=usage)
parser.add_option("-a" , "--agent" , dest="user_agent" , help="User agent" )
parser.add_option("-q" , "--quiet" , dest="quiet" , help="Only show vulnerable links" , action="store_true")
parser.add_option("-u" , "--url" , dest="url" , help="Target URL (if your link have parameters add a \'<url>\' to the vulnerable parameter" )
parser.add_option("-t" , "--timeout" , dest="timeout" , help="Time out of waiting to a response(default is 4s)" , default=4 )
parser.add_option("-w" , "--wordlist" , dest="wordlist" , help="Custom payloads wordlist (optional)" , default="./payloads/big_w.txt")
(options, args) = parser.parse_args()
global user_agent
global timeout
global quiet
url = options.url
user_agent = options.user_agent
wordlist = options.wordlist
if options.url is None:
parser.print_help()
Expand All @@ -54,14 +58,15 @@ def checking(urlp , wordlistp) :
def wordlist(urlw , wordlistp) :
payloads = open(wordlistp, 'r')
wordlist = open('./wordlists/wordlist.txt' , "a+")
if "?" and "=" and "<url>" and urlw :
if "?" and "=" and "<url>" in urlw :
print("[+]-Parameters detected")
for line in payloads :
line = line.strip(' \n\t')
url = urlw.replace("<url>" , line) +"\n"
wordlist.writelines(url)
payloads.close()
else :
print("testing")
for line in payloads :
wordlist_elements = urlw + line
wordlist.writelines(wordlist_elements)
Expand All @@ -72,15 +77,26 @@ def wordlist(urlw , wordlistp) :
def scan() :
print("[/]-Scan started")
wordlist_l = open("./wordlists/wordlist.txt" , "r")
succesive_301_counter = 0
for line in wordlist_l :
r = requests.get(line , timeout = timeout , allow_redirects=False)
r = requests.get(line , timeout = timeout , allow_redirects=False , headers = {"User-Agent": user_agent} )
status_code = str(r.status_code)
if quiet :
if r.status_code == 302 :
res = "[" + status_code + "]--" + line
print(Fore.GREEN, res)
print(Style.RESET_ALL)
elif r.status_code == 301 :
succesive_301_counter = succesive_301_counter + 1
if succesive_301_counter >= 20 :
print("[+]-There is a lot of succesive 301 counter that can be just normal site redirections, please can you check the result or submit the official url")
choise = input("Continue? [y/n] : ")
if choise == "y" :
continue
elif choise == "n" :
exit()
else :
choise = input("Continue? [y/n] : ")
res = "[" + status_code + "]--" + line
print(Fore.YELLOW, res)
print(Style.RESET_ALL)
Expand All @@ -90,13 +106,23 @@ def scan() :
print(Fore.GREEN, res , end=" ")
print(Style.RESET_ALL)
elif r.status_code == 301 :
succesive_301_counter = succesive_301_counter + 1
if succesive_301_counter >= 20 :
print("[+]-There is a lot of succesive 301 counter that can be just normal site redirections, please can you check the result or submit the official url")
choise = input("Continue? [y/n] : ")
if choise == "y" :
continue
elif choise == "n" :
exit()
else :
choise = input("Continue? [y/n] : ")
res = "[" + status_code + "]--" + line
print(Fore.YELLOW, res , end=" ")
print(Style.RESET_ALL)
else :
res = "[" + status_code + "]--" + line
print(Fore.RED, res , end=" ")
print(Style.RESET_ALL)
print(Style.RESET_ALL)
print("Colors meanings :\n" , Fore.GREEN , "Green : Confirmed redirection\n" , Fore.YELLOW , "Yellow : Suspecious redirection\n" , Fore.RED , "Red : Not a redirection\n note: Please make sure to test the open redirect vulnerabilities before submitting them")
print(Style.RESET_ALL)
choise = input("\n[+]-Scan finished , wanna delete the generated wordlist? [y/n] : ")
Expand Down

0 comments on commit 64fa86d

Please sign in to comment.