File size: 2,929 Bytes
3b35861
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Intent	Script
"Connect to the database skypeDB and execute the command ""SELECT displayname, skypename, city, country,phone_mobile, birthday FROM Contacts;"""	"def printContacts(skypeDB): \n     conn = sqlite3.connect(skypeDB) \n     c = conn.cursor() \n     c.execute(""SELECT displayname, skypename, city, country,phone_mobile, birthday FROM Contacts;"" \n
"
"Connect to the database skypeDB and execute the command ""SELECT datetime(begin_timestamp,'unixepoch'),  identity FROM calls, conversations WHERE  calls.conv_dbid = conversations.id;"""	"def printCallLog(skypeDB): \n     conn = sqlite3.connect(skypeDB) \n     c = conn.cursor() \n     c.execute(""SELECT datetime(begin_timestamp,'unixepoch'),  identity FROM calls, conversations WHERE  calls.conv_dbid = conversations.id;"" \n
    "
Given an pcap get in tcp data '!lazor' in lower case on source or destination port 6667	"def findHivemind(pcap): \n     for (ts, buf) in pcap: \n         try: \n             eth = dpkt.ethernet.Ethernet(buf) \n             ip = eth.data \n             src = socket.inet_ntoa(ip.src) \n             dst = socket.inet_ntoa(ip.dst) \n             tcp = ip.data \n             dport = tcp.dport \n             sport = tcp.sport \n             if dport == 6667: \n                 if '!lazor' in tcp.data.lower(): \n                     pass \n             if sport == 6667: \n                 if '!lazor' in tcp.data.lower(): \n                     pass \n         except: \n             pass \n
"
Given a pkt, get all dnsRecords correlated	"def handlePkt(pkt): \n     if pkt.haslayer(DNSRR): \n         rrname = pkt.getlayer(DNSRR).rrname \n         rdata = pkt.getlayer(DNSRR).rdata \n         if dnsRecords.has_key(rrname): \n             if rdata not in dnsRecords[rrname]: \n                 dnsRecords[rrname].append(rdata) \n         else: \n             dnsRecords[rrname] = [] \n             dnsRecords[rrname].append(rdata) \n
"
Get city, region, country, longitude and latitude given an IP	"def printRecord(tgt): \n     rec = gi.record_by_name(tgt) \n     city = rec['city'] \n     region = rec['region_name'] \n     country = rec['country_name'] \n     long = rec['longitude'] \n     lat = rec['latitude'] \n
"
Create the file page, add the substring .tmp in write mode, then write the redirects in f	"def injectPage(ftp, page, redirect): \n     f = open(page + '.tmp', 'w') \n     ftp.retrlines('RETR ' + page, f.write) \n  \n     f.write(redirect) \n     f.close() \n  \n     ftp.storlines('STOR ' + page, open(page + '.tmp')) \n
"
Calculate the correct TCP sequence number	def calTSN(tgt): \n     seqNum = 0 \n     preNum = 0 \n     diffSeq = 0 \n  \n     for x in range(1, 5): \n         if preNum != 0: \n             preNum = seqNum \n         pkt = IP(dst=tgt) / TCP() \n         ans = sr1(pkt, verbose=0) \n         seqNum = ans.getlayer(TCP).seq \n         diffSeq = seqNum - preNum \n     return seqNum + diffSeq \n