-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdirfinder.py
129 lines (80 loc) · 3.25 KB
/
dirfinder.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import requests
from termcolor import colored
import subprocess
print(colored("""
___ ___ _
( _`\ _ ( _`\ _ ( )
| | ) |(_) _ __ | (_(_)(_) ___ _| | __ _ __
| | | )| |( '__)| _) | |/' _ `\ /'_` | /'__`\( '__)
| |_) || || | | | | || ( ) |( (_| |( ___/| |
(____/'(_)(_) (_) (_)(_) (_)`\__,_)`\____)(_)
=======================================================
=======================================================
-By Pradeep Kumar
https://github.com/CyberPlatoon/
""", 'green'))
Target = input(colored(" [+] Enter Your Target {Use http/https} : ", 'yellow', attrs=['bold']))
print("")
print(colored(" Wordlist Name; small, common, large", 'red', attrs=['bold','dark']))
print("")
wordlist = input(colored(" [+] Enter Wordlist : ", 'yellow', attrs=['bold']))
print("")
print(colored(" The File Name must end with .txt", 'red', attrs=['bold','dark']))
print("")
Output_File = input(colored(" [+] Enter Output File Name : ", 'yellow', attrs=['bold']))
print("\n")
#Output = open("Output/"+Output_File, "w")
file = open(wordlist+".txt", "r")
file_Ex = open("extensions.txt", "r")
for i in file.readlines():
url = Target +"/"+ i[0:len(i)-1]
response = requests.get(url)
#print("{} and {}".format(url,response.status_code))
status =response.status_code
size = response.headers.get('content-length', 0)
#SubOutput = str(subprocess.run("echo "+url+" > Output/"+Output))
if response.status_code==200:
#print(url+" ===> 200")
stu200 = url+" ===> 200"
print(colored(" [+] ", 'green') + stu200)
#print(SubOutput)
Output = open("Output/"+Output_File, "w")
Output.write(url)
Output.close()
if response.status_code==403:
#print(url+" ===> 403")
stu403 = url+" ===> 403"
print(colored(" [+] ", 'red') + stu403)
Output = open("Output/"+Output_File, "w")
Output.write(url)
Output.close()
print("\n")
print("\n")
print(colored(" [+] ** This is an Extensions file list like .php, .sql ** ", 'yellow', attrs=['bold','dark']))
print("\n")
#Output = open(Output_File, "w")
#file_Ex = open("ext.txt", "r")
for i in file_Ex.readlines():
url = Target +"/"+ i[0:len(i)-1]
response = requests.get(url)
#print("{} and {}".format(url,response.status_code))
status =response.status_code
size = response.headers.get('content-length', 0)
if response.status_code==200:
#print(url+" ===> 200")
satatus200 = url+" ===> 200"
print(colored(" [+] ", 'green') + satatus200)
Output = open("Output/"+Output_File, "w")
Output.write(url)
Output.close()
if response.status_code==403:
#print(url+" ===> 403")
satatus403 = url+" ===> 403"
print(colored(" [+] ", 'red') + satatus403)
Output = open("Output/"+Output_File, "w")
Output.write(url)
Output.close()
#file.close()
#Output.close()
file.close()
file_Ex.close()