sookyp / honeyd-python

Other
18 stars 7 forks source link

How to add a new service or port? #4

Open bbxc opened 6 years ago

bbxc commented 6 years ago

How to add a new service or port?

uc berkeley 4.3bsd 4.3BSD

but "netstat -alp " can not find listen port!

sookyp commented 6 years ago

Hi @bbxc ,

you can create new services for a specific device using the service tag. It requires 3 attributes: protocol, port, and execute. These services basically determine how the honeypot should respond to different types of network traffic.

Once you created the devices you need in your virtual network, you have to assign them an IP address. The bind tag serves this purpose, its ip attribute accepts strings formatted as an IPv4 address. Essentially, this tells the honeypot to behave according to the services mentioned above only, when the intercepted packets are addressed to one of the ip addresses listed in the bind tags. Of course, the devices have to be accessible from your defined entry point in the virtual network.

TL;DR:

In short, <service protocol="tcp" port="21" execute="closed"/> tells the honeypot to respond to intercepted TCP packets addressing port 21 in a way that would be expected from a machine running the operating system given in the personality tag having a closed port. For every other protocol-port combination not listed in the service tags, the default behavior defined by the action tag takes place. In order to interact with these machines in your virtual network, you have to assign them an IP address using bind tags.

As for netstat, all services are emulated so these won't show up on netstat output. The traffic is intercepted by the farpd daemon which executes ARP poisoning on the defined address range. Then the honeypot simply executes a live capture on the given network interface.

I hope this helps clear up any confusion.