File size: 28,508 Bytes
aefeb4e
bbd669a
 
aefeb4e
 
 
 
 
 
 
bbd669a
 
aefeb4e
 
 
bbd669a
aefeb4e
 
 
 
 
 
 
 
cf46076
bbd669a
aefeb4e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bbd669a
aefeb4e
 
 
 
 
 
bbd669a
aefeb4e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6f9fe47
aefeb4e
 
 
bbd669a
aefeb4e
 
 
 
 
 
 
 
 
 
 
 
 
bbd669a
aefeb4e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
Intent	Script
Except do nothing	except: \n pass
Except call the function exit with argument 0 of sys	except: \n     sys.exit(0)
Check if the images contain Exif data, if it does then for each tuple tag and value in it decode it	try: \n         exifData = {} \n         imgFile = Image.open(imgFileName) \n         info = imgFile._getexif() \n         if info: \n             for (tag, value) in info.items(): \n                 decoded = TAGS.get(tag, tag) \n                 exifData[decoded] = value \n             exifGPS = exifData['GPSInfo'] \n     except: \n         pass \n
If url is None then exit with argument 0	if url == None: \n exit
Else assign to skypeDB the path of main.db inside the pathName	else: \n         skypeDB = os.path.join(pathName, 'main.db')
If lport is equal to None then assign to lport the value '1337'	if lport == None: \n         lport = '1337'
If state is equal to 'open' then call the method append with argument host of tgtHosts	if state == 'open': \n                 tgtHosts.append(host)
If passwdFile is not equal to None then call the function smbBrute with arguments configFile, tgtHost, passwdFile, lhost and lport	if passwdFile != None: \n             smbBrute(configFile,tgtHost,passwdFile,lhost,lport)
For each sid in dirList call the function listDir with argument recycleDir concatenated to sid of os and assign it to files and call the function sid2user with argument sid and assign it to user	for sid in dirList: \n         files = os.listdir(recycleDir + sid) \n         user = sid2user(sid)
Try Attempt to process network data using dpkt library, Parse Ethernet and IP headers from input buffer buf, extract source and destination IP addressese, convert them to readable format using socket.inet_ntoa(), retrieve KML representations for source and destination IPs via retKML() function	try: \n             eth = dpkt.ethernet.Ethernet(buf) \n             ip = eth.data \n             src = socket.inet_ntoa(ip.src) \n             srcKML = retKML(src) \n             dst = socket.inet_ntoa(ip.dst) \n             dstKML = retKML(dst) \n             kmlPts = kmlPts + srcKML + dstKML \n
Except exit function with value ''	except: \n         return ''
If the method isdir with argument recycleDir of path of os returns True then Exit the function with value recycleDir	if os.path.isdir(recycleDir): \n             return recycleDir
For each image in image_tags assign to filename the result of the method lstrip with argument 'http://'  of image with key 'src', assign to filename the function join of path of os with arguments dir and the method replace with arguments '/' and '_' of filename, assign to filename the function join of path of os with arguments dir and the method replace with arguments '/' and '_' of filename, assign to data the method read with no argument of the method open with argument image with key 'src' of ab, call the method back with no argument of ab, open the filename with option 'wb' and assign it to save, call the method write with argument data of save and close the save file	for image in image_tags: \n         filename = image['src'].lstrip('http://') \n         filename = os.path.join(dir,filename.replace('/', '_')) \n         data = ab.open(image['src']).read() \n         ab.back() \n         save = open(filename, 'wb') \n         save.write(data) \n         save.close() \n
If the substring message is in the function str with argument row exit function with argument True	if 'message' in str(row): \n                 return True
Except call exit function with argument 0	except: \n exit(0)
Get the image from imgTag, download it into a file and return it	try: \n         imgSrc = imgTag['src'] \n         imgContent = urllib2.urlopen(imgSrc).read() \n         imgFileName = basename(urlsplit(imgSrc)[2]) \n         imgFile = open(imgFileName, 'wb') \n         imgFile.write(imgContent) \n         imgFile.close() \n         return imgFileName \n
If value Fails is more than 5 then call the function exit with argument 0	if Fails > 5: \n exit(0)
Scan the tgtHost on tgtPort with nmap and calculate the state	def nmapScan(tgtHost,tgtPort): \n     nmScan = nmap.PortScanner() \n     nmScan.scan(tgtHost,tgtPort) \n     state=nmScan[tgtHost]['tcp'][int(tgtPort)]['state' \n
For each row in c assign to host the value of the function str with argument row at the position 0, assign to name the value of the function str with argument row at the position 1 and assign to value the value of the function str with argument row at the position 2	for row in c: \n             host = str(row[0]) \n             name = str(row[1]) \n             value = str(row[2] \n
Else assign to count the count of options	else: \n         iface = options.iface
Else assign to iface the value iface of options	else: \n         iface = options.iface
If thresh of options is not None assign to THRESH the value thresh of options	if options.thresh != None: \n         THRESH = options.thresh
Else Assign to msgDirection the concatenation of From, the function str with argument row at position 1 and :	else: \n
Exit with value 0	exit(0)
except call method Call method acquire on screenLock with no arguments	except: \n screenLock.acquire()
Else Call the function printNets with arguments username and password	else: \n         printNets(username, password)
If pcapFile of options is equal to None Call the exit function with argument 0	if options.pcapFile == None: \n         exit(0)
If pktCount contains the key stream increment of one the pktCount at the key stream	if pktCount.has_key(stream): \n                     pktCount[stream] = pktCount[stream] + 1
Define the method __init__ with arguments self, title, text and url and return the title of self	def __repr__(self): \n         return self.title
For each result in response with keys 'responseData' and 'results', assign to url the result with key 'url', assign to title the result with key 'titleNoFormatting', assign to text the result with key 'content', assign to new_gr the result of the function Google_result with arguments title, text, url and append the new_gr to the list results	for result in objects['responseData']['results']: \n         url = result['url'] \n         title = result['titleNoFormatting'] \n         text = result['content'] \n         new_gr = Google_Result(title, text, url) \n         results.append(new_gr) \n
If keyword of options is equal to None call the function exit with argument 0	if options.keyword == None:    \n     exit(0)
Else assign to results the result of the function google with argument keyword	else: \n         results = google(keyword)
Given a string, make a google research with the ajax apis and get the response	def google(search_term): \n     ab = anonBrowser() \n  \n     search_term = urllib.quote_plus(search_term) \n     response = ab.open('http://ajax.googleapis.com/'+       'ajax/services/search/web?v=1.0&q='+ search_term) \n
Define the function __init__ with arguments self and handle, assign to handle of self handle and assign to tweets of self the result of the method get_tweets with no argument of self	def __init__(self, handle): \n         self.handle = handle \n         self.tweets = self.get_tweets() \n
For each result in json_objects with key 'results' assign to new_result an empty dictionary, assign to new_result with key 'from_user' the value of result with key 'from_user_name', assign to new_result with key 'geo' the value of result with key 'geo', assign to new_result with key 'tweet' the value of result with key 'text'and append to tweets the new_result	for result in json_objects['results']: \n             new_result = {} \n             new_result['from_user'] = result['from_user_name'] \n             new_result['geo'] = result['geo'] \n             new_result['tweet'] = result['text'] \n             tweets.append(new_result) \n
If link at position 0 exists assign to link the link at the position 0	if link[0]: \n                     link = link[0]
Else continue	else: \n                    continue
Except do nothing	except: \n                 pass
For each line in the method readlines called with no arguments of the opened file cityFile assign to city the string stripped of '\n' and '\r' in low case and append to the list cities the city	for line in open(cityFile).readlines(): \n                 city = line.strip('\n').strip('\r').lower() \n                 cities.append(city)
If tweet with key 'geo' is not equal to None append to locations the tweet with key 'geo' and increment locCnt of 1	if tweet['geo'] != None: \n                 locations.append(tweet['geo']) \n                 locCnt += 1
If the substring city is in tweetsText append to locations the value city and increment cityCnt of 1	if city in tweetsText: \n                 locations.append(city) \n                 cityCnt += 1
For each line in the method readlines with no argument of the opened file cityFile assign the line stripped of '\n' and '\r' in lower case to city and append city to cities	for line in open(cityFile).readlines(): \n city=line.strip('\n').strip('\r').lower() \n cities.append(city) \n
If tweet with key 'geo' is not equal to None append the tweet with key 'geo' to locations and increment locCnt of 1	if tweet['geo'] != None: \n             locations.append(tweet['geo']) \n             locCnt += 1  \n
If the substring city is in tweetsText append the city to locations and increment cityCnt of 1	if city in tweetsText: \n     locations.append(city) \n     cityCnt+=1  \n
If cityFile is not equal to None, call the function load_cities with argument cityFile and assign the result to cities	if (cityFile!=None): \n  cities = load_cities(cityFile)
For each result in json_objects with key 'result' assign to new_result an empty dictionary, assign to new_result with key 'from_user' the variable result with key 'from_user_name', assign to new_result with key 'geo' the variable result with key 'geo', assign to new_result with key 'tweet' the variable result with key 'text' and append to tweets the new_result	for result in json_objects['results']: \n         new_result = {} \n         new_result['from_user'] = result['from_user_name'] \n         new_result['geo'] = result['geo'] \n         new_result['tweet'] = result['text'] \n         tweets.append(new_result) \n
If link in position 0 exists, assign link in position 0 to link	if link[0]: \n                 link = link[0]
Else if link in position 1 exists, assign link in position 1 to link	elif link[1]: \n                link = link[1]
Else continue	else: \n                 continue
Start try block assign the result of the function urlopen with argument link of urllib2, assign the response of url to full_link, append full_link to interests with key links	try: \n                 response = urllib2.urlopen(link) \n                 full_link = response.url \n                 interests['links'].append(full_link) \n
Except do nothing	except: \n                 pass
If handle is equal to None call the function exit to 0	if (handle==None): \n     exit(0)
Define the function __init__ with arguments self, first_name, last_name, job equals to '' and social media equals to {}, assign to first_name of self the value first_name, assign to last_name of self the value last_name, assign to job of self the value job and assign to social_media of self the value social_media	def __init__(self,first_name,last_name,      job='',social_media={}): \n         self.first_name = first_name \n         self.last_name = last_name \n         self.job = job \n         self.social_media = social_media \n
Define the method __repr__  with argument self and return the concatenation of first_name of self, ' ', last_name of self + ' has job ' + job of self	def __repr__(self): \n         return self.first_name + ' ' +          self.last_name + ' has job ' + self.job \n
If the variable social_media of self has the key media_name return the variable social_media with key media_nameof self	if self.social_media.has_key(media_name): \n             return self.social_media[media_name] \n
For each result in json_object with key response assign an empty dictionary to new_result, assign result with key 'from_user_name' to new_result with key 'from_user', assign result with key 'geo' to new_result with key 'geo' assign result with key 'text' to new_result with key 'tweet' and append new_result to results	for result in json_objects['results']: \n             new_result = {} \n             new_result['from_user'] = result['from_user_name'] \n             new_result['geo'] = result['geo'] \n             new_result['tweet'] = result['text'] \n             results.append(new_result) \n
Try to assign the result of the function SMTP of smtplib with arguments 'smtp.gmail.com and 587 to smtpServer, call the method ehlo with no argument of smtpServer, call the method starttls with no argument of smtpServer, call the method ehlo with no argument of smtpServer, call the method login with arguments user and pwd of smtpServer, call the method sendmail with arguments user, to and the method as_string with no argument of msg of smtpServer and call the method close with no argument of smtpServer	try: \n smtpServer = smtplib.SMTP('smtp.gmail.com', 587) \n smtpServer.ehlo() \n smtpServer.starttls() \n smtpServer.ehlo() \n smtpServer.login(user, pwd) \n smtpServer.sendmail(user, to, msg.as_string()) \n smtpServer.close() \n
Except do nothing	except: \n      pass \n
If handle is equal to None or tgt is equal to None      or user  is equal to None or pwd is equal to None call the function exit with argument 0	if handle == None or tgt == None      or user ==None or pwd==None: \n         exit(0) \n
"If location is not equal to None assign the result of the function choice with argument location to randLoc and concatenate the concatenation of "" Its me from "", randLoc and ""."" to spamMsg"	"if (location!=None): \n randLoc=choice(location) \n spamMsg += "" Its me from ""+randLoc+""."" \n"
"If interests with key 'users' is not equal to None assign to randUser the result of the function choice with argument interests with key 'users' and concatenate the concatenation of "" "", randUser and "" said to say hello."" to spamMsg"	"if (interests['users']!=None): \n randUser=choice(interests['users']) \n spamMsg += "" ""+randUser+"" said to say hello.""  \n"
"If interests with key 'hashtags' is not equal to None assign to randHash the result of the function choice with argument interests with key 'hashtags' concatenate the concatenation of "" Did you see all the fuss about "", randHash and ""?"" to spamMsg"	"if (interests['hashtags']!=None): \n randHash=choice(interests['hashtags']) \n spamMsg += "" Did you see all the fuss about ""+          randHash+""?"" \n"
"If interests with key 'links' is not equal to None assign to randLink the result of the function choice with argument interests with key 'links' and concatenate the concatenation of "" I really liked your link to: "", randLink and ""."" to spamMsg"	"if (interests['links']!=None): \n randLink=choice(interests['links']) \n spamMsg += "" I really liked your link to: ""+          randLink+""."" \n"
For each imgTag in imgTags download the image imgTag and assign it to imgFileName and call the function testForExif with argument imgFileName	for imgTag in imgTags: \n             imgFileName = downloadImage(imgTag) \n             testForExif(imgFileName)
"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"
Else if ret equals 3 Increment the variable Fails of one	elif ret == 3: \n             Fails += 1
If the thresh of options is not equal to None assign to THRESH the value thresh of options	if options.thresh != None: \n         THRESH = options.thresh
For each row in c assign to date the result of the function str with argument row at the position 0, assign to addr the result of the function str with argument row at the position 1 and Assign to text the variable row at position 2	for row in c: \n             date = str(row[0]) \n             addr = str(row[1]) \n             text = row[2] \n
Connect to downloadDB database and execute the command 'SELECT name, source, datetime(endTime/1000000,\'unixepoch\') FROM moz_downloads;'	def printDownloads(downloadDB): \n     conn = sqlite3.connect(downloadDB) \n     c = conn.cursor() \n     c.execute('SELECT name, source, datetime(endTime/1000000,\'unixepoch\') FROM moz_downloads;' \n
If the substring encrypted is in the string e Call the function exit  with argument 0	if 'encrypted' in str(e): \n             exit(0)
If value Stop is equal to True then call function exit with argument 0	if Stop: \n exit(0)
Else if ret is more than 3 Assign True to the variable Stop	elif ret > 3: \n             Stop = True
Start expect block with Exception and e and exit the function with argument False	except Exception, e: \n return False
Else assign an empty list to dnsRecords at the key rrname and append to the list dnsRecords at the key rrname the value rdata	else: \n             dnsRecords[rrname] = [] \n             dnsRecords[rrname].append(rdata)
Else assign to geoLoc the variable country	else: \n  geoLoc = country
Start expect block and exit function with argument False	except: \n         return False
If url is equal to None or if dir is equal to None call the function exit with argument 0	if url == None or dir == None: \n         exit(0)
Else if the folder does not exists Call the function exit with argument 0	elif os.path.isdir(pathName) == False: \n         exit(0)
Else Assign to iface of conf the value iface of options	else: \n         conf.iface = options.iface
Try to call the function mirrorImages with arguments url and dir	try: \n             mirrorImages(url, dir)
Connect with protocol ssx	def connect(self): \n         try: \n             s = pxssh.pxssh() \n             s.login(self.host, self.user, self.password) \n             return s \n
If the functions len with argument argv of sys returns a value bigger than 2 then assign to platform the value argv at position 2 of sys	if len(sys.argv) > 2: \n    platform = sys.argv[2]
If __name__ equals '__main__' then call function main with no arguments	if __name__ == '__main__': \n main()
If cookiesDB is a file call the function printCookies with argument cookiesDB	if os.path.isfile(cookiesDB): \n             printCookies(cookiesDB)
Else  Assign to src the src of options	else: \n              src = options.src
Try a connection FTP to hostname, login with userName and passWord then quit and return userName and passWord	try: \n             ftp = ftplib.FTP(hostname) \n             ftp.login(userName, passWord) \n             ftp.quit() \n             return (userName, passWord) \n
Start except block \n Do nothing	except: \n pass
Start except block with Exception and e then do nothing	except Exception, e: \n             pass
Try to connect to hostname with FTP protocol, with credentials 'anonymous' and '[email protected]', quit the connection and then return True	try: \n         ftp = ftplib.FTP(hostname) \n         ftp.login('anonymous', '[email protected]') \n         ftp.quit() \n         return True \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"
Except do nothing	except: \n         pass
If host is equals to None or passDir is equals to None or User is equals to None then call function exit with argument 0	if host == None or passDir == None or user == None: \n exit(0)
Expect Exit the function with sid value	except: \n         return sid
If downloadDB is a file Call the function printDownloads with argument downloadDB	if os.path.isfile(downloadDB): \n             printDownloads(downloadDB)
Try to create the scoket with parameters AF_INET and SOCK_STREAM, connect to tgtHost on tgtPort, send the messsage 'ViolentPython\r\n', Receive the response in result and acquire the lock	try:\n         connSkt = socket(AF_INET, SOCK_STREAM)\n         connSkt.connect((tgtHost, tgtPort))\n         connSkt.send('ViolentPython\r\n')\n         results = connSkt.recv(100)\n         screenLock.acquire()
Try to call the function printMessage with argument iphoneDB	try: \n               printMessage(iphoneDB)
If rdata is not in the lust dnsRecords with key rrname append to the list dnsRecords at the key rrname the value rdata	if rdata not in dnsRecords[rrname]: \n                 dnsRecords[rrname].append(rdata)
If fileName is equal to None \n Call the function exit with argument 0	if fileName == None: \n         exit(0)
Define the function send_command with arguments s and cmd then call method sendline with argument cmd on s and call method prompt with no argument on s	def send_command(s, cmd): \n     s.sendline(cmd) \n     s.prompt()
If the variable tgtHost of options is equal to None or lhost of options is equal to None then call the exit function with argument 0	if (options.tgtHost == None) | (options.lhost == None): \n         exit(0)
For each link in links do nothing do nothing	for link in links: \n             pass
If the substring '!lazor' is in data of tcp in lower case do nothing	if '!lazor' in tcp.data.lower(): \n pass
Else call the function printLinks with argument url	else: \n         printLinks(url)
Except do nothing	except: \n             pass
Else print metadata information associated with the given fileName	else: \n         printMeta(fileName)
Else assign to dst the tgt of options	else: \n         dst = options.tgt
"If the method iptype with no argument of the function IPTEST with argument ipsrc is equal to ""PRIVATE"" then exit function with no argument"	if IPTEST(ipsrc).iptype() == 'PRIVATE': \n         return
Try to call the method connect with a tuple made of target and 21 of s	try: \n     s.connect((target,21))
try to call the method gethostbyname with argument tgtHost and assign the result to tgtIP	try: \n tgtIP = gethostbyname(tgtHost)
For each row in c assign to url the result of function str with argument row at position 0 and assign to date the result of function str with argument row at position 1	for row in c: \n             url = str(row[0]) \n             date = str(row[1]) \n
Start the try block then call the function nlst with no argument from the library ftp and assign to dirList	try: \n         dirList = ftp.nlst()
For each sport in range from 1023 to 65535 assign to IPlayer the result of the function IP with src equals src and dst equals to tgt, assign to TCPlayer the result of the function TCP with argument sport equals sport and dport equals to 513, divide IPlayer by TCPlayer and assign it to pkt and call the function send with argument pkt	for sport in range(1024,65535): \n         IPlayer = IP(src=src, dst=tgt) \n         TCPlayer = TCP(sport=sport, dport=513) \n         pkt = IPlayer / TCPlayer \n         send(pkt) \n
Else assign to synSpoof the sunSpoof of options, assign to srcSpoof the srcSpoof of options and assign to tgt the tgt of options	else: \n         synSpoof = options.synSpoof \n         srcSpoof = options.srcSpoof \n         tgt = options.tgt \n
If the src of options is equal to None create a random source IP	if options.src == None: \n         src = '.'.join([str(randint(1,254)) for x in range(4)])
Try to call function pxssh of library pxssh with no arguments and assign it to s, call method login with arguments host, user and password and return the value s	try: \n         s = pxssh.pxssh() \n         s.login(host, user, password) \n         return s
for each tgtPort in tgtPorts call the function nmapScan with arguments tgtHost and tgtPort	for tgtPort in tgtPorts: \n nmapScan(tgtHost, tgtPort)
if pathName is equal to None \n call the function exit with argument 0	if pathName == None: \n         exit(0)
If the iface of options is equal to None assign to iface of conf the string 'eth0'	if options.iface == None: \n         conf.iface = 'eth0'
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 then call the exit function with argument 0	if options.synSpoof == None or options.srcSpoof == None or options.tgt == None: \n
If the absolute value of ttl casted to int minus the ttlValues at the hey ipsrc casted at int is more than THRESH do nothing	if abs(int(ttl) - int(ttlValues[ipsrc])) > THRESH: \n         pass
Try to  get source and destination from an IP packet	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
Except exit the cycle	except: \n             break
If the functions len with argument argv of sys returns a value less than 2 then call the function exit with argument 0	if len(sys.argv) < 2: \n      sys.exit(0)
Start expect block and do nothing	except: \n                     pass
Try to assign to longitude the field 'longitude' of rec, assign to latitude the field 'latitude'  of rec, create the tuple kml with arguments '<Placemark>\n', '<name>%s</name>\n',  '<Point>\n', '<coordinates>%6f, %6f</coordinates>\n',  '</Point>\n' and '</Placemark>\n' and return the variable kml	try: \n         longitude = rec['longitude'] \n         latitude = rec['latitude'] \n         kml = (               '<Placemark>\n', '<name>%s</name>\n',  '<Point>\n', '<coordinates>%6f, %6f</coordinates>\n',           '</Point>\n','</Placemark>\n') \n         return kml \n
Try to call the method pxssh with no arguments of the package pxssh and assign it to s, Call the method login with arguments host, user and password of s and Assign the value True to the variable Found	try: \n s = pxssh.pxssh() \n s.login(host, user, password) \n Found = True
If the method haslayer with argument IP of pkt is equals to True assign to ipsrc the src of the method getlayer with argument IP of pkt, assign to ipsrc the src of the method getlayer with argument IP of pkt and assign to ttl the ttl of pkt casted to str	if pkt.haslayer(IP): \n             ipsrc = pkt.getlayer(IP).src \n             ttl = str(pkt.ttl) \n             checkTTL(ipsrc, ttl) \n
If ret is equal to 0 then exit the function	if ret == 0: \n return
Else assign to THRESH five	else: \n         THRESH = 5
if pathName is equal to None call the function exit with argument 0	if pathName == None: \n         exit(0)
If placesDB is a file Call the function printHistory with argument placesDB and Call the function printGoogle with argument placesDB	if os.path.isfile(placesDB): \n             printHistory(placesDB) \n             printGoogle(placesDB)
if the function str with argument row at position 1 is not equal to function str with argument row at position 2 assign to msgDirection the concatenation of To, the function str with argument row at position 1 and :	if str(row[1]) != str(row[2]): \n                     msgDirection = 'To ' + str(row[1]) + ': '
For each ch in val increase addr with value '%02x ' module of the result of the function ord with argument ch	for ch in val: \n        addr += '%02x ' % ord(ch)
If rLat exists then 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	if rLat: \n         mapLat = rLat[0].split('&')[0].split('=')[1]
If tgt of options is equal to None call the function exit with argument 0	if options.tgt == None: \n         exit(0)
If the method has_key with argument ipsrc of ttlValues is not True 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 and assign to ttlValues at the key ipsrc the value ttl of pkt	if not ttlValues.has_key(ipsrc): \n         pkt = sr1(IP(dst=ipsrc),ICMP(), retry=0, timeout=1, verbose=0) \n         ttlValues[ipsrc] = pkt.ttl
Start except block with Exception e and do nothing	except Exception, e: \n             pass