forked from TideSec/WDScanner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskinfo.py
More file actions
executable file
·58 lines (48 loc) · 1.06 KB
/
Copy pathtaskinfo.py
File metadata and controls
executable file
·58 lines (48 loc) · 1.06 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# coding=utf-8
import urllib,time,os,base64,json
def get_html(url):
url=url.strip()
html=urllib.urlopen(url).read()
return html
def writefile(logname,cmd):
try:
fp = open(logname,'a')
fp.write(cmd+"\n")
fp.close()
except:
return False
def geturl(url):
now = time.strftime('%Y-%m-%d %X', time.localtime(time.time()))
date = time.strftime('%Y-%m-%d', time.localtime(time.time()))
try:
a = get_html(url)
print a
if len(a) > 50:
base = base64.b64decode(a)
print base
json_arr = json.loads(base)
target_url = json_arr['target_url']
hash = json_arr['hash']
task(target_url )
except Exception , e:
info = '%s\nError: %s' %(now,e)
writefile('logs\\%s-Error.log'%date,info)
print info
def task(target):
print target
#exit()
url = 'http://127.0.0.1/taskinfo.php'
i = 0
while 1:
now = time.strftime('%Y-%m-%d %X', time.localtime(time.time()))
#print now
try:
#if 1==1:
a = geturl(url)
i +=1
time.sleep(5)
except Exception , e:
info = '%s\nError: %s' %(now,e)
writefile('Error.log',info)
print info
time.sleep(1)