Skip to content

Commit 5637898

Browse files
authored
Create dirbrute.py
1 parent 4befeec commit 5637898

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

directory_bruteforcing/dirbrute.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# importing requests python module1
2+
import requests
3+
4+
# enter your ip or domain which youre gonna search for
5+
url = input("Enter domain or IP :")
6+
7+
# path for the wordlists
8+
path = input("Enter Wordlist path :")
9+
10+
#opening the wordlists in read mode
11+
file = open(path, "r")
12+
13+
#sending the requests and with url, wordlists
14+
for i in range(len(file)):
15+
wls = file.readline()
16+
r = requests.get(url+wls)
17+
stats = r.status_code
18+
19+
# if the status code is 200 then it is success and there is folder exists
20+
if stats == 200:
21+
print("_"*50)
22+
print("Path :"+url+wls, (stats))
23+
print("_"*50)
24+
25+
# if the status code is 404 then it is not found means there is no such folder exists
26+
elif stats == 404:
27+
print("_"*50)
28+
print("Path :"+url+wls, (stats))
29+
print("_"*50)
30+
31+
# else if none of the above things exists
32+
else:
33+
print("_"*50)
34+
print("Path :"+url+wls, (stats))
35+
print("_"*50)
36+
37+
# closing the file
38+
file.close()

0 commit comments

Comments
 (0)