Bangalore Institute of Technology K. R. Road, V. V. Pura, Bangalore - 560004
Bangalore Institute of Technology K. R. Road, V. V. Pura, Bangalore - 560004
Bangalore Institute of Technology K. R. Road, V. V. Pura, Bangalore - 560004
ASSIGNMENT-3
Title: Setup a honey pot and monitor the honeypot on network using tcpdump
Group Members:
There is an old idiom that goes “more flies are caught with a drop of honey than with a
bowl of vinegar” and this suits all this topic perfectly, since honeypots are precisely about
attracting the most requests to analyze their intentions.
A honey pot is a computer system on the Internet that is expressly set up to attract and
"trap" people who attempt to find access into other people's computer systems.
They can provide early warning about new attack and utilization trends and they allow in-
depth examination of unwanted users during and after use of a honeypot.
Many people have their own definition of what a honeypot is, or what it should
accomplish. Some feel it’s a solution to deceive attackers. Others feel it’s a technology
used to detect attacks.
While other feel honeypots are real computers designed to be hacked into and learned
from.
BLOCK DIAGRAM:
IMPLEMENTATION:
We develop and test our honey pot using two Linux systems. The client system (Ubuntu
run our Python3 honeypot.py script as root. Note that two systems aren't actually
required, and the honey pot could be run on almost any machine where Python is
installed.
Nmap is a free and open source (license) utility for network discovery and security
auditing". It's a great tool for probing networks and discovering information (i.e., open
your usage of the provided example may work differently ( or not at all) on a particular
system.
The python socket interface is modeled after the Unix socket API. When working with
Python sockets, you may want to refer to Linux man pages for various definitions:
$ man socket
DESCRIPTION
Socket () creates an endpoint for communication and returns a file descriptor that refers
to that endpoint. The file descriptor returned by a successful call will be the lowest-
CLIENT SHELL 1
$ nmap 192.168.3.200 -p 21
...
<packet dump>
...
You should see packets exchanged in shell 2 when running nmap in shell 1. It's a good
idea at this point to play around with different nmap options (e.g., -sV: determine service)
FLOWCHART;
PROGRAM:
import sys
import argparse
VERSION = '0.1a'
def send_email(src_address):
""" Todo: send an email if we're scanned / probed on this port """
Pass
def honeypot(address,port=23):
try:
ski=socket(AF_INET,SOCK_STREAM)
ski.bind((address, port))
ski.listen()
conn,addr = ski.accept()
conn.sendall(welcome)
while True:
data=conn.recv(1024)
if data == b'\r\n':
ski.close()
sys.exit()
except:
ski.close()
sys.exit()
if __name__ == '__main__':
required=True)
args = parser.parse_args()
honeypot(args.address)
RESULT:
You should see the honey pot report the activity as shown below:
# ./honeypot.py -a 192.168.3.200
You can also try your honey pot using the telnet client. It should close the port after the
user hits the enter key (return).
$ telnet 192.168.3.200
Trying 192.168.3.200...
Connected to 192.168.3.200.
server login:
Note that it can take up to a minute or two for ports to close after running these tests, so
subsequent runs of honeypot.py may return immediately until the port closes / time outs.
APPLICATIONS:
Beyond collecting data about scans and targets, a simple honeypot can also be used to
monitor outbound traffic. For example, a network administrator may collect data about
typical office network traffic (with appropriate permissions). This way, they can set a
If there's ever a spike in unusual traffic, then the administrator can jump in and see what's
going on. It might be the start of a computer virus or worm, or maybe something else.
ADVANTAGES:
Designed to capture anything thrown at them, including tools or tactics never used
before.
DISADVANTAGES:
Can only track and capture activity that directly interacts with them.
consuming.
Honey pots are an extremely effective tool for observing hackers movements as well as
Although the down side to using Honeypots are amount of resource used, this is usually
countered by implementing a central analysis module, but is still a security risk if that
Keep in mind that a honey pot is basically a fake network service, and they're easy to
write. The other side of this story is to remind yourself to not blindly trust network
services since providers and hackers can replace or modify them with a compromised
Virtual Lab
Experiment: Breaking the Shift
Cipher
OBJECTIVE:
To understand that secure encryption is not possible with small key space. This is more popularly
QUIZ
Encrypt the following plain text using key k = 7.
Given a plain text and its corresponding cipher text, find out the key used for the
encryption of the plain text
Plain Text : abcdefghijklmnopqrstuvwxyz
Cipher Text : tuvwxyzabcdefghijklmnopqrs