now let' take our scanner and run it against the local network you can use linux or windows for this as the results will be the same in my casethe ip address of the local machine was on was so set my scanner to hit / if the output is too noisy when you run your scannersimply comment out all print statements except for the last one that tells you what hosts are responding ta our scanner is going to use third-party library called netaddrwhich will allow us to feed in subnet mask such as / and have our scanner handle it appropriately download the library from hereorif you installed the python setup tools package in you can simply execute the following from command prompteasy_install netaddr the netaddr module makes it very easy to work with subnets and addressing for exampleyou can run simple tests like the following using the ipnetwork objectip_address if ip_address in ipnetwork( / ")print true or you can create simple iterators if you want to send packets to an entire networkfor ip in ipnetwork( / ") socket socket( connect((ip )send mail packets this will greatly simplify your programming life when dealing with entire networks at timeand it is ideally suited for our host discovery tool after it' installedyou are ready to proceed :\python \python exe scanner py host up host up host up host up for quick scan like the one performedit only took few seconds to get the results back by crossreferencing these ip addresses with the dhcp table in my home routeri was able to verify that the results were accurate you can easily expand what you've learned in this to decode tcp and udp packetsand build additional tooling around it this scanner is also useful for the trojan framework we will begin building in this would allow deployed trojan to scan the local network looking for additional targets now that we have the basics down of how networks work on high and low levellet' explore very mature python library called scapy [ an input/output control (ioctlis means for userspace programs to communicate with kernel mode components have read here