Skip to content

Instantly share code, notes, and snippets.

@johnnykv
Created September 10, 2014 19:48
Show Gist options
  • Save johnnykv/32a251c563d8df21c909 to your computer and use it in GitHub Desktop.
Save johnnykv/32a251c563d8df21c909 to your computer and use it in GitHub Desktop.
import socket
import logging
from beeswarm.drones.honeypot.capabilities.handlerbase import HandlerBase
logger = logging.getLogger(__name__)
class SIP(HandlerBase):
def __init__(self, sessions, options, workdir):
super((SIP), self).__init__(sessions, options, workdir)
# instance variables from baseclass:
# self.options - protocol options given by the beeswarm server
# self.workdir - work directory for the honeypot
# not that instance variables are shared among all connected sessions
def handle_session(self, gsocket, address):
# the session object used for logging
session = self.create_session(address, gsocket)
while True :
msg = 'this is some not very SIPPISH data'
session.transcript_outgoing(reply)
reply = gsocket.recv(512)
if len(reply )== 0:
break
else:
session.transcript_incoming(reply)
session.connected = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment