Linux посмотреть все устройства сети

How to find what other machines are connected to the local network

How much do you know about the LAN in question? I’m assuming you don’t know anything just plugged in the cable or connected to wifi.

  1. Try requesting an IP address with DHCP. Do you get one? Then you already know a few things: the gateway IP, the DHCP server IP, the subnet mask and maybe DNS servers.
  2. If you don’t get one there is either no DHCP server or the network is MAC filtered.
  3. Either way, start capturing packets with wireshark. If you are on wireless or connected to a hub it’s easy. If you are connected to a switch you can try MAC flooding to switch it back to «hub mode» but a smarter switch will just disable your port. If you want to try it anyway ettercap can do this for you. (Or macchanger and a shell script 🙂 )
  4. Looking at the packets you can find IP addresses, but most importantly, you can guess the network parameters. If you suspect MAC filtering change you MAC address to one of the observed ones after it leaves (sends nothing for a while).
  5. When you have a good idea about the network configuration (netmask, gateway, etc) use nmap to scan. Nmap can do a lot more than -sP in case some hosts don’t respond to ping (check out the documentation). It’s important that nmap only works if your network settings and routes are correct.
  6. You can possibly find even more hosts with nmap’s idle scan.

Some (most?) system administrators don’t like a few of the above methods so make sure it is allowed (for example it’s your network). Also note that your own firewall can prevent some of these methods (even getting an IP with DHCP) so check your rules first.

Here is how to do basic host discovery with nmap. As I said your network configuration should be correct when you try this. Let’s say you are 192.168.0.50 you are on a /24 subnet. Your MAC address is something that is allowed to connect, etc. I like to have wireshark running to see what I’m doing.

First I like to try the list scan, which only tries to resolve the PTR records in DNS for the specified IP addresses. It sends nothing to the hosts so there is no guarantee it is really connected or turned on but there is a good chance. This mode obviously needs a DNS server which is willing to talk to you.

nmap -vvv -sn -sL 192.168.1.0/16 

This may find nothing or it may tell you that every single IP is up.

Then I usually go for ARP scan. It sends ARP requests (you see them as «Who has ? Tell » in wireshark). This is pretty reliable since noone filters or fakes ARP. The main disadvantage is that it only works on your subnet.

nmap -vvv -sn -PR 192.168.1.0/24 

If you want to scan something behind routers or firewalls then use SYN and ACK scans. SYN starts a TCP connection and you either get an RST or a SYNACK in response. Either way the host is up. You might get ICMP communication prohibited or something like that if there is a firewall. Most of the time if a firewall filtered your packets you will get nothing. Some type of firewalls only filter the TCP SYN packets and let every other TCP packet through. This is why ACK scan is useful. You will get RST in response if the host is up. Since you don’t know what firewall is in place try both.

nmap -vvv -sn -PS 10.1.2.0/24 nmap -vvv -sn -PA 10.1.2.0/24 

Then of course you can use the ICMP-based scans with -PE -PP -PM.

Читайте также:  Vmware linux сеть настройка сети

An other interesting method is -PO with a non-existent protocol number. Often only TCP and UDP is considered on firewalls and noone tests what happens when you try some unknown protocol. You get an ICMP protocol unreachable if the host is up.

nmap -vvv -sn -PO160 10.1.2.0/24 

You can also tell nmap to skip host discovery (-Pn) and do a portscan on every host. This is very slow but you might find other hosts that the host discovery missed for some reason.

Источник

How to Find What Devices are Connected to Network in Linux

Wireless networks have always been a desirable target for wannabe hackers. Wireless networks are also more vulnerable to hacking than the wired ones.

Forget hacking, do you ever wonder that someone might be leeching off your hard paid wifi network? Maybe a neighbor who once connected to your network and now uses it as his/her own?

It would be nice to check what devices are on your network. This way you can also see if there are some unwanted devices on your network.

So you might end up thinking, “how do I find what devices are connected to my network”?

I’ll show you how to do that in this quick tutorial. Not only it’s a good idea from security point of view, it is also a good little exercise if you have interest in networking.

We will use both, command line and GUI, way for finding out what devices are connected to your local network in Linux. The process is very simple and easy to use even for beginners.

Before you see any of that, let me tell you that your router should also be able to show all the connected devices. Check your gateway ip address and then type it in a browser. This is usually the browser interface for your router. Enter the username and password and you can see all the details and devices connected to the router.

If you don’t remember the router password or you don’t want to go that way, here’s what else you could do.

A. Using Linux command to find devices on the network

Step 1: Install nmap

nmap is one of the most popular network scanning tool in Linux. Use the following command to install nmap in Ubuntu based Linux distributions:

You can easily install it in other Linux distributions as well. It should be in the official software repository.

Step 2: Get IP range of the network

Now we need to know the IP address range of the network. Use the ifconfig command to find the IP address in Linux. Look for wlan0 if you are using wifi or eth0 if you are using Ethernet.

Читайте также:  Arch linux install debian

[email protected]:~$ ifconfig
wlan0 Link encap:Ethernet HWaddr 70:f1:a1:c2:f2:e9
inet addr:192.168.1.91 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::73f1:a1ef:fec2:f2e8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2135051 errors:0 dropped:0 overruns:0 frame:0
TX packets:2013773 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1434994913 (1.4 GB) TX bytes:636207445 (636.2 MB)

The important things are highlighted in bold. As you see my IP is 192.168.1.91 and the subnet mask is 255.255.255.0 which means that the ip address range on my network varies from 192.168.1.0 to 192.168.1.255.

You may also use ip a command to know your IP address in Ubuntu and other Linux distributions.

At the same time, I’ll recommend you to read about basic Linux networking commands for more information.

Step 3: Scan to find devices connected to your network

It is advisable to use root privileges while scanning the network for more accurate information. Use the nmap command in the following way:

