日期:
来源:FreeBuf收集编辑:Alpha_h4ck
关于GSAN
功能介绍
1、从HTTPS网站的SSL证书中直接提取主题别名; 2、子域名提取/枚举; 3、支持使用文本文件或直接在终端窗口中以命令形式定义多个主机:端口; 4、CSV或JSON格式输出,方便导入到其他工具中; 5、支持筛选出与正在分析的域名所不匹配的域名; 6、支持与CRT.SH集成,因此可以从同一实体的证书中提取更多子域名; 7、适用于自签名证书;
工具安装
pip安装
$ pip install --user gsan
源码获取
git clone https://github.com/franccesco/getaltname.git
(向右滑动,查看更多)
工具使用
Usage: gsan [OPTIONS] COMMAND [ARGS]...
Get subdomain names from SSL Certificates.
Options:
--version 显示工具版本信息
--help 显示工具帮助信息和退出
Commands:
crtsh 从crt.sh获取域名信息
scan 根据输入参数或文本文件扫描指定域名,格式为:主机[:端口号]
(向右滑动,查看更多)
从CRT.SH获取子域名信息
$ gsan crtsh --help
Usage: gsan crtsh [OPTIONS] [DOMAINS]...
Get domains from crt.sh
Options:
-m, --match-domain Match domain name only.
-o, --output TEXT Output to path/filename.
-t, --timeout INTEGER Set timeout for CRT.SH
--help Show this message and exit.
$ gsan crtsh facebook.com
[+] Getting subdomains for facebook.com
[+] Getting subdomains for facebook.com
[+] Results:
FACEBOOK.COM
↳ newdev.facebook.com
↳ dewey.vip.facebook.com
↳ secure.trunkstable.facebook.com
↳ facebook.com
↳ secure.intern.facebook.com
-- SNIP --
↳ channel.facebook.com
↳ extools.facebook.com
↳ china--facebook.com
↳ adtools.facebook.com
↳ ak.facebook.com
(向右滑动,查看更多)
直接从SSL证书提取子域名信息
$ gsan scan --help
Usage: gsan scan [OPTIONS] [HOSTNAMES]...
Scan domains from input or a text file, format is HOST[:PORT].
e.g: gsan scan domain1.com domain2.com:port
You can also pass a text file instead, just replace the first domain
argument for a file. eg: gsan scan filename.txt
If no ports are defined, then gsan assumes the port 443 is available.
Options:
-o, --output TEXT Output to path/filename.
-m, --match-domain Match domain name only.
-c, --crtsh Include results from CRT.SH
-t, --timeout INTEGER Set timeout [default: 3]
--help Show this message and exit.
$ gsan scan facebook.com starbucks.com:443
[+] Getting subdomains for facebook.com
[+] Getting subdomains for starbucks.com
[+] Results:
FACEBOOK.COM
↳ facebook.com
↳ facebook.net
↳ fbcdn.net
↳ fbsbx.com
↳ m.facebook.com
↳ messenger.com
↳ xx.fbcdn.net
↳ xy.fbcdn.net
↳ xz.fbcdn.net
STARBUCKS.COM
↳ starbucks.com
↳ beta.starbucks.com
↳ app.starbucks.fr
↳ starbucks.fr
↳ app.starbucks.co.uk
↳ starbucks.ie
↳ app.starbucks.com
↳ fr.starbucks.ca
↳ preview.starbucks.com
↳ starbucks.ca
↳ app.starbucks.com.br
↳ app.starbucks.ie
↳ starbucks.com.br
↳ fr.app.starbucks.ca
↳ starbucks.de
↳ starbucks.co.uk
↳ app.starbucks.de
↳ app.starbucks.ca
(向右滑动,查看更多)
gsan scan hosts.txt -o subdomains.csv
[+] Getting subdomains for facebook.com
[+] Getting subdomains for starbucks.com
[+] Getting subdomains for fakedomain.com
[!] Unable to connect to host fakedomain.com
[+] Getting subdomains for amazon.com
FACEBOOK.COM
↳ facebook.com
↳ facebook.net
-- SNIP --
↳ xy.fbcdn.net
↳ xz.fbcdn.net
STARBUCKS.COM
↳ starbucks.com
↳ beta.starbucks.com
-- SNIP --
↳ app.starbucks.de
↳ app.starbucks.ca
AMAZON.COM
↳ amazon.co.uk
↳ uedata.amazon.co.uk
-- SNIP --
↳ bz.peg.a2z.com
↳ origin2-amazon.co.jp
[+] Contents dumped into CSV file: subdomains.csv