Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = '@Slober3'
- __version__ = '0.1'
- '''
- Hello Welcome to this simple low interactinghoneypot
- This honepot will only log
- And will not interact with the hacker at this point in time!
- '''
- import sys
- sys.path.append('../')
- import argparse
- import socket
- import _thread
- import time
- from modules.PotHeadMain import CrlogDir,prPhaseOne,prStandard,runSocketServ
- # parse the command line arguments to set the variables for the server
- parser = argparse.ArgumentParser(description="Command line arguments")
- parser.add_argument('-i',action='store', metavar='<ip address>', default='0.0.0.0', help='The IP address to listen on default 0.0.0.0')
- parser.add_argument('-p',action='store', metavar='<port>', default='9999', help='The port to listen on default 9999')
- parser.add_argument('-s',action='store', metavar='<PotHeadServer>', default='PotHead', help='A Name that\'ll show up as the VNC server name')
- parser.add_argument('-logDir',action='store', metavar='<logDir>', default='logs', help='log Directory')
- parser.add_argument('-motd',action='store', metavar='<motd>', default='Welcome to HMLK 612.45', help='MOTD used on this server')
- args = parser.parse_args()
- # set the IP address, Port, ServerName variables
- bind_ip = args.i
- bind_port = int(args.p)
- srvname = args.s
- motd = args.motd
- logDirName = args.logDir
- #set Variables for Print messages
- banner = ('''
- *********************************************************************************************
- \tPotHead - A Simple LowInteraction Thing - Version: {}
- *********************************************************************************************
- '''.format(__version__))
- prInitPhead = 'Initializing Pothead service...\n'
- prLogCr = 'Log directory created...\n'
- prLogCrE = 'Log directory found...\n'
- prPhOne = 'Phase 1 completed...\n'
- prSrvName = 'Server name: {}\n'.format(srvname)
- prIP = 'IP: {}\n'.format(bind_ip)
- prPort = 'Port: {}\n'.format(bind_port)
- motd += '\r\n'
- '''
- Phase 1 Begin:
- Print basic server information ip, port, servname
- Create log directory if not available
- '''
- print (banner)
- print(prInitPhead)
- # Check and Create log directory if not exist
- # the function ChcklogDir will only check
- # and WILL NOT create a log directory if not exists
- if CrlogDir(logDirName) == 0:
- #prStandard is a basic Print function
- prStandard(prLogCr)
- else:
- prStandard(prLogCrE)
- #Prints Basic information
- prPhaseOne(prSrvName,prIP,prPort,prPhOne)
- #End Phase 1
- '''
- Phase 2 Begin:
- Initiate Socketserver
- '''
- #End Phase 2 runSocketServ(socket_family, socket_type, socket_port, socket_host, socket_max):
- runSocketServ(socket.AF_INET, socket.SOCK_STREAM, bind_port, socket.gethostname(), 5,4096,motd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement