nmap常用命令及参数说明

2023-12-07 0 819

nmap是一个网络探测和安全扫描程序,系统管理者和个人可以使用这个软件扫描大型的网络,获取被扫描主机正在运行以及提供什么服务等信息。 nmap支持很多扫描技术,例如:UDP、TCP connect()、TCP SYN(半开扫描)、ftp代理(bounce攻击)、反向标志、ICMP、FIN、ACK扫描、圣诞树(Xmas Tree)、SYN扫描和null扫描。从扫描类型一节可以得到细节。nmap还提供了一些高级的特征,例如:通过TCP/IP协议栈特征探测操作系统类型,秘密扫描,动态延时和重传计算,并行扫描,通过并行ping扫描探测关闭的主机,诱饵扫描,避开端口过滤检测,直接RPC扫描(无须端口影射),碎片扫描,以及灵活的目标和端口设定。本文详细介绍了NMap的详细使用选项,并给出了几个实用实例,nmap是入侵和网络安全检测的必备工具。 nmap BT5(BackTrack–Information Gathering–Network Analysis–Network Scanners-nmap) -sP 渗透内网之后判断当前网络那些主机在线 nmap -sP 192.168.1/255 -vv 现实详细的扫描过程 -sS 使用SYN半开式扫描,这种扫描方式使得扫描结果更加正确(又称半开放,或 隐身扫描) nmap -vv -sS IP -O 大写O代表OS 判断主机操作系统 nmap -O IP 延时策略 -T(0-5) 默认为3 0 即Paranoid模式。为了避开IDS的检测使扫描速度极慢,nmap串所有的扫描, 每隔至少5分钟发送一个包 1 即Sneaky模式。也差不多,只是数据包的发送间隔是15秒 2 即Polite模式。不增加太大的网络负载,串行每个探测,并使每个探测间隔 0.4秒 3 即Normal模式。nmap的默认选项,在不使网络过载或者主机/端口丢失的情况 下尽可能快速地扫描 4 即Aggressive模式。设置5分钟的超时限制,对每台主机的扫描时间不超过5分 钟,并且对每次探测回应的等待时间不超过1.5秒。 5 即lnsane模式。只适合快速的网络或者不在意丢失默些信息,每台主机的超时 限制为75秒,对每次探测只等待0.3秒。 nmap -sS -T1 IP -sV 探测端口的服务类型/具体版本等信息 nmap -vv -sV IP -p 端口号 对某个端口的服务版本进行详细探测 有助于升入的针对性攻击, 比如缓冲溢出攻击 nmap -vv -sV IP -p 21 适用于内外网的探测,以内网操作为示例(外网参数同)    简单端口扫描: nmap -vv -sT(sS、sF、sU、sA) 192.168.0.1 -D 127.0.0.1 (-D伪造的地址)    OS检测: nmap -vv -sS -O 192.168.0.1    RPC鉴别: nmap -sS -sR 192.168.0.1 Linux上的portmap就是一个简单的RPC服 务,监听端口为111(默认) Ping扫射:nmap -sP 172.16.15.0/24 十条常用nmap命令行格式 1)获取远程主机的系统类型及开放端口 Get info about remote host ports and OS detection nmap -sS -P0 -sV -O <target> 这里的 < target > 可以是单一 IP, 或主机名,或域名,或子网 -sS TCP SYN 扫描 (又称半开放,或隐身扫描) -P0 允许你关闭 ICMP pings. -sV 打开系统版本检测 -O 尝试识别远程操作系统 -sS TCP SYN scanning (also known as half-open, or stealth scanning) -P0 option allows you to switch off ICMP pings. -sV option enables version detection -O flag attempt to identify the remote operating system Other option: -A 同时启用操作系统指纹识别和版本检测 -A option enables both OS fingerprinting and version detection -v use -v twice for more verbosity. nmap -sS -P0 -A -v < target > 2)列出开放了指定端口的主机列表 Get list of servers with a specific port open nmap -sT -p 80 -oG – 192.168.1.* | grep open Change the -p argument for the port number. See “man nmap” for different ways to specify address ranges. 3)在网络寻找所有在线主机 Find all active IP addresses in a network nmap -sP 192.168.0.* 或者也可用以下命令: nmap -sP 192.168.0.0/24 指定 subnet 4)Ping 指定范围内的 IP 地址 Ping a range of IP addresses nmap -sP 192.168.1.100-254 nmap accepts a wide variety of addressing notation, multiple targets/ranges, etc. 5)在某段子网上查找未占用的 IP Find unused IPs on a given subnet nmap -T4 -sP 192.168.2.0/24 && egrep "00:00:00:00:00:00" /proc/net/arp 6)在局域网上扫找 Conficker 蠕虫病毒 Scan for the Conficker virus on your LAN ect. nmap -PN -T4 -p139,445 -n -v –script=smb-check-vulns –script-args safe=1 192.168.0.1-254 replace 192.168.0.1-256 with the IP’s you want to check. 7)扫描网络上的恶意接入点 rogue APs. Scan Network for Rogue APs. nmap -A -p1-85,113,443,8080-8100 -T4 –min-hostgroup 50 –max-rtt- timeout 2000 –initial-rtt-timeout 300 –max-retries 3 –host-timeout 20m –max-scan-delay 1000 -oA wapscan 10.0.0.0/8 I’ve used this scan to successfully find many rogue APs on a very, very large network. 8)使用诱饵扫描方法来扫描主机端口 Use a decoy while scanning ports to avoid getting caught by the sys admin sudo nmap -sS 192.168.0.10 -D 192.168.0.2 Scan for open ports on the target device/computer (192.168.0.10) while setting up a decoy address (192.168.0.2). This will show the decoy ip address instead of your ip in targets security logs. Decoy address needs to be alive. Check the targets security log at /var/log/secure to make sure it worked. 9)为一个子网列出反向 DNS 记录 List of reverse DNS records for a subnet nmap -R -sL 209.85.229.99/27 | awk \'{if($3=="not")print"("$2") no PTR";else print$3" is "$2}\’ | grep \'(\’ 10)显示网络上共有多少台 Linux 及 Win 设备? How Many Linux And Windows Devices Are On Your Network? sudo nmap -F -O 192.168.1.1-255 | grep "Running: " > /tmp/os; echo "$(cat /tmp/os | grep Linux | wc -l) Linux device(s)"; echo "$(cat /tmp/os | grep Windows | wc -l) Window(s) devices"

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 工具使用 nmap常用命令及参数说明 https://www.u-9.cn/security/gongju/125295.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务