--
You received this message because you are subscribed to the Google Groups "Modern Honey Network" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modern-honey-net...@googlegroups.com.
To post to this group, send email to modern-hon...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modern-honey-network/69185311-81df-4ca6-b766-a5f3710869b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#!/opt/hpfeeds/env/bin/python
import sysimport logginglogging.basicConfig(level=logging.WARNING)import hpfeedsimport datetimeimport jsonoutstream = sys.stdoutoutstream = open( "/var/log/attacks.log", "a", 0 )
HOST = 'localhost'PORT = 10000CHANNELS = ['dionaea.connections', 'kippo.sessions', ]IDENT = 'mnemosyne'SECRET = 'mysecret'
def main():
hpc = hpfeeds.new(HOST, PORT, IDENT, SECRET) print >>sys.stderr, 'connected to', hpc.brokername def on_message(identifier, channel, payload): if channel == 'dionaea.connections': try: dt = datetime.datetime.now() dt2 = dt.strftime('%b %d %H:%M:%S') payload = str(payload).strip() payload = json.loads(payload) print >>outstream, "%s %s MHN: New attack from SRC=%s port %s (generated by dionaea) \n"%(dt2, payload['local_host'], payload['remote_host'], payload['local_port']) except Exception, e: print >> sys.stderr, "Error", e
elif channel == 'kippo.sessions': try: dt = datetime.datetime.now() dt2 = dt.strftime('%b %d %H:%M:%S') payload = str(payload).strip() payload = json.loads(payload) print >>outstream, "%s %s MHN: New attack from SRC=%s port %s (generated by kippo) \n"%(dt2, payload['hostIP'], payload['peerIP'], payload['hostPort']) except Exception, e: print >> sys.stderr, "Error", e
def on_error(payload): print >>sys.stderr, ' -> errormessage from server: {0}'.format(payload) hpc.stop() outstream.close()
hpc.subscribe(CHANNELS) hpc.run(on_message, on_error) hpc.close() outstream.close() return 0
if __name__ == '__main__': try: sys.exit(main()) except KeyboardInterrupt: outstream.close() sys.exit(0)
--
You received this message because you are subscribed to the Google Groups "Modern Honey Network" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modern-honey-net...@googlegroups.com.
To post to this group, send email to modern-hon...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modern-honey-network/702753cb-96eb-4975-a540-b1fda34e16fa%40googlegroups.com.
Dear all,
<decoder name="mhn"> <program_name>MHN</program_name> <!-- <prematch>^MHN: New attack from </prematch> <regex offset="after_prematch">SRC=(\S+) </regex> <order>srcip</order>--> <regex>from SRC=(\d+.\d+.\d+.\d+)</regex> <order>srcip</order></decoder> <!-- Rules for and from MHN server --> <rule id="100010" level="3"> <decoded_as>mhn</decoded_as> <description>This IP has been banned for some time on all servers</description><!-- servers defined in ossec.conf for active responses --> </rule> <rule id="100011" level="3" frequency="3" timeframe="3600" ignore="3600"> <if_matched_sid>100010</if_matched_sid> <description>This IP has been banned for some time on the Honeypot...</description> </rule><!-- This is the active response for agent, but not the Honeypot itself -->
<active-response> <command>firewall-drop</command> <location>defined-agent</location> <agent_id>001</agent_id> <rules_id>100010</rules_id> <timeout>3600</timeout><!-- Drop during 1 hour --> <repeated_offenders>1440,10080</repeated_offenders><!-- if same IP then drop for 1 day, and again then drop for one week ! --> </active-response> <active-response> <command>firewall-drop</command> <location>defined-agent</location> <agent_id>002</agent_id> <rules_id>100010</rules_id> <timeout>3600</timeout> <repeated_offenders>1440,10080</repeated_offenders> </active-response>
<!-- this is the active response for the honeypot itself. We want it to answer attacks more than other agents --> <active-response> <command>firewall-drop</command> <location>defined-agent</location> <agent_id>011</agent_id> <rules_id>100011</rules_id> <timeout>3600</timeout> <repeated_offenders>1440,10080</repeated_offenders> </active-response><agent_config name="MHNSERVER"><!-- the name of the agent on the MHN server --> <localfile> <log_format>syslog</log_format> <location>/var/log/attacks.log</location><!-- The log file on the MHN server --> </localfile></agent_config>--
You received this message because you are subscribed to the Google Groups "Modern Honey Network" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modern-honey-net...@googlegroups.com.
To post to this group, send email to modern-hon...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modern-honey-network/5728f42a-637c-48b4-b464-f60ea5acbe84%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Modern Honey Network" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modern-honey-net...@googlegroups.com.
To post to this group, send email to modern-hon...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modern-honey-network/e9319926-198a-4c3c-b5f2-2682dead9ece%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modern-honey-network/e9319926-198a-4c3c-b5f2-2682dead9ece%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "Modern Honey Network" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modern-honey-net...@googlegroups.com.
To post to this group, send email to modern-hon...@googlegroups.com.
$ sudo ./mhn_to_stdout.py
connected to @hp2
->errormessage from server: authfail.
--
You received this message because you are subscribed to the Google Groups "Modern Honey Network" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modern-honey-net...@googlegroups.com.
To post to this group, send email to modern-hon...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modern-honey-network/d140e256-0b6a-476c-9366-8a755ac64914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to modern-honey-network+unsub...@googlegroups.com.
To post to this group, send email to modern-honey-network@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modern-honey-network/d140e256-0b6a-476c-9366-8a755ac64914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.