def statusAlert(subject, content): smtpServer = 'smtp.btconnect.com' sender = '*****@*****.**' destination = ['*****@*****.**'] debugLevel = False try: # Notify ! alertSubject = "honeypot status : " + subject alertContent = content + "\n\nSent by Kojoney Honeypot\n\n" #print "alert subject:" + alertSubject + "\nalertContent:\n" + content + "\n" status = mailalert.mailalert(sender, destination, smtpServer, alertSubject, alertContent, debugLevel) print "notify : e-mail : subject=" + '"' + alertSubject + '"' # Add a record to syslog a = "Sent alert e-mail, Subject=" + alertSubject + " to " + destination[ 0] syslog.syslog(a) except Exception, e: syslog.syslog("kojoney_tail.py : statusAlert() : " + ` e `)
def statusAlert(subject, content): smtpServer = 'smtp.btconnect.com' sender = '*****@*****.**' destination = ['*****@*****.**'] debugLevel = False try: now = time.time() nowLocal = time.gmtime(now) # Notify ! alertSubject = "honeypot status : " + subject alertContent = content + "\n\nSent by Kojoney Honeypot on " + time.asctime( nowLocal) + "\n\n" #print "alert subject:" + alertSubject + "\nalertContent:\n" + content + "\n" status = mailalert.mailalert(sender, destination, smtpServer, alertSubject, alertContent, debugLevel) # uncomment the following line if you want to see the e-mail being sent print "notify : e-mail : subject=" + '"' + alertSubject + '"' # Add a record to syslog a = "Sent alert e-mail, Subject=" + alertSubject + " to " + destination[ 0] syslog.syslog(a) except Exception, e: syslog.syslog("kojoney_tweet.py : statusAlert() : " + ` e `)
def statusAlert(subject, content): smtpServer = 'smtp.btconnect.com' sender = '*****@*****.**' #destination = ['*****@*****.**'] destination = ['*****@*****.**'] debugLevel = False try: # Notify ! alertSubject = "BlackRain : " + subject alertContent = content + "\n\nSent by BlackRain\n\n" #print "alert subject:" + alertSubject + "\nalertContent:\n" + content + "\n" status = mailalert.mailalert(sender, destination, smtpServer, alertSubject, alertContent, debugLevel) # Add a record to syslog a = "Sent alert e-mail, Subject=" + alertSubject + " to " + destination[ 0] syslog.syslog(a) except Exception, e: syslog.syslog("kojoney_tail.py : statusAlert() : " + ` e `)
def statusAlert(subject, content): smtpServer = 'smtp.btconnect.com' sender = '*****@*****.**' destination = ['*****@*****.**'] debugLevel = False try: now = time.time() nowLocal = time.localtime(now) # Notify ! alertSubject = "honeypot status : " + subject alertContent = content + "\n\nThis e-mail was automatically generated by the Gloworm Honeypot System on " + time.asctime( nowLocal) + "\n\n" status = mailalert.mailalert(sender, destination, smtpServer, alertSubject, alertContent, debugLevel) # uncomment the following line if you want to see the e-mail being sent print "notify : e-mail : subject=" + '"' + alertSubject + '"' # Add a record to syslog a = "Sent alert e-mail, Subject=" + alertSubject + " to " + destination[ 0] syslog.syslog("kojoney_twitter_drone.py :statusAert() : " + a) except Exception, e: syslog.syslog("kojoney_twitter_drone.py : statusAlert() : " + ` e `)
def alert(subject, ip, username, content): smtpServer = 'smtp.btconnect.com' sender = '*****@*****.**' destination = ['*****@*****.**'] debugLevel = False try: # Get DNS info dnsInfo = ipintellib.ip2name(ip) dnsName = dnsInfo['name'] # WHOIS information asInfo = ipintellib.ip2asn(ip) asNum = asInfo['as'] # AS123 asRegisteredCode = asInfo['registeredCode'] # Short-form e.g.ARCOR # GeoIP information geoIP = ipintellib.geo_ip(ip) countryCode = geoIP['countryCode'] city = geoIP['city'] longitude = geoIP['longitude'] # Calc approx. localtime latitude = geoIP['latitude'] info = "haxx0r IP : " + ip + "\nuser : "******"\nDNS : " + dnsName + "\n\nAS Number : " + asNum + "\nAS Name : " + asRegisteredCode + "\n\nGeoIP Country : " + countryCode + "\nGeoIP City : " + "\nGeoIP Longitude : " + "%.2f" % longitude + "\nGeoIP Latitude : " + "%.2f" % latitude # Haxx0r's client stack information p0fInfo = p0fcmd.getP0fInfo(ip, "0", "172.31.0.67", "22") if p0fInfo['result'] == True: p0fStr = "os=" + p0fInfo['genre'] + " hops=" + p0fInfo[ 'hops'] + " linktype=" + p0fInfo[ 'linktype'] + " up_secs=" + p0fInfo[ 'uptime'] + " tos=" + p0fInfo[ 'tos'] + " masq=" + p0fInfo[ 'masq'] + " fw=" + p0fInfo[ 'firewall'] + " NAT=" + p0fInfo[ 'nat'] + " realOS=" + p0fInfo['realos'] else: p0fStr = p0fInfo['errormsg'] # Notify ! alertSubject = "honeypot intrusion! : " + subject alertContent = info + "\n\np0f : " + p0fStr + "\n\n" + content + "\n\nSent by Kojoney Honeypot\n\n" print "alert():\nsubject:" + alertSubject + "\ncontent:\n" + alertContent + "\n" status = mailalert.mailalert(sender, destination, smtpServer, alertSubject, alertContent, debugLevel) # Add a record to syslog a = "Sent alert e-mail, Subject=" + alertSubject + " to " + destination[ 0] syslog.syslog(a) except Exception, e: syslog.syslog("kojoney_tail.py : alert() : " + ` e ` + " ip=" + ip)