目录
一、SMB分析
1、enum4linux
SMB是一个协议名,全称是Server Message Block(服务器消息快协议),用于在计算机间共享文件、打印机、串口等,电脑上的网上邻居由它实现。一般共享文件夹和打印机使用较多 它是应用层(和表示层)协议,使用C/S架构
注意:smb的默认端口可能是139或者445,其工作的端口与其使用的协议有关。
正是由于smb被日常生活中大量运用于网上邻居,而网络设备都有可能存在这样那样的安全问题,这就导致了smb服务成为很多人眼中的敏感服务,也是攻击者比较愿意花时间探索的服务
在这样的背景下,一款强大的smb服务专用扫描器应运而生,他就是我们要今天介绍的工具——enum4linux
Enum4linux是用于枚举windows和Linux系统上的SMB服务的工具。可以轻松的从与SMB服务有关的目标中快速提取信息。
用法: ./enum4linux.pl [选项] ip地址
枚举选项:
-U 获取用户列表
-M 获取机器列表*
-S 获取共享列表
-P 获取密码策略信息
-G 获取组和成员列表
-d 详述适用于-U和-S
-u user 用户指定要使用的用户名(默认"")
-p pass 指定要使用的密码(默认为"")
以下选项是enum.exe未实现的: -L, -N, -D, -f
其他选项:
-a 做所有简单枚举(-U -S -G -P -r -o -n -i),如果您没有提供任何其他选项,则启用此选项
-h 显示此帮助消息并退出
-r 通过RID循环枚举用户
-R range RID范围要枚举(默认值:500-550,1000-1050,隐含-r)
-K n 继续搜索RID,直到n个连续的RID与用户名不对应,Impies RID范围结束于999999.对DC有用
-l 通过LDAP 389 / TCP获取一些(有限的)信息(仅适用于DN)
-s 文件暴力猜测共享名称
-k user 远程系统上存在的用户(默认值:administrator,guest,krbtgt,domain admins,root,bin,none)
用于获取sid与“lookupsid known_username”
使用逗号尝试几个用户:“-k admin,user1,user2”
-o 获取操作系统信息
-i 获取打印机信息
-w wrkg 手动指定工作组(通常自动找到)
-n 做一个nmblookup(类似于nbtstat)
-v 详细输出,显示正在运行的完整命令(net,rpcclient等)
例1:信息探测
enum4linux -a -o ip
2、nbtscan
这是一款用于扫描Windows网络上NetBIOS名字信息的程序。该程序对给出范围内的每一个地址发送NetBIOS状态查询,并且以易读的表格列出接收到的信息,对于每个响应的主机,NBTScan列出它的IP地址、NetBIOS计算机名、登录用户名和MAC地址。
nbtscan [-v] [-d] [-e] [-l] [-t timeout] [-b bandwidth] [-r] [-q] [-s separator] [-m retransmits] (-f filename)|(<scan_range>)
-v verbose output. Print all names received
from each host
-d dump packets. Print whole packet contents.
-e Format output in /etc/hosts format.
-l Format output in lmhosts format.
Cannot be used with -v, -s or -h options.
-t timeout wait timeout milliseconds for response.
Default 1000.
-b bandwidth Output throttling. Slow down output
so that it uses no more that bandwidth bps.
Useful on slow links, so that ougoing queries
don't get dropped.
-r use local port 137 for scans. Win95 boxes
respond to this only.
You need to be root to use this option on Unix.
-q Suppress banners and error messages,
-s separator Script-friendly output. Don't print
column and record headers, separate fields with separator.
-h Print human-readable names for services.
Can only be used with -v option.
-m retransmits Number of retransmits. Default 0.
-f filename Take IP addresses to scan from file filename.
-f - makes nbtscan take IP addresses from stdin.
<scan_range> what to scan. Can either be single IP
like 192.168.1.1 or
range of addresses in one of two forms:
xxx.xxx.xxx.xxx/xx or xxx.xxx.xxx.xxx-xxx.
Examples:
nbtscan -r 192.168.1.0/24
Scans the whole C-class network.
nbtscan 192.168.1.25-137
Scans a range from 192.168.1.25 to 192.168.1.137
nbtscan -v -s : 192.168.1.0/24
Scans C-class network. Prints results in script-friendly
format using colon as field separator.
Produces output like that:
192.168.0.1:NT_SERVER:00U
192.168.0.1:MY_DOMAIN:00G
192.168.0.1:ADMINISTRATOR:03U
192.168.0.2:OTHER_BOX:00U
...
nbtscan -f iplist
Scans IP addresses specified in file iplist.
3、smbmap
SMBMap允许用户枚举整个域中的samba共享驱动器。用户可以使用该工具列出共享驱动器、驱动器权限、共享内容、上传/下载功能、文件名自动下载模式匹配,甚至远程执行命令。该工具原本的设计初衷是为了简化在大型网络中搜索潜在敏感数据的过程。
基本参数
-u 用户名(省略时为空会话)
-p 密码或NTLM hash
-d 域名(默认为工作组workgroup )
-P 端口(默认为TCP 445 )
-H 主机地址或名称
--host-file 主机列表文件
Examples:
$ smbmap -u jsmith -p password1 -d workgroup -H 192.168.0.1
$ smbmap -u jsmith -p 'aad3b435b51404eeaad3b435b51404ee:da76f2c4c96028b7a6111aef4a50a94d' -H 172.16.0.20
$ smbmap -u 'apadmin' -p 'asdf1234!' -d ACME -h 10.1.3.30 -x 'net group "Domain Admins" /domain'
二、SMTP分析
1、smtp-user-enum
通过SMTP服务发现目标系统帐号( Unix、Linux、 Solaris )
三种枚举方法
VRFY :验证邮箱是否存在
EXPN :验证邮箱列表是否存在
RCPT TO :指定收件人地址
Usage: smtp-user-enum.pl [options] ( -u username | -U file-of-usernames ) ( -t host | -T file-of-targets )
options:
-m <number> 最大线程数(默认: 5)
-M <mode> 使用方法方式 EXPN, VRFY or RCPT (默认: VRFY)
-u <user> 指定用户
-f <addr> 邮箱地址,只能用在 "RCPT TO" mode (默认: user@example.com)
-D <domaim> 使用电子邮件地址添加到用户列表在域 (默认: none)使用邮箱代替用户名,比如:"-D example.com" 域来使用代替testA@example.com, testB@example.com
-U <file> 通过smtp服务指定文件里的用户名检查
-t <host> 指定主机来运行smtp服务器主机服务
-T <file> 指定文件来运行smtp服务器主机服务
-p <port> 设置TCP端口号 (默认: 25)
-d 调试
-t <time> 最大返回时间 (default: 5)
-v 版本
-h 帮助
Examples:
$ smtp-user-enum -M VRFY -U users.txt -t 10.0.0.1
$ smtp-user-enum -M EXPN -u admin1 -t 10.0.0.1
$ smtp-user-enum -M RCPT -U users.txt -T mail-server-ips.txt
$ smtp-user-enum -M EXPN -D example.com -U users.txt -t 10.0.0.1
2、Swaks
Swaks是一个功能强大,灵活,可编写脚本,面向事务的SMTP测试工具。
--from <要显示的发件人邮箱>
--ehlo <伪造的邮件ehlo头>
--body <邮件正文>
--header <邮件头信息,subject为邮件标题>
--data <源邮件>
例1:测试邮箱的连通性
swaks --to xxxxxx@qq.com
返回250ok,说明该邮箱存在,并且可以正常收信。
例2:利用SMTP发送邮件
swaks --to 收件箱@qq.com --from 发件箱@163.com
--body HI这是 由kali发送到您邮件中的内容 --header "hello"
--server smtp.163.com -p 25 -au 发件箱@163.com -ap SMTP密码
在测试之前,在163官网开启smtp
命令说明:
--from test@qq.com //发件人邮箱;
--ehlo qq.com //伪造邮件ehlo头,即是发件人邮箱的域名。提供身份认证
--body "http://www.baidu.com" //引号中的内容即为邮件正文;
--header "Subject:hello" //邮件头信息,subject为邮件标题
--data ./Desktop/email.txt //将正常源邮件的内容保存成TXT文件,再作为正常邮件发送
例3:高级的邮件伪造
首先,我们需要一份正常的邮件
点击显示邮件原文,把原文复制出来,保存为email.txt
其中的received可以都删除,该项为接收信息,发信中不需要。to项也可以删除,可以直接用swaks --to来代替。
注意不要忘了加--from 否则qq邮箱会报由kali代发
swaks --data ./Desktop/email.txt --to xxxx@qq.com --from services@tophant.com
三、SNMP分析
1、braa
Braa是大规模SNMP扫描工具,这种工具的预期用途当然是使SNMP(Simple Network Management Protocol简单网络管理)查询 - 但不同于来自net-snmp的snmpget或snmpwalk,它能够在单个进程中同时查询几十或几百个主机。 因此,它消耗非常少的系统资源,并且扫描非常快。
用法:braa [options] [query1] [query2] ...
-h 显示此帮助
-2 声明SNMP2C代理
-v 执行所有查询后显示简要摘要
-x 十六进制转储八位字节串
-t <s> 获得响应前等待数秒
-d <s> 发送每个数据包后等待微秒数
-p <s> 在后续遍之间等待数毫秒
-f <file> 从文件<file>加载查询(逐行)
-a <time> 在<time>秒后退出
-r <rc> 重试次数(默认值:3)
查询格式:
GET: [community@]iprange[:port]:oid[/id]
WALK: [community@]iprange[:port]:oid.*[/id]
SET: [community@]iprange[:port]:oid=value[/id]
例1:使用公开公布的OID字符串在192.168.1.63上运行遍历SNMP树,查询.1.3.6下的所有OID:
braa public@192.168.1.63:.1.3.6.*
2、onesixtyone
snmp 扫描可以使用 onesixtyone 工具 。
onesixtyone 0.3.3 [options] <host> <community>
-c <communityfile> file with community names to try
-i <inputfile> file with target hosts
-o <outputfile> output log
-p specify an alternate destination SNMP port
-d debug mode, use twice for more information
-s short mode, only print IP addresses
-w n wait n milliseconds (1/1000 of a second) between sending packets (default 10)
-q quiet mode, do not print log to stdout, use with -o
host is either an IPv4 address or an IPv4 address and a netmask
default community names are: public private
Max number of hosts : 65536
Max community length: 32
Max number of communities: 16384
examples: onesixtyone 192.168.4.0/24 public
onesixtyone -c dict.txt -i hosts -o my.log -w 100
3、snmp-check
snmp-check 也是一个用于 snmp 扫描的工具,优点在于其结果可读性比较强。
Usage: snmp-check [OPTIONS] <target IP address>
-p --port : SNMP port. Default port is 161;
-c --community : SNMP community. Default is public;
-v --version : SNMP version (1,2c). Default is 1;
-w --write : detect write access (separate action by enumeration);
-d --disable_tcp : disable TCP connections enumeration!
-t --timeout : timeout in seconds. Default is 5;
-r --retries : request retries. Default is 1;
-i --info : show script version;
-h --help : show help menu;
四、SSL分析
1、ssldump
$ ssldump -h
Usage: ssldump [-r dumpfile] [-i interface] [-l sslkeylogfile] [-w outpcapfile]
[-k keyfile] [-p password] [-vtaTnsAxVNde]
[filter]
例1:监听eth0、443端口上的网络流量
ssldump -i eth0 port 443
例2:监听eth0、443端口上的网络流量,指定网络主机www.abc.com
ssldump -i eth0 port 443 and host www.abc.com
2、sslh
usage:
sslh [-v] [-i] [-V] [-f] [-n] [--transparent] [-F<file>]
[-t <timeout>] [-P <pidfile>] [-u <username>] [-C <chroot>] -p <addr> [-p <addr> ...]
[--ssh <addr>]
[--openvpn <addr>]
[--tinc <addr>]
[--xmpp <addr>]
[--http <addr>]
[--tls <addr>]
[--adb <addr>]
[--socks5 <addr>]
[--anyprot <addr>]
[--on-timeout <addr>]
-v: verbose
-V: version
-f: foreground
-n: numeric output
-u: specify under which user to run
-C: specify under which chroot path to run
--transparent: behave as a transparent proxy
-F: use configuration file (warning: no space between -F and file name!)
--on-timeout: connect to specified address upon timeout (default: ssh address)
-t: seconds to wait before connecting to --on-timeout address.
-p: address and port to listen on.
Can be used several times to bind to several addresses.
--[ssh,ssl,...]: where to connect connections from corresponding protocol.
-P: PID file.
-i: Run as a inetd service.
SSLH:让 HTTPS 和 SSH 共享同一个端口 - 知乎 (zhihu.com)https://zhuanlan.zhihu.com/p/78857088
3、sslscan
SSLScan 是 Kali 中的集成命令行工具,用于评估远程 Web 服务的 SSL/TLS 的安全性。它可以检测heartbleed
Options:
--targets=<file> A file containing a list of hosts to check.
Hosts can be supplied with ports (host:port)
--sni-name=<name> Hostname for SNI
--ipv4, -4 Only use IPv4
--ipv6, -6 Only use IPv6
--show-certificate Show full certificate information
--show-client-cas Show trusted CAs for TLS client auth
--no-check-certificate Don't warn about weak certificate algorithm or keys
--ocsp Request OCSP response from server
--pk=<file> A file containing the private key or a PKCS#12 file
containing a private key/certificate pair
--pkpass=<password> The password for the private key or PKCS#12 file
--certs=<file> A file containing PEM/ASN1 formatted client certificates
--ssl2 Only check if SSLv2 is enabled
--ssl3 Only check if SSLv3 is enabled
--tls10 Only check TLSv1.0 ciphers
--tls11 Only check TLSv1.1 ciphers
--tls12 Only check TLSv1.2 ciphers
--tls13 Only check TLSv1.3 ciphers
--tlsall Only check TLS ciphers (all versions)
--show-ciphers Show supported client ciphers
--show-cipher-ids Show cipher ids
--iana-names Use IANA/RFC cipher names rather than OpenSSL ones
--show-times Show handhake times in milliseconds
--no-cipher-details Disable EC curve names and EDH/RSA key lengths output
--no-ciphersuites Do not check for supported ciphersuites
--no-compression Do not check for TLS compression (CRIME)
--no-fallback Do not check for TLS Fallback SCSV
--no-groups Do not enumerate key exchange groups
--no-heartbleed Do not check for OpenSSL Heartbleed (CVE-2014-0160)
--no-renegotiation Do not check for TLS renegotiation
--show-sigs Enumerate signature algorithms
--starttls-ftp STARTTLS setup for FTP
--starttls-imap STARTTLS setup for IMAP
--starttls-irc STARTTLS setup for IRC
--starttls-ldap STARTTLS setup for LDAP
--starttls-mysql STARTTLS setup for MYSQL
--starttls-pop3 STARTTLS setup for POP3
--starttls-psql STARTTLS setup for PostgreSQL
--starttls-smtp STARTTLS setup for SMTP
--starttls-xmpp STARTTLS setup for XMPP
--xmpp-server Use a server-to-server XMPP handshake
--rdp Send RDP preamble before starting scan
--bugs Enable SSL implementation bug work-arounds
--no-colour Disable coloured output
--sleep=<msec> Pause between connection request. Default is disabled
--timeout=<sec> Set socket timeout. Default is 3s
--connect-timeout=<sec> Set connect timeout. Default is 75s
--verbose Display verbose output
--version Display the program version
--xml=<file> Output results to an XML file. Use - for STDOUT.
--help Display the help text you are now reading
例1:扫描服务器
sslscan 127.0.0.1
第一部分告诉了我们服务器的一些配置信息,包含常见的配置:支持的协议,是否支持TLS Fallback SCSV,是否支持压缩,Heartbleed。
第二部分告诉了我们服务器支持的加密算法,以及服务器首选的加密算法(如果客户端支持,服务器会尝试使用prefered的算法进行通信);红色表示不安全的算法,黄色代表中等强度的算法。
第三部分告诉了我们证书签名的一些信息,这里用的是2048位的RSA进行签名。
4、sslyze
SSLyze是一个Python工具,可以通过连接到服务器来分析服务器的SSL配置。它旨在快速而全面,并应帮助组织和测试人员识别影响其SSL服务器的错误配置。
usage: sslyze [-h] [--update_trust_stores] [--cert CERTIFICATE_FILE] [--key KEY_FILE] [--keyform KEY_FORMAT] [--pass PASSPHRASE]
[--json_out JSON_FILE] [--targets_in TARGET_FILE] [--quiet] [--slow_connection] [--https_tunnel PROXY_SETTINGS]
[--starttls PROTOCOL] [--xmpp_to HOSTNAME] [--sni SERVER_NAME_INDICATION] [--sslv3] [--tlsv1_3] [--compression] [--reneg]
[--early_data] [--sslv2] [--elliptic_curves] [--tlsv1] [--http_headers] [--openssl_ccs] [--resum]
[--resum_attempts RESUM_ATTEMPTS] [--heartbleed] [--tlsv1_1] [--fallback] [--robot] [--tlsv1_2] [--certinfo]
[--certinfo_ca_file CERTINFO_CA_FILE] [--mozilla_config {modern,intermediate,old,disable}]
[target ...]
SSLyze version 5.1.3
positional arguments:
target The list of servers to scan.
options:
-h, --help show this help message and exit
--mozilla_config {modern,intermediate,old,disable}
Shortcut to queue various scan commands needed to check the server's TLS configurations against one of Mozilla's
recommended TLS configuration. Set to "intermediate" by default. Use "disable" to disable this check.
Trust stores options:
--update_trust_stores
Update the default trust stores used by SSLyze. The latest stores will be downloaded from
https://github.com/nabla-c0d3/trust_stores_observatory. This option is meant to be used separately, and will
silence any other command line option supplied to SSLyze.
Client certificate options:
--cert CERTIFICATE_FILE
Client certificate chain filename. The certificates must be in PEM format and must be sorted starting with the
subject's client certificate, followed by intermediate CA certificates if applicable.
--key KEY_FILE Client private key filename.
--keyform KEY_FORMAT Client private key format. DER or PEM (default).
--pass PASSPHRASE Client private key passphrase.
Input and output options:
--json_out JSON_FILE Write the scan results as a JSON document to the file JSON_FILE. If JSON_FILE is set to '-', the JSON output
will instead be printed to stdout. The resulting JSON file is a serialized version of the ScanResult objects
described in SSLyze's Python API: the nodes and attributes will be the same. See
https://nabla-c0d3.github.io/sslyze/documentation/available-scan-commands.html for more details.
--targets_in TARGET_FILE
Read the list of targets to scan from the file TARGET_FILE. It should contain one host:port per line.
--quiet Do not output anything to stdout; useful when using --json_out.
Contectivity options:
--slow_connection Greatly reduce the number of concurrent connections initiated by SSLyze. This will make the scans slower but
more reliable if the connection between your host and the server is slow, or if the server cannot handle many
concurrent connections. Enable this option if you are getting a lot of timeouts or errors.
--https_tunnel PROXY_SETTINGS
Tunnel all traffic to the target server(s) through an HTTP CONNECT proxy. HTTP_TUNNEL should be the proxy's URL:
'http://USER:PW@HOST:PORT/'. For proxies requiring authentication, only Basic Authentication is supported.
--starttls PROTOCOL Perform a StartTLS handshake when connecting to the target server(s). StartTLS should be one of: auto, smtp,
xmpp, xmpp_server, pop3, imap, ftp, ldap, rdp, postgres. The 'auto' option will cause SSLyze to deduce the
protocol (ftp, imap, etc.) from the supplied port number, for each target servers.
--xmpp_to HOSTNAME Optional setting for STARTTLS XMPP. XMPP_TO should be the hostname to be put in the 'to' attribute of the XMPP
stream. Default is the server's hostname.
--sni SERVER_NAME_INDICATION
Use Server Name Indication to specify the hostname to connect to. Will only affect TLS 1.0+ connections.
Scan commands:
--sslv3 Test a server for SSL 3.0 support.
--tlsv1_3 Test a server for TLS 1.3 support.
--compression Test a server for TLS compression support, which can be leveraged to perform a CRIME attack.
--reneg Test a server for for insecure TLS renegotiation and client-initiated renegotiation.
--early_data Test a server for TLS 1.3 early data support.
--sslv2 Test a server for SSL 2.0 support.
--elliptic_curves Test a server for supported elliptic curves.
--tlsv1 Test a server for TLS 1.0 support.
--http_headers Test a server for the presence of security-related HTTP headers.
--openssl_ccs Test a server for the OpenSSL CCS Injection vulnerability (CVE-2014-0224).
--resum Test a server for TLS 1.2 session resumption support using session IDs and TLS tickets.
--resum_attempts RESUM_ATTEMPTS
To be used with --resum. Number of session resumptions (both with Session IDs and TLS Tickets) that SSLyze
should attempt. The default value is 5, but a higher value such as 100 can be used to get a more accurate
measure of how often session resumption succeeds or fails with the server.
--heartbleed Test a server for the OpenSSL Heartbleed vulnerability.
--tlsv1_1 Test a server for TLS 1.1 support.
--fallback Test a server for the TLS_FALLBACK_SCSV mechanism to prevent downgrade attacks.
--robot Test a server for the ROBOT vulnerability.
--tlsv1_2 Test a server for TLS 1.2 support.
--certinfo Retrieve and analyze a server's certificate(s) to verify its validity.
--certinfo_ca_file CERTINFO_CA_FILE
To be used with --certinfo. Path to a file containing root certificates in PEM format that will be used to
verify the validity of the server's certificate.
例1:针对目标主机启动扫描
sslyze www.example.com
5、tlssled
该工具是基于sslscan的脚本工具,使用非常简单。用户可以一次性执行所有检测任务,并且会生成详细的日志文件。它可以检测支持的协议类型、空密码和弱密码以及强密码等功能。
Usage: /usr/bin/tlssled <hostname or IP_address> <port>
1、amass
深度子域名枚举工具,该工具采用Go语言开发,它可以通过遍历等形式爬取数据源和Web文档,或利用IP地址来搜索相关的网块和ASN,并利用所有收集到的信息来构建目标网络拓扑。
amass工具有几个子命令,用于处理您的互联网曝光调查。
Subcommand | Description |
---|---|
intel | 收集开源情报以调查目标组织 |
enum | 对暴露于Internet的系统执行DNS枚举和网络映射 |
viz | 生成用于探索性分析的枚举可视化 |
track | 将枚举结果与常见目标组织进行比较 |
db | 管理存储枚举结果的图形数据库 |
子命令参数
intel
intel子命令可以帮助您发现与您正在调查的组织相关联的其他根域名。此子命令使用配置文件的数据源部分来获取被动情报,例如反向whois信息。
Flag | Description | Example |
---|---|---|
-active | Enable active recon methods | amass intel -active -addr 192.168.2.1-64 -p 80,443,8080 |
-addr | IPs and ranges (192.168.1.1-254) separated by commas | amass intel -addr 192.168.2.1-64 |
-asn | ASNs separated by commas (can be used multiple times) | amass intel -asn 13374,14618 |
-cidr | CIDRs separated by commas (can be used multiple times) | amass intel -cidr 104.154.0.0/15 |
-config | Path to the INI configuration file | amass intel -config config.ini |
-d | Domain names separated by commas (can be used multiple times) | amass intel -whois -d http://example.com |
-demo | Censor output to make it suitable for demonstrations | amass intel -demo -whois -d http://example.com |
-df | Path to a file providing root domain names | amass intel -whois -df domains.txt |
-dir | Path to the directory containing the graph database | amass intel -dir PATH -cidr 104.154.0.0/15 |
-ef | Path to a file providing data sources to exclude | amass intel -whois -ef exclude.txt -d http://example.com |
-exclude | Data source names separated by commas to be excluded | amass intel -whois -exclude crtsh -d http://example.com |
-if | Path to a file providing data sources to include | amass intel -whois -if include.txt -d http://example.com |
-include | Data source names separated by commas to be included | amass intel -whois -include crtsh -d http://example.com |
-ip | Show the IP addresses for discovered names | amass intel -ip -whois -d http://example.com |
-ipv4 | Show the IPv4 addresses for discovered names | amass intel -ipv4 -whois -d http://example.com |
-ipv6 | Show the IPv6 addresses for discovered names | amass intel -ipv6 -whois -d http://example.com |
-list | Print the names of all available data sources | amass intel -list |
-log | Path to the log file where errors will be written | amass intel -log amass.log -whois -d http://example.com |
-max-dns-queries | Maximum number of concurrent DNS queries | amass intel -max-dns-queries 200 -whois -d http://example.com |
-o | Path to the text output file | amass intel -o out.txt -whois -d http://example.com |
-org | Search string provided against AS description information | amass intel -org Facebook |
-p | Ports separated by commas (default: 80, 443) | amass intel -cidr 104.154.0.0/15 -p 443,8080 |
-r | IP addresses of preferred DNS resolvers (can be used multiple times) | amass intel -r 8.8.8.8,1.1.1.1 -whois -d http://example.com |
-rf | Path to a file providing preferred DNS resolvers | amass intel -rf data/resolvers.txt -whois -d http://example.com |
-src | Print data sources for the discovered names | amass intel -src -whois -d http://example.com |
-timeout | Number of minutes to execute the enumeration | amass intel -timeout 30 -d http://example.com |
-whois | All discovered domains are run through reverse whois | amass intel -whois -d http://example.com |
参考:
enum
此子命令将在填充选定的图形数据库时执行DNS枚举和网络映射。配置文件中的所有可用设置都与此子命令相关。以下标志可用于配置:
Flag | Description | Example |
---|---|---|
-active | Enable active recon methods | amass enum -active -d http://example.com -p 80,443,8080 |
-aw | Path to a different wordlist file for alterations | amass enum -aw PATH -d http://example.com |
-bl | Blacklist of subdomain names that will not be investigated | amass enum -bl http://blah.example.com -d http://example.com |
-blf | Path to a file providing blacklisted subdomains | amass enum -blf data/blacklist.txt -d http://example.com |
-brute | Perform brute force subdomain enumeration | amass enum -brute -d http://example.com |
-config | Path to the INI configuration file | amass enum -config config.ini |
-d | Domain names separated by commas (can be used multiple times) | amass enum -d http://example.com |
-demo | Censor output to make it suitable for demonstrations | amass enum -demo -d http://example.com |
-df | Path to a file providing root domain names | amass enum -df domains.txt |
-dir | Path to the directory containing the graph database | amass enum -dir PATH -d http://example.com |
-ef | Path to a file providing data sources to exclude | amass enum -ef exclude.txt -d http://example.com |
-exclude | Data source names separated by commas to be excluded | amass enum -exclude crtsh -d http://example.com |
-if | Path to a file providing data sources to include | amass enum -if include.txt -d http://example.com |
-include | Data source names separated by commas to be included | amass enum -include crtsh -d http://example.com |
-ip | Show the IP addresses for discovered names | amass enum -ip -d http://example.com |
-ipv4 | Show the IPv4 addresses for discovered names | amass enum -ipv4 -d http://example.com |
-ipv6 | Show the IPv6 addresses for discovered names | amass enum -ipv6 -d http://example.com |
-json | Path to the JSON output file | amass enum -json out.json -d http://example.com |
-list | Print the names of all available data sources | amass enum -list |
-log | Path to the log file where errors will be written | amass enum -log amass.log -d http://example.com |
-max-dns-queries | Deprecated flag to be replaced by dns-qps in version 4.0 | amass enum -max-dns-queries 200 -d http://example.com |
-dns-qps | Maximum number of DNS queries per second across all resolvers | amass enum -dns-qps 200 -d http://example.com |
-rqps | Maximum number of DNS queries per second for each untrusted resolver | amass enum -rqps 10 -d http://example.com |
-trqps | Maximum number of DNS queries per second for each trusted resolver | amass enum -trqps 20 -d http://example.com |
-min-for-recursive | Subdomain labels seen before recursive brute forcing (Default: 1) | amass enum -brute -min-for-recursive 3 -d http://example.com |
-max-depth | Maximum number of subdomain labels for brute forcing | amass enum -brute -max-depth 3 -d http://example.com |
-nf | Path to a file providing already known subdomain names (from other tools/sources) | amass enum -nf names.txt -d http://example.com |
-noalts | Disable generation of altered names | amass enum -noalts -d http://example.com |
-norecursive | Turn off recursive brute forcing | amass enum -brute -norecursive -d http://example.com |
-o | Path to the text output file | amass enum -o out.txt -d http://example.com |
-oA | Path prefix used for naming all output files | amass enum -oA amass_scan -d http://example.com |
-passive | A purely passive mode of execution | amass enum --passive -d http://example.com |
-p | Ports separated by commas (default: 443) | amass enum -d http://example.com -p 443,8080 |
-r | IP addresses of untrusted DNS resolvers (can be used multiple times) | amass enum -r 8.8.8.8,1.1.1.1 -d http://example.com |
-tr | IP addresses of trusted DNS resolvers (can be used multiple times) | amass enum -tr 8.8.8.8,1.1.1.1 -d http://example.com |
-rf | Path to a file providing untrusted DNS resolvers | amass enum -rf data/resolvers.txt -d http://example.com |
-trf | Path to a file providing trusted DNS resolvers | amass enum -trf data/trusted.txt -d http://example.com |
-src | Print data sources for the discovered names | amass enum -src -d http://example.com |
-timeout | Number of minutes to execute the enumeration | amass enum -timeout 30 -d http://example.com |
-w | Path to a different wordlist file | amass enum -brute -w wordlist.txt -d http://example.com |
viz
创建具有启发性的网络图形可视化,为收集的信息添加结构。此子命令仅利用配置文件中的output_directory
和远程图形数据库设置。
为可视化而生成的文件在当前工作目录中创建,名为amass_TYPE
将DNS和基础结构结果输出为网络图的交换机:
Flag | Description | Example |
---|---|---|
-config | Path to the INI configuration file | amass viz -config config.ini -d3 |
-d | Domain names separated by commas (can be used multiple times) | amass viz -d3 -d http://example.com |
-d3 | Output a D3.js v4 force simulation HTML file | amass viz -d3 -d http://example.com |
-df | Path to a file providing root domain names | amass viz -d3 -df domains.txt |
-dir | Path to the directory containing the graph database | amass viz -d3 -dir PATH -d http://example.com |
-enum | Identify an enumeration via an index from the db listing | amass viz -enum 1 -d3 -d http://example.com |
-o | Path to a pre-existing directory that will hold output files | amass viz -d3 -o OUTPATH -d http://example.com |
-oA | Prefix used for naming all output files | amass viz -d3 -oA example -d http://example.com |
-gexf | Output to Graph Exchange XML Format (GEXF) | amass viz -gexf -d http://example.com |
-graphistry | Output Graphistry JSON | amass viz -graphistry -d http://example.com |
-i | Path to the Amass data operations JSON input file | amass viz -d3 -d http://example.com |
-maltego | Output a Maltego Graph Table CSV file | amass viz -maltego -d http://example.com |
track
显示包含相同目标的枚举之间的差异,以监视目标的攻击面。此子命令仅利用配置文件中的“output_directory”和远程图形数据库设置。用于跨图形数据库中的枚举执行Internet暴露监视的标志:
Flag | Description | Example |
---|---|---|
-config | Path to the INI configuration file | amass track -config config.ini |
-d | Domain names separated by commas (can be used multiple times) | amass track -d http://example.com |
-df | Path to a file providing root domain names | amass track -df domains.txt |
-dir | Path to the directory containing the graph database | amass track -dir PATH |
-history | Show the difference between all enumeration pairs | amass track -history |
-last | The number of recent enumerations to include in the tracking | amass track -last NUM |
-since | Exclude all enumerations before a specified date (format: 01/02 15:04:05 2006 MST) | amass track -since DATE |
db
执行图形数据库的查看和操作。此子命令仅利用配置文件中的“output_directory”和远程图形数据库设置。与图形数据库中的枚举结果交互的标志包括:
Flag | Description | Example |
---|---|---|
-config | Path to the INI configuration file | amass db -config config.ini |
-d | Domain names separated by commas (can be used multiple times) | amass db -d http://example.com |
-demo | Censor output to make it suitable for demonstrations | amass db -demo -d http://example.com |
-df | Path to a file providing root domain names | amass db -df domains.txt |
-dir | Path to the directory containing the graph database | amass db -dir PATH |
-enum | Identify an enumeration via an index from the listing | amass db -enum 1 -show |
-import | Import an Amass data operations JSON file to the graph database | amass db -import PATH |
-ip | Show the IP addresses for discovered names | amass db -show -ip -d http://example.com |
-ipv4 | Show the IPv4 addresses for discovered names | amass db -show -ipv4 -d http://example.com |
-ipv6 | Show the IPv6 addresses for discovered names | amass db -show -ipv6 -d http://example.com |
-json | Path to the JSON output file or ‘-’ | amass db -names -silent -json out.json -d http://example.com |
-list | Print enumerations in the database and filter on domains specified | amass db -list |
-names | Print just discovered names | amass db -names -d http://example.com |
-nocolor | Disable colorized output | amass db -names -nocolor -d http://example.com |
-o | Path to the text output file | amass db -names -o out.txt -d http://example.com |
-show | Print the results for the enumeration index + domains provided | amass db -show |
-silent | Disable all output during execution | amass db -names -silent -json out.json -d http://example.com |
-src | Print data sources for the discovered names | amass db -show -src -d http://example.com |
summary | Print just ASN table summary | amass db -summary -d http://example.com |
例1:子域名枚举最基本的操作为:
amass enum -d example.com
例2:DNS枚举的典型参数:
amass enum -v -src -ip -brute -min-for-recursive 2 -d example.com
例3:启用主动侦察方法:
amass intel -active -addr 192.168.2.1-64 -p 80,443,8080
例4:所有发现的域都通过反向Whois运行
amass intel -whois -d example.com
2、dmitry
DMitry是黑客渗透流程中进行深度信息收集的利器,它是一个由C语言编写的UNIX/(GNU)Linux命令行工具,无GUI操作界面,需掌握其常用使用参数。
dmitry [-winsepfb] [-t 0-9] [-o%host.txt]主机
参数:
-o 将输出保存到%host.txt或由-o文件指定的文件
-i 对主机的IP地址执行whois查找
-w 对主机的域名执行whois查找
-n 在主机上检索Netcraft.com信息
-s 执行搜索可能的子域
-e 执行搜索可能的电子邮件地址
-p 在主机上执行TCP端口扫描(这是全连接扫描)
-f 在显示输出报告过滤端口的主机上执行TCP端口扫描
-b 读取从扫描端口接收的横幅
-t 0-9 扫描TCP端口时设置TTL(默认为2)
例1:扫描端口是否开放:
dmitry -p www.baidu.com -f -b
例2:搜索子域名:
dmitry -s www.baidu.com
例3:对主机的域名执行whois查找
dmitry -w www.baidu.com
3、ike-scan
ike-scan可以发现IKE主机,也可以使用重传回退模式对它们进行指纹识别。
参数:
--help或-h显示此使用信息并退出。
--file = <fn>或-f <fn>从指定的文件中读取主机名或地址而不是从命令行。一个名字或IP每行地址对标准输入使用“ - ”。
--sport = <p>或-s <p>将UDP源端口设置为<p>,default = 500,0 = random。
一些IKE实现需要客户端使用UDP源端口500,不会与其他端口通话。请注意,通常需要超级用户权限使用低于1024的非零源端口系统上的一个进程可以绑定到给定的源端口,在任何一个时间使用--nat-t选项更改,默认源端口为4500
--dport = <p>或-d <p>将UDP目标端口设置为<p>,default = 500。
UDP端口500是ISAKMP的分配的端口号,这是大多数(如果不是全部)IKE使用的端口实现。使用--nat-t选项更改,默认目标端口为4500
--retry = <n>或-r <n>将每个主机的总尝试次数设置为<n>,默认= 3。
--timeout = <n>或-t <n>将每个主机超时的初始设置设置为<n> ms,默认= 500。
此超时是发送到每个主机的第一个数据包。随后的超时乘以回退系数设置为--backoff。
--bandwidth = <n>或-B <n>将所需的出站带宽设置为<n>,默认= 56000
默认值为每秒位数。如果你将“K”附加到值,则单位是千比特每秒;如果你附“M”值,单位是兆比特每秒。“K”和“M”后缀代表十进制,而不是二进制,倍数。
所以64K是64000,而不是65536。
--interval = <n>或-i <n>将最小数据包间隔设置为<n> ms。
分组间隔将不小于此数。指定的时间间隔默认为毫秒。如果“u”附加到该值,则间隔是微秒,如果附加了“s”间隔是秒。如果你想要使用一个给定的带宽,那就是更容易使用--bandwidth选项。您不能同时指--interval和--bandwidth,因为他们只是改变的不同方法相同的底层变量。
--backoff = <b>或-b <b>将超时退避因子设置为<b>,默认= 1.50。
每个主机的超时乘以这个因素每次超时后所以,如果重试的次数是3,初始的每个主机超时是500ms和退货因子是1.5,那么第一个超时就是500ms,第二个750ms和第三个1125ms。
--verbose或-v显示详细的进度消息。
使用多次以获得更大的效果:
1 - 显示每个通行证何时完成收到包含无效Cookie的数据包。
2 - 显示发送和接收的每个数据包主机从列表中删除。
3 - 显示主机,供应商ID和退货清单扫描开始之前。X-45454545 CEEC X-这样打印出较少的协议信息输出线较短。
- multiline或-M分割多行的有效载荷解码。
使用此选项,每个有效载荷的解码是新新新旗新新新旗新新旗新新旗新新旗新新旗新新旗新新200新新旗新新200新新旗新新200新新旗新新200新新旗新新200新新旗新新旗此选项使输出更容易阅读,尤其是当有很多有效载荷时。
--lifetime = <s>或-l <s>将IKE生存期设置为秒,默认= 28800。
RFC 2407默认为28800,但有一些实现可能需要不同的值。200新X- 200旗新新旗新新200新新旗新新200新200新新200新200新新200新新200新新200新新200新新200新新200新新200新新200新新200新新200新新86400,则属性将使用4字节值。如果您将其指定为十六进制数字,例如0xFF,那么该属性将使用适当的大小值(这个例子是一个字节)。新评新新新旗新新新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗属性将被添加。您可以多次使用此选项用--trans选项来产生多个变换有效载荷具有不同的寿命。每个--trans选项将使用先前指定的生命周期值。
--lifesize = <s>或-z <s>将IKE生活设置为千字节,默认= 0。
200新X- 200旗新新旗新新200新新旗新新200新200新新200新200新新200新新200新新200新新200新新200新新200新新200新新200新新200新新200新新86400,则属性将使用4字节值。如果您将其指定为十六进制数字,例如0xFF,那么该属性将使用适当的大小值(这个例子是一个字节)。您可以多次使用此选项用--trans选项来产生多个变换有效载荷具有不同的寿命。每个--trans选项将使用之前指定的lifesize值。
--auth = <n>或-m <n>设置身份验证。方法为<n>,default = 1(PSK)。
RFC定义的值为1到5.请参见RFC 2409附录A.检查点混合模式为64221。GSS(Windows“Kerberos”)为65001。XAUTH使用65001到65010。这不适用于IKEv2。
--version或-V显示程序版本并退出。
--vendor = <v>或-e <v>将供应商ID字符串设置为十六进制值<v>。
你可以更多地使用这个选项
例1:单个主机运行IKE检测。不会进行退避指纹识别,并且所有选项(超时,重试,变换集等)将是默认选项。
ike-scan ip
例2:从文件“ hostlist.txt”中读取目标主机。
ike-scan --file=hostlist.txt
例3:从标准输入中读取主机,并执行IKE检测和退避指纹识别。退避等待时间指定为20秒。
cat hostlist.txt | ike-scan --file=- --showbackoff=20
例4:这将对172.16.0.0/16指定的网络中的所有主机(包括网络和广播地址)运行ike-scan。在这种情况下,这将导致总共扫描65536台主机-从172.16.0.0到172.16.255.255(含)。
ike-scan 172.16.0.0/16
4、legion(root)
Legion是SECFORCE的Sparta的分支,是一个开源,易于使用,超扩展和半自动化的网络渗透测试框架,针对发现,侦察和利用漏洞的信息系统。
选择目标
下图中填写的目标可为ip、可为网段、也可为域。
查看信息
5、p0f
p0f是一款百分之百的被动whois反查工具。该工具通过分析目标主机发出的数据包,对主机上的操作系统进行鉴别。同时p0f在网络分析方面功能强大,可以用它来分析NAT、负载均衡、应用代理等。p0f是万能的被动操作系统指纹工具。p0f对于网络攻击非常有用,它利用SYN数据包实现操作系统被动检测技术,能够正确地识别目标系统类型。和其他扫描软件不同,它不向目标系统发送任何的数据,只是被动地接受来自目标系统的数据进行分析。因此,一个很大的优点是:几乎无法被检测到,而且p0f是专门系统识别工具,其指纹数据库非常详尽,更新也比较快,特别适合于安装在网关中。
用法: p0f [ …选项… ] [ ‘过滤规则’ ]
网络接口选项:
-i iface - 指定监听的网络接口
-r file - 读取由抓包工具抓到的网络数据包文件
-p - 设置 -i参数 指定的网卡 为混杂模式
-L - 列出所有可用接口
操作模式和输出设置:
-f file - 指定指纹数据库 (p0f.fp) 路径,不指定则使用默认数据库。(默认:/etc/p0f/p0f.fp)
-o file - 将信息写入指定的日志文件中。只有同一网卡的log文件才可以附加合并到本次监听中来。
-s name - 回答 unix socket 的查询 API
-u user - 以指定用户身份运行程序,工作目录会切换到到当前用户根目录下;
-d - 以后台进程方式运行p0f ,需要配合-0或者-s选项
性能相关的选项:
-S limit - 设置API并发数,默认为20,上限为100;
-t c,h - 设置连接超时时间 (30s,120m)
-m c,h - 设置最大网络连接数(connect)和同时追踪的主机数(host)(默认值: c = 1,000, h = 10,000)
例1: 在混杂模式下使用接口 eth0,将结果保存到文件
p0f -i eth0 -p -o /tmp/p0f.log
示例:在终端输入 p0f 然后回车,就可进行监听。然后浏览器打开 www.baidu.com即可,,就可以监听与百度的网络连接。也可通过其他方式。
6、recon-ng
recon-ng是一款强大的信息收集工具,特别是在收集子域名以及解析子域名的IP地址时,十分方便。
导入模块需科学上网推荐
https://www.cnblogs.com/arrdres/p/17019905.htmlhttps://www.cnblogs.com/arrdres/p/17019905.html
参数:
back Exits the current context 返回上一级
dashboard Displays a summary of activity 显示活动的总结
db Interfaces with the workspace's database 工作区的数据库页面
exit Exits the framework 退出recon-ng
help Displays this menu 帮助信息
index Creates a module index (dev only) 创造一个模块
keys Manages third party resource credentials 管理第三方的api接口
marketplace Interfaces with the module marketplace 模块应用市场
modules Interfaces with installed modules 已经安装的模块
options Manages the current context options 管理当前文本的选项
pdb Starts a Python Debugger session (dev only) 打开python进行调试
script Records and executes command scripts 记录并执行命令脚本
shell Executes shell commands 执行操作系统命令
show Shows various framework items 显示各种框架的条目
snapshots Manages workspace snapshots 管理一个快照
spool Spools output to a file 将结果输出到一个文件里
workspaces Manages workspaces 工作区
模块命令
modules load 加载某个模块
modules reload 退出某个模块
modules search 搜索某个模块
创建工作区
workspaces add baidu # 创建工作区
搜索并设置搜索引擎(baidu模块已经下架,这里我们选择bing)
modules search bing # 搜索bing相关模块modules load recon/domains-hosts/bing_domain_web # 使用bing作为搜索引擎
例1:搜索并设置子域名爆破模块(以baidu为例)
modules search brute # 搜索暴力破解相关模块
modules load recon/domains-hosts/brute_hosts # 使用暴力破解主机域名模块
info # 查看配置信息
options set SOURCE baidu.com # 设置域名
options set WORDLIST /usr/share/recon-ng/xxx/xxx.txt # 这里可以设置字典,暂时我们使用默认的就好。
run #执行
例2:搜索并设置解析模块(将主机解析成IP地址)
modules search resolve # 搜索解析模块
modules load recon/hosts-hosts/resolve # 使用解析模块
info # 查看解析模块信息
options set SOURCE query select host from hosts where host like '%baidu%' # 设置解析模块限定条件
run #执行
例3:进入报告模块、设置报告格式、创建人、用户名、文件保存位置并生成报告
modules search report # 搜索报告模块
modules load reporting/html # 使用HTML报告格式
info # 查看HTML报告模块信息
options set CREATOR akali # 设置报告创建人
options set CUSTOMER baidu # 设置用户名称
options set FILENAME /root/.recon-ng/workspaces/baidu/BaiduIpResults.html # 设置报告名称及输出路径
run # 运行