Skip to content

Commit

Permalink
Put project on GitHub
Browse files Browse the repository at this point in the history
Publishing all the files to github First commit.
  • Loading branch information
Slober3 committed Jul 2, 2017
1 parent f1f9d61 commit e0d0203
Show file tree
Hide file tree
Showing 20 changed files with 1,145 additions and 0 deletions.
98 changes: 98 additions & 0 deletions PotHead.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
__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,logHandling
# 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')
parser.add_argument('-pp',action='store', metavar='<port list>',nargs='+', help='Multiple ports')
parser.add_argument('-site',action='store', metavar='<site>',default='http://7ol.eu/write.php', help='Server site')

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
multiplePorts = args.pp
site = args.site

#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)

if args.pp is not None:
prPort = 'Port: {}\n'.format(multiplePorts)
else:
prPort = 'Port: {}\n'.format(bind_port)

prIP = 'IP: {}\n'.format(bind_ip)
prSite ='Site: {}\n'.format(site)
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,prSite)
#End Phase 1

'''
Phase 2 Begin:
Initiate Socketserver
'''
#Check if multiple ports are used or a single port
if args.pp is not None:
print('Multiple ports used')
runSocketServ(socket.AF_INET, socket.SOCK_STREAM, multiplePorts, socket.gethostname(), 5,4096,motd,1,site)
else:
print('Single port used')
runSocketServ(socket.AF_INET, socket.SOCK_STREAM, bind_port, socket.gethostname(), 5,4096,motd,0,site)
#End Phase 2 runSocketServ(socket_family, socket_type, socket_port, socket_host, socket_max):


38 changes: 38 additions & 0 deletions Website+Backend/PotHeadLog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
time: 2017-07-01 18:46:17.650249 ip: ('192.168.0.135', 35677) port: 23
time: 2017-07-01 18:46:38.244865 ip: ('192.168.0.135', 35693) port: 23
time: 2017-07-01 18:46:53.501804 ip: ('173.208.249.42', 63790) port: 22
time: 2017-07-01 18:46:56.967305 ip: ('121.143.236.90', 35403) port: 22
time: 2017-07-01 18:47:11.433585 ip: ('63.141.250.2', 61727) port: 22
time: 2017-07-01 18:52:02.943162 ip: ('173.208.249.42', 62023) port: 22
time: 2017-07-01 18:53:26.419772 ip: ('193.151.197.110', 28681) port: 22
time: 2017-07-01 18:55:35.663729 ip: ('192.168.0.135', 35936) port: 23
time: 2017-07-01 19:05:11.084300 ip: ('192.168.0.135', 36301) port: 23
time: 2017-07-01 19:06:15.934575 ip: ('192.168.0.135', 36342) port: 23
time: 2017-07-01 19:09:42.740360 ip: ('95.233.171.100', 50900) port: 23
time: 2017-07-01 19:09:50.469810 ip: ('192.168.0.135', 36456) port: 23
time: 2017-07-01 19:12:37.316516 ip: ('103.208.144.28', 3287) port: 23
time: 2017-07-01 19:17:53.540736 ip: ('192.168.0.135', 36747) port: 23
time: 2017-07-01 19:18:59.301062 ip: ('192.168.0.135', 36775) port: 23
time: 2017-07-01 19:20:59.746372 ip: ('5.188.10.141', 42164) port: 22
time: 2017-07-01 19:21:42.705332 ip: ('175.208.231.158', 56839) port: 23
time: 2017-07-01 19:22:31.106483 ip: ('5.188.10.141', 35226) port: 22
time: 2017-07-01 19:26:30.885457 ip: ('5.188.10.141', 52566) port: 22
time: 2017-07-01 19:31:54.937808 ip: ('192.168.0.135', 37169) port: 23
time: 2017-07-01 19:31:57.724162 ip: ('173.208.249.42', 62399) port: 22
time: 2017-07-01 19:32:34.517840 ip: ('173.208.249.42', 63865) port: 22
time: 2017-07-01 19:32:40.427592 ip: ('192.168.0.135', 37207) port: 23
time: 2017-07-01 19:34:30.105529 ip: ('5.188.10.141', 38462) port: 22
time: 2017-07-01 19:35:27.813894 ip: ('173.208.221.58', 63079) port: 22
time: 2017-07-01 19:36:00.797086 ip: ('71.84.172.93', 56963) port: 23
time: 2017-07-01 19:42:13.740476 ip: ('192.168.0.135', 37538) port: 23
time: 2017-07-01 19:45:31.161539 ip: ('63.141.250.2', 63169) port: 22
time: 2017-07-01 19:47:33.079035 ip: ('173.208.249.42', 63222) port: 22
time: 2017-07-01 19:50:14.529438 ip: ('192.168.0.135', 37763) port: 23
time: 2017-07-01 19:52:42.960098 ip: ('192.168.0.135', 37822) port: 23
time: 2017-07-01 19:52:47.651193 ip: ('192.168.0.135', 37826) port: 23
time: 2017-07-01 19:53:04.680855 ip: ('5.2.198.94', 58017) port: 23
time: 2017-07-01 19:57:05.834542 ip: ('63.141.250.2', 62519) port: 22
time: 2017-07-01 19:58:44.607096 ip: ('36.149.0.31', 53825) port: 23
time: 2017-07-01 19:58:45.775687 ip: ('173.208.249.42', 62841) port: 22
time: 2017-07-01 19:59:54.386965 ip: ('58.84.179.226', 2878) port: 23
time: 2017-07-01 20:01:29.666515 ip: ('63.141.250.2', 63062) port: 22
9 changes: 9 additions & 0 deletions Website+Backend/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?//comment out this line if you do not need an .txt logfile
$logfile = "PotHeadLog.txt";

//comment out this line if you do not need an MySQL log
$servername = "localhost";
$username = "USERNAME";
$password = "PASSWORD";
$dbname = "DBNAME";
?>
5 changes: 5 additions & 0 deletions Website+Backend/css/bootstrap-theme.min.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Website+Backend/css/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Website+Backend/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Empty CSS file for your own CSS
Binary file not shown.
Loading

0 comments on commit e0d0203

Please sign in to comment.