Skip to content

Commit 13f45d4

Browse files
Merge pull request #174 from kaifcodec/add/email-osint-modules
add(pipeline/): new category pipeline with 4 new modules
2 parents c0066e4 + 9a0c9a7 commit 13f45d4

5 files changed

Lines changed: 196 additions & 0 deletions

File tree

user_scanner/email_scan/pipeline/__init__.py

Whitespace-only changes.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import httpx
2+
from user_scanner.core.result import Result
3+
4+
5+
async def _check(email: str) -> Result:
6+
headers = {
7+
'authority': 'axonaut.com',
8+
'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
9+
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
10+
'referer': 'https://axonaut.com/en',
11+
'accept-language': 'en-US,en;q=0.9',
12+
}
13+
14+
try:
15+
async with httpx.AsyncClient(timeout=5.0, follow_redirects=False) as client:
16+
response = await client.get(
17+
f'https://axonaut.com/onboarding/?email={email}',
18+
headers=headers
19+
)
20+
21+
if response.status_code == 302 and "/login?email" in response.headers.get('Location', ''):
22+
23+
return Result.taken()
24+
25+
elif response.status_code == 200:
26+
return Result.available()
27+
28+
else:
29+
return Result.error(f"HTTP {response.status_code}")
30+
31+
except httpx.TimeoutException:
32+
return Result.error("Connection timed out")
33+
except Exception as e:
34+
return Result.error(str(e))
35+
36+
37+
async def validate_axonaut(email: str) -> Result:
38+
return await _check(email)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import httpx
2+
from user_scanner.core.result import Result
3+
4+
5+
async def _check(email: str) -> Result:
6+
headers = {
7+
'authority': 'api.hubspot.com',
8+
'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
9+
'content-type': 'application/json',
10+
'origin': 'https://app.hubspot.com',
11+
'referer': 'https://app.hubspot.com/',
12+
'accept-language': 'en-US,en;q=0.9',
13+
}
14+
15+
try:
16+
async with httpx.AsyncClient(timeout=5.0, follow_redirects=True) as client:
17+
payload = {
18+
"email": email,
19+
"password": "",
20+
"rememberLogin": False
21+
}
22+
23+
response = await client.post(
24+
'https://api.hubspot.com/login-api/v1/login',
25+
headers=headers,
26+
json=payload
27+
)
28+
29+
# HubSpot returns 400 for both "wrong password" and "user not found"
30+
if response.status_code == 400:
31+
data = response.json()
32+
status = data.get("status")
33+
34+
if status == "INVALID_PASSWORD":
35+
return Result.taken()
36+
37+
elif status == "INVALID_USER":
38+
return Result.available()
39+
40+
else:
41+
return Result.error(data)
42+
43+
return Result.error(f"HTTP {response.status_code}")
44+
45+
except httpx.TimeoutException:
46+
return Result.error("Connection timed out")
47+
except Exception as e:
48+
return Result.error(str(e))
49+
50+
51+
async def validate_hubspot(email: str) -> Result:
52+
return await _check(email)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import httpx
2+
from user_scanner.core.result import Result
3+
4+
5+
async def _check(email: str) -> Result:
6+
headers = {
7+
'authority': 'accounts.insightly.com',
8+
'accept': 'application/json, text/javascript, */*; q=0.01',
9+
'x-requested-with': 'XMLHttpRequest',
10+
'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
11+
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
12+
'origin': 'https://accounts.insightly.com',
13+
'referer': 'https://accounts.insightly.com/?plan=trial',
14+
'accept-language': 'en-US,en;q=0.9',
15+
}
16+
17+
try:
18+
async with httpx.AsyncClient(timeout=5.0, follow_redirects=True) as client:
19+
payload = {'emailaddress': email}
20+
21+
response = await client.post(
22+
'https://accounts.insightly.com/signup/isemailvalid',
23+
headers=headers,
24+
data=payload
25+
)
26+
27+
if "An account exists for this address." in response.text:
28+
return Result.taken()
29+
30+
elif response.text.strip() == "true":
31+
return Result.available()
32+
33+
else:
34+
return Result.error(f"Unexpected response: {response.status_code}")
35+
36+
except httpx.TimeoutException:
37+
return Result.error("Connection timed out")
38+
except Exception as e:
39+
return Result.error(str(e))
40+
41+
42+
async def validate_insightly(email: str) -> Result:
43+
return await _check(email)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import httpx
2+
from user_scanner.core.result import Result
3+
4+
5+
async def _check(email: str) -> Result:
6+
headers = {
7+
'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
8+
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
9+
'Accept': '*/*',
10+
'Origin': 'https://accounts.zoho.com',
11+
'Sec-Fetch-Site': 'same-origin',
12+
'Sec-Fetch-Mode': 'cors',
13+
'Sec-Fetch-Dest': 'empty',
14+
'Accept-Language': 'en-US,en;q=0.9',
15+
}
16+
17+
try:
18+
async with httpx.AsyncClient(timeout=5.0, follow_redirects=True) as client:
19+
await client.get("https://accounts.zoho.com/register", headers=headers)
20+
21+
csrf_cookie = client.cookies.get("iamcsr")
22+
if not csrf_cookie:
23+
return Result.error("CSRF cookie not found")
24+
25+
headers['X-ZCSRF-TOKEN'] = f'iamcsrcoo={csrf_cookie}'
26+
27+
payload = {
28+
'mode': 'primary',
29+
'servicename': 'ZohoCRM',
30+
'serviceurl': 'https://crm.zoho.com/crm/ShowHomePage.do',
31+
'service_language': 'en'
32+
}
33+
34+
response = await client.post(
35+
f'https://accounts.zoho.com/signin/v2/lookup/{email}',
36+
headers=headers,
37+
data=payload
38+
)
39+
40+
if response.status_code == 200:
41+
data = response.json()
42+
message = data.get("message")
43+
status = data.get("status_code")
44+
45+
if message == "User exists" and status == 201:
46+
return Result.taken()
47+
48+
elif status == 400:
49+
return Result.available()
50+
51+
else:
52+
return Result.error(data)
53+
54+
return Result.error(f"HTTP {response.status_code}")
55+
56+
except httpx.TimeoutException:
57+
return Result.error("Connection timed out")
58+
except Exception as e:
59+
return Result.error(str(e))
60+
61+
62+
async def validate_zoho(email: str) -> Result:
63+
return await _check(email)

0 commit comments

Comments
 (0)