freeBuf
主站

分类

云安全 AI安全 开发安全 终端安全 数据安全 Web安全 基础安全 企业安全 关基安全 移动安全 系统安全 其他安全

特色

热点 工具 漏洞 人物志 活动 安全招聘 攻防演练 政策法规

点我创作

试试在FreeBuf发布您的第一篇文章 让安全圈留下您的足迹
我知道了

官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序

FreeBuf+小程序

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

Htrace.sh:用于调试Http/Https请求的简单Shell脚本
secist 2018-08-19 15:00:24 421309

前言

htrace.sh是一个用于调试http/https流量跟踪,响应头和mixed-content(混合内容)和检查域名的简单shell脚本。它允许你验证域配置,并能为你发现配置中存在的错误(例如重定向循环)。此外,它还会为你显示有关ssl的基本配置信息(如果可用),并支持使用Nmap脚本执行安全扫描,以及其它一些外部安全工具,例如Ssllabs和Mozilla Observatory等。

htrace.sh示意图

特性

检查域配置(Web服务器/反向代理);

重定向分析,例如消除重定向循环;

检查每个请求的响应头;

检查基本的ssl配置:确认证书(date,cn,san)以及验证ssl连接;

为混合内容扫描域;

使用Nmap NSE库扫描域;

使用外部安全工具扫描域:Mozilla Observatory和SSL Labs API。

使用方法

# Clone this repository
git clone https://github.com/trimstray/htrace.sh

# Go into the repository
cd htrace.sh

# Install
./setup.sh install

# Run the app
htrace.sh --domain https://google.com

外部工具

htrace.sh支持用于安全扫描的外部工具:

Mozilla Observatory - 网站安全分析工具,旨在鼓励开发者和系统管理员增强自己网站的安全配置。使用参数:--format=report --rescan --zero --quiet

Ssllabs - HTTPS检测工具。使用参数:-quiet -grade

mixed-content-scan - 为Mixed Content检查启用https站点的CLI工具。使用参数:-user-agent \"$_user_agent\" --no-check-certificate

Nmap NSE Library - 使用Nmap提供自动安全扫描。

使用的脚本有:

http-auth-finder

http-chrono

http-cookie-flags

http-cors

http-cross-domain-policy

http-csrf

http-dombased-xss

http-git

http-grep

http-internal-ip-disclosure

http-jsonp-detection

http-malware-host

http-methods

http-passwd

http-phpself-xss

http-php-version

http-robots.txt

http-sitemap-generator

http-shellshock

http-stored-xss

http-unsafe-output-escaping

http-useragent-tester

http-vhosts

http-xssed

ssl-enum-ciphers

whois-ip

报告

如果你希望生成的报告格式为html,你可以使用ansi2html.sh脚本来实现。

htrace.sh -d https://nmap.org -s -h | ansi2html --bg=dark > report.html

Docker

配置被包含在build/Dockerfile文件中。

Build image

cd htrace.sh/build
docker build --rm -t htrace.sh -f Dockerfile 

Run container

docker run --rm -it --name htrace.sh htrace.sh -d http://nmap.org -h

安装环境

GNU/Linux(已在Debian和CentOS上进行测试)

Bash(测试的版本为4.4.19)

Curl(≥ 7.52.0)

OpenSSL

Mozilla Observatory

Ssllabs

mixed-content-scan

Nmap

参数

htrace.sh v1.0.6

Usage:
    htrace.sh <option|long-option>

  Examples:
    htrace.sh --domain https://example.com
    htrace.sh --domain https://example.com -s -h --scan ssllabs

  Options:
        --help                                显示帮助信息
        -d|--domain <domain_name>             设置域名
        -s|--ssl                              显示ssl 服务器/连接 参数
        -h|--headers                          显示响应头
        --scan <all|observatory|ssllabs>      使用外部安全工具扫描域
        --mixed-content                       为混合内容扫描网站
        --nse                                 使用nmap nse library扫描网站
        --user-agent <val>                    设置'User-Agent'头
        --max-redirects <num>                 设置最大重定向次数 (默认:10)
        --timeout <num>                       设置最大超时时间 (默认:15)

*参考来源:GitHub,FB小编 secist 编译,转载请注明来自FreeBuf.COM

# shell脚本
免责声明
1.一般免责声明:本文所提供的技术信息仅供参考,不构成任何专业建议。读者应根据自身情况谨慎使用且应遵守《中华人民共和国网络安全法》,作者及发布平台不对因使用本文信息而导致的任何直接或间接责任或损失负责。
2. 适用性声明:文中技术内容可能不适用于所有情况或系统,在实际应用前请充分测试和评估。若因使用不当造成的任何问题,相关方不承担责任。
3. 更新声明:技术发展迅速,文章内容可能存在滞后性。读者需自行判断信息的时效性,因依据过时内容产生的后果,作者及发布平台不承担责任。
本文为 secist 独立观点,未经授权禁止转载。
如需授权、对文章有疑问或需删除稿件,请联系 FreeBuf 客服小蜜蜂(微信:freebee1024)
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
secist LV.9
每个人的心中都有一个梦。。
  • 369 文章数
  • 267 关注者
ATTCK-PenTester-Book:根据ATT&CK知识体系编制的长达400页的渗透手册
2020-02-10
Sniffle: 蓝牙5和4.x LE嗅探器
2019-11-23
Docem:向docx odt pptx等文件中嵌入XXE或XSS Payload
2019-11-11
文章目录