-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipa4.py
149 lines (112 loc) · 3.04 KB
/
ipa4.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import requests;from requests import *
import json
import socket
import threading
import concurrent.futures
import os
import sys
import time
import random
import subprocess
import platform
ip = input("\n<IP&4>: ")
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
bytes = random._urandom(1024)
print_lock = threading.Lock()
response = requests.get(f'http://ip-api.com/json/{ip}').content
data = json.loads(response)
try:
print(f"""
[+]IP: {data['query']}
[+]Country: {data['country']}
[+]Region: {data['regionName']}
[+]City: {data['city']}
[+]Zip: {data['zip']}
[+]Latitude: {data['lat']}
[+]Longitude: {data['lon']}
[+]ISP: {data['isp']}
[+]ICMP reply: {data ['status']}""")
except:
print("\n[!]This ip seems to be invalid.")
exit()
response = requests.get("https://vpnapi.io/api/" + ip + "?key=ca7522e3d80a4e308945e0ca3c979d6c")
data = json.loads(response.text)
if data["security"]["vpn"] == False:
pass
else:
print("[!]Possible VPN or Traffic Hosting service Detected")
if data["security"]["proxy"] == False:
pass
else:
print("[!]Proxy Server Detected")
if data["security"]["tor"] == False:
pass
else:
print("[!]Tor Anonymity Service Detected")
response = requests.get(f'http://ip-api.com/json/{ip}').content
data = json.loads(response)
string = f'''{data['isp']}'''
string = str(string)
if "Cloudflare, Inc." in string:
print("[!]Cloudflare Service Detected")
pass
response = requests.get(f'http://ip-api.com/json/{ip}').content
data = json.loads(response)
string = f'''{data['isp']}'''
string = str(string)
if "OVH" in string:
print("[!]Possible OVH Detected")
else:
pass
response = requests.get(f'http://ip-api.com/json/{ip}').content
data = json.loads(response)
string = f'''{data['isp']}'''
string = str(string)
if "Google" in string:
print("[!]Possible Google service Detected")
else:
pass
response = requests.get(f'http://ip-api.com/json/{ip}').content
data = json.loads(response)
string = f'''{data['isp']}'''
string = str(string)
if "Amazon" in string:
print("[!]Possible Amazon service Detected")
else:
pass
response = requests.get(f'http://ip-api.com/json/{ip}').content
data = json.loads(response)
string = f'''{data['isp']}'''
string = str(string)
if "Facebook" in string:
print("[!]Possible Facebook service Detected")
else:
pass
response = requests.get(f'http://ip-api.com/json/{ip}').content
data = json.loads(response)
string = f'''{data['isp']}'''
string = str(string)
if "Microsoft" in string:
print("[!]Possible Microsoft service Detected")
else:
pass
host = ip
ip = socket.gethostbyname(host)
response = requests.get(f'http://ip-api.com/json/{ip}').content
data = json.loads(response)
cunt = data['country']
headers = {
"Range": "bytes=0-%s" % "".join(
[",5-%s" % x for x in range(1,1301)]
),
"Accept-Encoding": "gzip",
"Connection": "close",
}
try:
host = 'http://'+host
h = httplib2.Http()
resp, cont = h.request(host, "HEAD", headers=headers)
print("[Web-Server]",resp["server"])
except:
pass
time.sleep(10)