Advertisement
Guest User

Slober Pothead

a guest
Jun 27th, 2017
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.69 KB | None | 0 0
  1. __author__ = '@Slober3'
  2. __version__ = '0.1'
  3.  
  4. '''
  5. Hello Welcome to this simple low interactinghoneypot
  6. This honepot will only log
  7. And will not interact with the hacker at this point in time!
  8. '''
  9.  
  10. import sys
  11. sys.path.append('../')
  12. import argparse
  13. import socket
  14. import _thread
  15. import time
  16.  
  17.  
  18. from modules.PotHeadMain import CrlogDir,prPhaseOne,prStandard,runSocketServ
  19. # parse the command line arguments to set the variables for the server
  20. parser = argparse.ArgumentParser(description="Command line arguments")
  21. 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')
  22. parser.add_argument('-p',action='store', metavar='<port>', default='9999', help='The port to listen on default 9999')
  23. parser.add_argument('-s',action='store', metavar='<PotHeadServer>', default='PotHead', help='A Name that\'ll show up as the VNC server name')
  24. parser.add_argument('-logDir',action='store', metavar='<logDir>', default='logs', help='log Directory')
  25. parser.add_argument('-motd',action='store', metavar='<motd>', default='Welcome to HMLK 612.45', help='MOTD used on this server')
  26.  
  27. args = parser.parse_args()
  28.  
  29. # set the IP address, Port, ServerName variables
  30. bind_ip = args.i
  31. bind_port = int(args.p)
  32. srvname = args.s
  33. motd = args.motd
  34. logDirName = args.logDir
  35.  
  36. #set Variables for Print messages
  37. banner = ('''
  38. *********************************************************************************************
  39. \tPotHead - A Simple LowInteraction Thing - Version: {}
  40. *********************************************************************************************
  41. '''.format(__version__))
  42.  
  43.  
  44. prInitPhead = 'Initializing Pothead service...\n'
  45. prLogCr = 'Log directory created...\n'
  46. prLogCrE = 'Log directory found...\n'
  47. prPhOne = 'Phase 1 completed...\n'
  48. prSrvName = 'Server name: {}\n'.format(srvname)
  49. prIP = 'IP: {}\n'.format(bind_ip)
  50. prPort = 'Port: {}\n'.format(bind_port)
  51. motd += '\r\n'
  52.  
  53. '''
  54. Phase 1 Begin:
  55. Print basic server information ip, port, servname
  56. Create log directory if not available
  57. '''
  58. print (banner)
  59. print(prInitPhead)
  60.  
  61. # Check and Create log directory if not exist
  62. # the function ChcklogDir will only check
  63. # and WILL NOT create a log directory if not exists
  64.  
  65. if CrlogDir(logDirName) == 0:
  66.     #prStandard is a basic Print function
  67.     prStandard(prLogCr)
  68. else:
  69.     prStandard(prLogCrE)
  70.  
  71. #Prints Basic information
  72. prPhaseOne(prSrvName,prIP,prPort,prPhOne)
  73. #End Phase 1
  74.  
  75. '''
  76. Phase 2 Begin:
  77. Initiate Socketserver
  78. '''
  79. #End Phase 2 runSocketServ(socket_family, socket_type, socket_port, socket_host, socket_max):
  80. runSocketServ(socket.AF_INET, socket.SOCK_STREAM,  bind_port, socket.gethostname(), 5,4096,motd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement