{"id":1151,"date":"2010-01-20T00:15:13","date_gmt":"2010-01-19T18:45:13","guid":{"rendered":"https:\/\/www.suramya.com\/blog\/?p=1151"},"modified":"2022-06-16T15:17:22","modified_gmt":"2022-06-16T09:47:22","slug":"getting-a-list-of-all-machines-connected-to-a-lan-with-additional-details","status":"publish","type":"post","link":"https:\/\/www.suramya.com\/blog\/2010\/01\/getting-a-list-of-all-machines-connected-to-a-lan-with-additional-details\/","title":{"rendered":"List all machines connected to a LAN with additional details on each"},"content":{"rendered":"<p>If you ever had to figure out how many systems are connected to a network and what IP&#8217;s they have then you will find this tip useful. It is also useful to identify any rouge machines on your network if you know how many systems are supposed to be there on that network. Like in case of my home network, where I know the exact no of machines.<\/p>\n<p>There are multiple software out that, that allow you to do this. Some are free, some are very expensive. In my opinion the best one is nmap. It is free, fast and can be scripted. <\/p>\n<p>To find all machines on my LAN (IP Range: 192.168.2.x) I just have to issue the following command:<\/p>\n<p><i>nmap -sP 192.168.2.0\/24<\/i><\/p>\n<p>This gives an output like the following when I run it as a normal user:<\/p>\n<blockquote><p>suramya@Wyrm:~$ nmap -sP 192.168.2.0\/24<\/p>\n<p>Starting Nmap 5.00 ( http:\/\/nmap.org ) at 2010-01-20 00:01 IST<br \/>\nHost 192.168.2.1 is up (0.0018s latency).<br \/>\nHost 192.168.2.5 is up (0.00018s latency).<br \/>\nHost 192.168.2.100 is up (0.00018s latency).<br \/>\nNmap done: 256 IP addresses (3 hosts up) scanned in 2.93 seconds\n<\/p><\/blockquote>\n<p>When I run the same command as root, it gives me additional information that looks like:<\/p>\n<blockquote><p>Wyrm:~# nmap -sP 192.168.2.0\/24<br \/>\nStarting Nmap 5.00 ( http:\/\/nmap.org ) at 2010-01-19 23:50 IST<br \/>\nHost 192.168.2.1 is up (0.0015s latency).<br \/>\nMAC Address: 00:XX:XX:XX:XX:XX (Cisco-Linksys)<br \/>\nHost 192.168.2.5 is up.<br \/>\nHost 192.168.2.100 is up (0.011s latency).<br \/>\nMAC Address: 00:XX:XX:XX:XX:XX (Intel)<br \/>\nNmap done: 256 IP addresses (3 hosts up) scanned in 3.00 seconds\n<\/p><\/blockquote>\n<p>In this case, as you can see nmap also gives me the MAC address of the machine. 192.168.2.5 is the machine I ran the scan from so I didn&#8217;t get any information on that one.<\/p>\n<p>If you want additional details on a system you can issue the following command to get the system to try and identify the OS and services running in detail.<\/p>\n<p><em>nmap -A 192.168.2.5<\/em><\/p>\n<p>It gives an output that looks something like:<\/p>\n<blockquote><p>Wyrm:~# nmap -A 192.168.2.5<br \/>\nStarting Nmap 5.00 ( http:\/\/nmap.org ) at 2010-01-19 23:52 IST<br \/>\nInteresting ports on 192.168.2.5:<br \/>\nNot shown: 995 closed ports<br \/>\nPORT    STATE SERVICE     VERSION<br \/>\n22\/tcp  open  ssh         OpenSSH 5.1p1 Debian 8 (protocol 2.0)<br \/>\n|  ssh-hostkey: 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx (DSA)<br \/>\n|_ 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx (RSA)<br \/>\n80\/tcp  open  http        Apache httpd 2.2.14 ((Debian))<br \/>\n|_ html-title: Index of \/<br \/>\n139\/tcp open  netbios-ssn Samba smbd 3.X (workgroup: WORKGROUP)<br \/>\n445\/tcp open  netbios-ssn Samba smbd 3.X (workgroup: WORKGROUP)<br \/>\n631\/tcp open  ipp         CUPS 1.4<br \/>\nDevice type: general purpose<br \/>\nRunning: Linux 2.6.X<br \/>\nOS details: Linux 2.6.17 &#8211; 2.6.28<br \/>\nNetwork Distance: 0 hops<br \/>\nService Info: OS: Linux                                                   <\/p>\n<p>Host script results:<br \/>\n<i>additional information on the server<\/i>\n<\/p><\/blockquote>\n<p>Hope you also find this useful. <\/p>\n<p>&#8211; Suramya<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you ever had to figure out how many systems are connected to a network and what IP&#8217;s they have then you will find this tip useful. It is also useful to identify any rouge machines on your network if you know how many systems are supposed to be there on that network. Like in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[24,20,2],"tags":[],"class_list":["post-1151","post","type-post","status-publish","format-standard","hentry","category-knowledgebase","category-security-toolsapps","category-techie-stuff"],"_links":{"self":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/1151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/comments?post=1151"}],"version-history":[{"count":6,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/1151\/revisions"}],"predecessor-version":[{"id":5003,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/1151\/revisions\/5003"}],"wp:attachment":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/media?parent=1151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/categories?post=1151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/tags?post=1151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}