Tag: Source Code

Scapy DHCP listener in Python

Scapy DHCP listener in Python

This script listens for DHCP Request and Discover packets on the LAN using scapy.

A little background on the DHCP protocol

Hosts issue a DHCP Discover packet to destination 255.255.255.255 to request an IP Address assignment from a DHCP server. DHCP Discover, Request, Offer, Ack and Inform packets are sent as broadcasts, all hosts on the LAN receive these packets. Because of the nature of the protocol, no special port mirroring or tapping is required on the host that runs this script.

This script is the foundation for creating a passive network discovery tool. We can collect and store the Mac Address, Hostname, and IP Address all hosts configured for DHCP IP address assignment.

Read More Read More

Scapy ARP listener in Python

Scapy ARP listener in Python

This script listens for ARP request packets using scapy to learn the IP and Mac Address of LAN hosts.

A little background on the ARP protocol

ARP is the protocol that hosts use to discover the mac address of another LAN host. The initiating host asks “Who Has <IP Address>”, this request is transmitted as a broadcast ethernet packet to destination 00:00:00:00:00:00. Since the ARP request is sent as a broadcast, all hosts on the LAN receive and process this packet. Because of the nature of the protocol, no special port mirroring or tapping is required on the host that runs this script.

The host that has <IP Address> will reply back directly to the requester so we will not see that ARP reply packet unless our machine sent the initial ARP request.

This script is the foundation for creating a passive network discovery tool. We can collect and store the MAC Address, IP Address pairs for all hosts we hear communicating on the network.

Read More Read More

How to compile php7 on ubuntu 14.04

How to compile php7 on ubuntu 14.04

[slb_exclude]I’ve been reading great things about PHP 7, specifically the PHP7 infographic created by Zend. So today I decided to create a ubuntu droplet and go to work compiling php7 from source. I ran into a few problems along the way but eventually was successfully. Here is a quick howto that will help you avoid some the same pitfalls I experienced.
[/slb_exclude]

After installing a fresh copy of Ubuntu 14.04 lets install some dependencies and software we need to compile php from source.

A WORD OF CAUTION! Do not attempt to compile or install php7 on a production machine, you have been warned. While already published, this article is a work in progress and I’m still writing and editing it.

First Step, Install gcc compiler, php5 dependencies, and some required libraries.

Read More Read More