W
W
wazebup2016-09-20 14:03:10
linux
wazebup, 2016-09-20 14:03:10

There is access to the computer via ssh with root rights. How to find all computers on the network?

Good afternoon. We set such a task - there is a computer, and there is root access to it - access via ssh. How to find all computers on the network it's on? Let's say it's behind NAT (or something else, but we connected to it via ssh). and there is no nmap on this computer. Interview task. I answered - nmap, but they told me that nmap is not on this computer, it needs to be done differently.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Sharihin, 2016-09-20
@wazebup

for i in {1..254}; do ping -c 1 -W 1 192.168.0.$i | grep 'from'; done

R
Redaicd, 2016-09-20
@Redaicd

Hosts may not respond to pings, Peter Ivanov Peter Ivanov correctly said that after ping you need to look at the arp table

T
Tremo, 2016-09-20
@tremo0880

1. ping one at a time :)
2. Make a small script that automates this task

S
silverjoe, 2016-09-20
@silverjoe

NMAP
https://habrahabr.ru/post/88064/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question