[email protected]:~$ sudo nmap -sn 192.168.1.0/24
Starting Nmap 5.21 ( http://nmap.org ) at 2012-09-01 21:59 CEST

Nmap scan report for neufbox (192.168.1.1)
Host is up (0.012s latency).
MAC Address: E0:A1:D5:72:5A:5C (Unknown)
Nmap scan report for takshak-bambi (192.168.1.91)
Host is up.
Nmap scan report for android-95b23f67te05e1c8 (192.168.1.93)
Host is up (0.36s latency).

As you can see that there are three devices connected to my network. The router itself, my laptop and my Galaxy S2.

If you are wondering about why I used 24 in the above command, you should know a little about CIDR notation. It basically means that the scanning will be from 192.168.1.0 to 192.168.1.255.

B. Using GUI tool to find devices connected to network

When I first wrote this article, there was no GUI tool for this task. Then I came across a new network monitoring tool being developed for elementary OS. I suggested including a periodic device scan feature in this tool and the developer readily agreed.

So, now we have a GUI tool that does this task. It’s called Nutty (last updated in 2019). Just install this app and run it. It will periodically scan for new devices on the network and will notify you if there is a new device.

Monitor network devices with Nutty

This application is only available for elementary OS, Ubuntu and hopefully, other Ubuntu based Linux distributions. You can find installation instructions on this detailed article on Nutty.

Oh, you can also log in to your router and see the devices connected to your devices. I let you figure the best way to find devices connected to your network.

Источник

Как посмотреть список устройств в сети?

Есть wi-fi к которому подключено несколько устройств, нужно унать ip-адрес конкретного устройства(ip cam) как это сделать с помощью ноутбука с linux подключенного к этой сети?

Есть wi-fi к которому подключено несколько устройств, нужно унать ip-адрес конкретного устройства(ip cam) как это сделать с помощью ноутбука с linux подключенного к этой сети?

Starting Nmap 6.40 ( http://nmap.org ) at 2016-03-25 14:44 MSK Failed to resolve «IP». WARNING: No targets were specified, so 0 hosts scanned. Nmap done: 0 IP addresses (0 hosts up) scanned in 0.04 seconds

Есть графический интерфейс для nmap если не можешь прочитать man nmap

Интерфейс нужно ставить или как его запустить?

Интерфейс нужно ставить или как его запустить?

в админке роутера посмотри, если он dhcp сервером работает

Читайте также:  Установка webmin linux mint

Бобер по широкой реке плывет, вдруг чует — коноплей потянуло

Подплывает к берегу, а там в кустах волк сидит, курит косяк.
Бобер: — Волк! Дай пару раз «дернуть»!
Волк: — Да тут уже почти ничего не осталось, а ты сейчас своими губищами как захапаешь! Давай лучше я «палик» сделаю . Только ты сразу не выдыхай, а нырни поглубже.
Волк дунул, бобр набрал дыма, нырнул поглубже, а тут у него «приход» начался. Он пронырнул под водой на другой берег в осоку, там вылез, лег на берег и выдохнул. А тут, как на грех, бегемот мимо проходил.
Бегемот: — Бобер! Я не понял, че за х. Я не курю, а ты куришь? Делиться надо!
Бобр: — Слышь, Бегемот, не ломай кайф, у меня нету, а на том берегу сидит Волк, плыв у него проси.
Бегемот залез в воду, нырнул, и вынырнул рядом с волком.
Волк увидел его и орет: — Бобер! Выдыхай!! Выдыхай.

Источник

Список сетевых интерфейсов Linux

В операционной системе Linux не только жесткие и SSD диски представлены файлами в специальной файловой системе, но и сетевые интерфейсы. Существует несколько способов посмотреть список сетевых интерфейсов Linux, но самый простой из них — это просто посмотреть содержимое папки в файловой системе.

В этой небольшой статье мы рассмотрим все основные способы выполнить эту задачу в терминале или графическом интерфейсе.

Список сетевых интерфейсов Linux

Сетевые интерфейсы проводного интернета Ethernet обычно имеют имя, начинающиеся с символов enp, например, enp3s0. Такое именование используется только если ваш дистрибутив использует systemd, иначе будет применена старая система именования, при которой имена начинаются с символов eth, например eth0. Беспроводные сетевые интерфейсы, обычно называются wlp или wlx при использовании systemd, например, wlp3s0. Без использования systemd имя беспроводного интерфейса будет начинаться с wlan, например wlan0. Все остальные интерфейсы обычно виртуальные. Один из самых основных виртуальных интерфейсов — lo. Это локальный интерфейс, который позволяет программам обращаться к этому компьютеру. А теперь рассмотрим несколько способов посмотреть их список.

1. Файловая система

Все файлы устройств сетевых интерфейсов находятся в папке /sys/class/net. Поэтому вы можете посмотреть её содержимое:

2. Утилита ifconfig

Утилита ifconfig выводит не только список сетевых интерфейсов, но и информацию о них, такую как состояние, IP адрес, MAC адрес и другие параметры. Для отображения всех интерфейсов достаточно выполнить программу без параметров:

3. Утилита ip

Программа ifconfig устарела и ей на смену пришла утилита ip. Она объединяет в себе функции нескольких программ, например ifconfig, route, brctl и других. Посмотреть список устройств с помощью ip можно выполнив команду:

Здесь информации намного меньше, показывается только состояние устройства, MTU и ещё несколько параметров. Можно вывести информацию в более компактном виде, использовав опцию -br:

В таком случае все данные отображаются в одну строчку, выводится состояние, MAC адрес и ещё несколько опций.

4. Утилита nmcli

Посмотреть всю нужную информацию можно и с помощью консольной утилиты управлением брандмауэром — nmcli:

Здесь выводится подключение NetworkManager, связанное с конкретным устройством, а также его состояние.

5. Утилита netstat

Программа netstat тоже умеет показывать сетевые интерфейсы и статистику по переданным данным если ей передать опцию -i:

6. Файл /proc/net/dev

В файле /proc/net/dev тоже содержится список всех сетевых интерфейсов, а также статистика их использования:

Выводы

Теперь вы знаете как посмотреть сетевые интерфейсы в Linux, как видите, это очень просто сделать. Если у вас остались вопросы, спрашивайте в комментариях!

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Источник

Оцените статью
Adblock
detector