美文网首页
学习小结

学习小结

作者: 末路穷途 | 来源:发表于2017-01-21 14:25 被阅读0次

    1/21

    NMAP部分学习

    NMAP的中文文档

    • 目标说明
      -iL列表输入; -iR随机选择 ;--exclude 排除主机/网络 ; --excludefile 排除文件中列表

    • 主机发现
      -sL列表扫描;-sP Ping扫描;-P0 无ping;-PS (TCP SYN PING);-PA (TCP ACK PING);-PU (UDP PING); -PE\-PP\-PM(ICMP PING TYPES);-PR (ARP PING); -n 不用域名解析;-R为所有目标解析域名;。。。

    • 端口扫描(6个端口状态)
      ++-sS (TCP SYN扫描)++;-sT(TCP connect()扫描);-sU (UDP扫描); -sN\-sF\-sX(TCP Null,FIN,and Xmas扫描); -sA(TCP ACK扫描);-sW(TCP窗口扫描);-sM(TCP Maimon扫描); --scanflags(定制的TCP扫描);-sl<zombie host[:probeport]>(ldlescan)从zombie机进行TCP盲扫描;-sO IP协议扫描;-b<ftp relay host> FTP弹跳扫描

    • 端口说明和扫描技术
      -p 扫描制定端口,覆盖默认值; -F 快速(有限端口)扫描;-r 顺序扫描

    • 服务和版本探测
      -sV 版本探测; --allports 不为版本探测排除任何端口; --version-intensity <intensity>设置 版本扫描强度;。。。

    • 操作系统探测
      -O 启用操作系统探测;。。。

    • 时间和性能
      -T 设置时间模板 (0-5)

    • 防火墙/IDS躲避和哄骗

    • 输出
      -oN 标准输出; -oX XML输出; -oG Grep输出; -oS 脚本小子输出

    • 其他选项

    • 实例

    nmap 192.168.109.100-200
    使用默认设置扫描网段,找到一台活活跃主机及其开放端口

    nnmap -v scanme.nmap.org
    这个选项扫描主机scanme.nmap.org中 所有的保留TCP端口。选项-v启用细节模式。

    nmap -sS -O scanme.nmap.org/24
    进行秘密SYN扫描,对象为主机Saznme所在的“C类”网段 的255台主机。同时尝试确定每台工作主机的操作系统类型。因为进行SYN扫描 和操作系统检测,这个扫描需要有根权限。

    nmap -sV -p 22,53,110,143,4564 198.116.0-255.1-127
    进行主机列举和TCP扫描,对象为B类188.116网段中255个8位子网。这 个测试用于确定系统是否运行了sshd、DNS、imapd或4564端口。如果这些端口 打开,将使用版本检测来确定哪种应用在运行。

    nmap -v -iR 100000 -P0 -p 80
    随机选择100000台主机扫描是否运行Web服务器(80端口)。由起始阶段 发送探测报文来确定主机是否工作非常浪费时间,而且只需探测主机的一个端口,因 此使用-P0禁止对主机列表。

    nmap -P0 -p80 -oX logs/pb-port80scan.xml -oG logs/pb-port80scan.gnmap 216.163.128.20/20
    扫描4096个IP地址,查找Web服务器(不ping),将结果以Grep和XML格式保存。

    host -l company.com | cut -d -f 4 | nmap -v -iL -
    进行DNS区域传输,以发现company.com中的主机,然后将IP地址提供给 Nmap。上述命令用于GNU/Linux -- 其它系统进行区域传输时有不同的命令。

    AMAP基础

    Amap是一个服务器枚举工具,使用这个工具可以识别正运行在一个指定端口或一个范围端口上的应用程序。

    1. --help 内容
    amap v5.4 (c) 2011 by van Hauser <vh@thc.org> www.thc.org/thc-amap
    Syntax: amap [-A|-B|-P|-W] [-1buSRHUdqv] [[-m] -o <file>] [-D <file>] [-t/-T sec] [-c cons] [-C retries] [-p proto] [-i <file>] [target port [port] ...]
    Modes:
      -A         Map applications: send triggers and analyse responses (default)
                发送触发器并分析回复
      -B         Just grab banners, do not send triggers
                仅捕获banners,不发送触发器
      -P         No banner or application stuff - be a (full connect) port scanner   无banner或应用--是(全连接)端口扫描器
    Options:
      -1         Only send triggers to a port until 1st identification. Speeeeed!
                仅发送触发器到一个端口直到第一次验证
      -6         Use IPv6 instead of IPv4
      -b         Print ascii banner of responses
      -i FILE    Nmap machine readable outputfile to read ports from
                从namp可读的输出文件获得端口号
      -u         Ports specified on commandline are UDP (default is TCP)
                在UDP上指定端口(默认TCP)
      -R         Do NOT identify RPC service
      -H         Do NOT send application triggers marked as potentially harmful   不发送被标记有害的应用触发器
      -U         Do NOT dump unrecognised responses (better for scripting)
                不丢弃无法识别的回应
      -d         Dump all responses  丢弃所有回应
      -v         Verbose mode, use twice (or more!) for debug (not recommended :-) 
                详细模式,使用2次或以上来测试(不推荐)
      -q         Do not report closed ports, and do not print them as unidentified 
                不报告关闭的端口,不打印为无法识别的端口
      -o FILE [-m] Write output to file FILE, -m creates machine readable output
                输出文件
      -c CONS    Amount of parallel connections to make (default 32, max 256)
                建立大量并行连接
      -C RETRIES Number of reconnects on connect timeouts (see -T) (default 3)
                超时时重建连接(见-T)
      -T SEC     Connect timeout on connection attempts in seconds (default 5)   
                重连在多少秒内尝试的超时(默认5)
      -t SEC     Response wait timeout in seconds (default 5)
                回应等待超时
      -p PROTO   Only send triggers for this protocol (e.g. ftp)
                 仅在这个协议中发送触发器(如ftp)
      TARGET PORT   The target address and port(s) to scan (additional to -i)
               扫描目标地址和端口
    amap is a tool to identify application protocols on target ports.
    Note: this version was NOT compiled with SSL support!
    Usage hint: Options "-bqv" are recommended, add "-1" for fast/rush checks.
    
    1. 测试
    • 扫描目的主机上1-1000端口,-b显示回复,-q不报告关闭端口,-v显示详细信息
      amap -bqv 192.168.109.129 1-1000

    • nmap输出标准扫描结果,-i从标准文件中进行端口扫描

      nmap -oN /tmp/report.txt 192.168.109.129
      amap -bqv -i /tmp/report.txt
      
    • -H不发送标记危害触发器,-R不辨别RPC服务进行扫描,-c 建立并行连接
      amap -bqv -H -R -c 32 192.168.109.129 1-10000

    • -p ftp 仅在ftp服务端口发送触发器,-C 5超时重连
      amap -bq -p ftp -H -C 5 192.168.109.129 23

    相关文章

      网友评论

          本文标题:学习小结

          本文链接:https://www.haomeiwen.com/subject/ultnbttx.html