/
wordpress.py
71 lines (66 loc) · 2.7 KB
/
wordpress.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
from holehe.core import *
from holehe.localuseragent import *
async def wordpress(email, client, out):
name = "wordpress"
domain = "wordpress.com"
method= "login"
frequent_rate_limit=False
cookies = {
'G_ENABLED_IDPS': 'google',
'ccpa_applies': 'true',
'usprivacy': '1YNN',
'landingpage_currency': 'EUR',
'wordpress_test_cookie': 'WP+Cookie+check',
}
headers = {
'User-Agent': random.choice(ua["browsers"]["firefox"]),
'Accept': '*/*',
'Accept-Language': 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3',
'DNT': '1',
'Connection': 'keep-alive',
'TE': 'Trailers',
}
params = {
'http_envelope': '1',
'locale': 'fr',
}
try:
response = await client.get('https://public-api.wordpress.com/rest/v1.1/users/' + email + '/auth-options', headers=headers, params=params, cookies=cookies)
except Exception:
out.append({"name": name,"domain":domain,"method":method,"frequent_rate_limit":frequent_rate_limit,
"rateLimit": True,
"exists": False,
"emailrecovery": None,
"phoneNumber": None,
"others": None})
return None
info = response.json()
if "email_verified" in info["body"].keys():
if info["body"]["email_verified"]:
out.append({"name": name,"domain":domain,"method":method,"frequent_rate_limit":frequent_rate_limit,
"rateLimit": False,
"exists": True,
"emailrecovery": None,
"phoneNumber": None,
"others": None})
else:
out.append({"name": name,"domain":domain,"method":method,"frequent_rate_limit":frequent_rate_limit,
"rateLimit": False,
"exists": False,
"emailrecovery": None,
"phoneNumber": None,
"others": None})
elif "unknown_user" in str(info) or "email_login_not_allowed" in str(info):
out.append({"name": name,"domain":domain,"method":method,"frequent_rate_limit":frequent_rate_limit,
"rateLimit": False,
"exists": False,
"emailrecovery": None,
"phoneNumber": None,
"others": None})
else:
out.append({"name": name,"domain":domain,"method":method,"frequent_rate_limit":frequent_rate_limit,
"rateLimit": True,
"exists": False,
"emailrecovery": None,
"phoneNumber": None,
"others": None})