-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusername_enum.py
More file actions
39 lines (34 loc) · 1.29 KB
/
username_enum.py
File metadata and controls
39 lines (34 loc) · 1.29 KB
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
from urllib.request import urlopen
from urllib.error import HTTPError
import json
# print("Username Enumeration", "\n")
def username_enum(url):
# url = input("Enter URL : ")
try:
enum = "wp-json/wp/v2/users/"
username_enum = url + enum
# print(username_enum, "\n","\n")
page = urlopen(username_enum)
content = page.read()
json_parse = json.loads(content)
for i in json_parse:
print(i['name'])
except HTTPError as e:
with open ("username_enum_bypass.txt","r") as file:
for i in file:
try:
words = i.split()
for word in words:
# print(word)
username_enum = url + word
# print(username_enum,"\n")
page = urlopen(username_enum)
content = page.read()
json_parse = json.loads(content)
for i in json_parse:
print(i['name'])
except:
print("Username Not Found")
continue
if e.code == 403:
print("403 Error","\n")