-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathping.py
31 lines (19 loc) · 810 Bytes
/
ping.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
from time import sleep
import requests
import random
def ping(domain):
try:
ping_servers =[ "https://helloacm.com/api/ping/?host=",
"https://uploadbeta.com/api/ping/?host=",
"https://happyukgo.com/api/ping/?host=" ]
server = random.choice(ping_servers)
# https://helloacm.com/api/ping/?host=HelloACM.com
base_url = server + str(domain)
print("[+] Requesting ping from: %s" % base_url)
r = requests.get(base_url, headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1'})
json_result = r.json()
print('[+] Sleeping for five seconds')
sleep(5)
return str(json_result)
except:
print("[!] Error getting ping response")