forked from Pushpamk/Findredir3ct
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenredir3ct.py
49 lines (42 loc) · 1.58 KB
/
openredir3ct.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
import requests
import os
import sys
import multiprocessing
import argparse
print("""
\033[1;32m _____ __ ___ _____ __
\033[1;32m / __(_)___ ____/ /_______ ____/ (_)___|__ /_____/ /_
\033[1;32m / /_/ / __ \/ __ / ___/ _ \/ __ / / ___//_ </ ___/ __/
\033[1;32m / __/ / / / / /_/ / / / __/ /_/ / / / ___/ / /__/ /_
\033[1;32m/_/ /_/_/ /_/\__,_/_/ \___/\__,_/_/_/ /____/\___/\__/ \033[1;m""")
def fuzz(ip,filename):
if not os.path.isfile(filename):
print('[-] ' + filename + ' does not exist.')
sys.exit()
if not os.access(filename, os.R_OK):
print('[-] ' + filename + ' access denied.')
sys.exit(0)
print('\n\033[1;33m[+] Reading Payloads From: ' + filename + '\033[1;m\n')
f = open(filename,'r', encoding='utf8')
for line in f.readlines():
payload = line.strip('\n')
try:
r = requests.post(ip + payload)
if r.status_code == 301 :
print("\033[1;31m[?]" + r.url + "\033[1;m\033[1;32m[+] Redirection Successfull")
else:
print('\033[1;36m'+r.url+'\033[1;m'+'\033[1;31m [-]No Redirection\033[1;m')
except IOError:
print('\033[1;33m['+ IOError +'\033[1;m')
if __name__ == '__main__':
parse = argparse.ArgumentParser()
parse.add_argument('-t','--target' , help = 'target url')
parse.add_argument('-f','--payload',default = 'wordlist.txt' , help = 'payload file')
args = parse.parse_args()
if len(sys.argv) <= 1:
parse.print_help()
sys.exit(0)
if args.target:
p = multiprocessing.Process(target = fuzz, args = (args.target,args.payload))
p.start()