{"id":9786,"date":"2020-06-06T23:09:39","date_gmt":"2020-06-07T06:09:39","guid":{"rendered":"https:\/\/www.apolonio.com\/blog\/?p=9786"},"modified":"2020-06-06T23:09:39","modified_gmt":"2020-06-07T06:09:39","slug":"scanning-network","status":"publish","type":"post","link":"https:\/\/www.apolonio.com\/blog\/?p=9786","title":{"rendered":"Scanning Network"},"content":{"rendered":"\n<p>Built a VM with multiple interfaces to do Layer 2 scanning.<\/p>\n\n\n\n<p>Also found a python library to help me translate dhcpd.leases files into a report file.<\/p>\n\n\n\n<p>Here is a quick install procedures<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo yum install python3-devel\npip3 install freezegun --user\npip3 install isc_dhcp_leases --user<\/pre>\n\n\n\n<p>Here is a sample script<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#!\/bin\/python3\nfrom isc_dhcp_leases import Lease, IscDhcpLeases\nimport argparse\nparser = argparse.ArgumentParser()\nparser.add_argument(\"filename\")\nargs = parser.parse_args()\nleases = IscDhcpLeases(args.filename)\nresult = leases.get() # Returns the leases as a list of Lease objects\nresult = leases.get_current()\nfor hostentry in result:\nprint(hostentry.ip,hostentry.ethernet.upper(),hostentry.start,hostentry.hostname)<\/pre>\n\n\n\n<p>Here is the usage<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">reportdhcp.py \/var\/lib\/dhcpd\/dhcpd.leases<\/pre>\n\n\n\n<p>Will work on a clean reporting web page.<\/p>\n\n\n\n<p>Weight is weird, I need to settle on a morning weight.<\/p>\n\n\n\n<p>Weight: 313.4<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Built a VM with multiple interfaces to do Layer 2 scanning. Also found a python library to help me translate dhcpd.leases files into a report file. Here is a quick install procedures sudo yum install python3-devel pip3 install freezegun &#8211;user &hellip; <a href=\"https:\/\/www.apolonio.com\/blog\/?p=9786\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,11,3,9],"tags":[],"class_list":["post-9786","post","type-post","status-publish","format-standard","hentry","category-new-toys","category-technical","category-training","category-weighin"],"_links":{"self":[{"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9786"}],"version-history":[{"count":1,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9786\/revisions"}],"predecessor-version":[{"id":9787,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9786\/revisions\/9787"}],"wp:attachment":[{"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.apolonio.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}