> For the complete documentation index, see [llms.txt](https://lswsec.gitbook.io/lswsec-offensive/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lswsec.gitbook.io/lswsec-offensive/pivoting/locating-other-machines.md).

# Locating other machines

* check network files like /etc/hosts or resolv.conf
* in linux you can run nmcli dev show
* use bach one liners to look for other hosts
  * `for i in {1..255}; do (ping -c 1 192.168.1.${i} | grep "bytes from" &); done`
* `A bash one liner for ports`
  * `for i in {1..65535}; do (echo > /dev/tcp/192.168.1.1/$i) >/dev/null 2>&1 && echo $i is open; done`
*
