31
7月
2020
13:55

创建连接到网络的计算机列表

31 7月 2020 13:55

在启用 DHCP 的大型网络中,有时会发生入侵 - 第三方连接。
他们需要被追踪。 拍摄网络照片很方便 - 之前和之后。
在本文中,我讨论了两种编译计算机列表(网络快照)的方法 - 使用 nmap 和 arp-scan。

arp 扫描

在我看来,列出 PC 的最佳方式是实用程序 arp-scan(http://www.nta-monitor.com/tools/arp-scan/ ),我就是这么用的。 优点——扫描速度快、方便的PC列表格式、MAC地址检测。

对标准存储库的搜索显示 arp-scan 实用程序可供安装:

apt-cache search arp-scan

输出:

arp-scan - arp scanning and fingerprinting tool

程序安装正常:

sudo apt-get install arp-scan

用法 - 显示文件 ~/scan1.txt 中的计算机列表:

sudo arp-scan --interface=enp2s0 --localnet > ~/scan1.txt

接下来,断开托管交换机的端口并重复扫描:

sudo arp-scan --interface=enp2s0 --localnet > ~/scan2.txt

比较两个文件

diff ~/scan1.txt ~/scan2.txt

地图

nmap 实用程序还可以扫描网络并编译 IP 地址列表:

sudo nmap -sP 192.168.0.0/24 | grep for | sed 's/Nmap scan report for //'

或这个选项:

sudo nmap -sP 192.168.0.0/24 | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])'

接下来怎么办?

计算出 IP 地址后,我会启动 arping 进行永久操作。

arping 192.168.0.77

我将其关闭 - 如果找到目标😇,则 arping 输出会中断。 我打开交换机端口

你可以去交换机端口对应的socket看看是哪个坏人连接的。 😈。
但最好首先使用以下命令检查来自 IP 地址的流量 须藤wireshark 😏。


资料来源:

  1. arp-scan 命令: losst.ru 上的文章
  2. 俄语 nmap 命令手册 https://nmap.org/man/ru/
  3. IP地址过滤器的正则表达式: stackoverflow.com
  4. SED 和文本处理 - habr.com 上的文章


相关出版物