首页 网络安全 网站防护 查看内容

H2T:一款扫描网站安全并给出安全实践建议的工具

2019-4-9 00:59 |来自: 互联网 1491 0

摘要: 今天给大家介绍的是一款名叫h2t的开源工具,广大研究人员可以利用这款工具来对目标站点进行安全扫描,并获取专业的安全实践建议。虽然h2t的使用非常简单,但它能够很大程度地帮助系统管理员提升网站的安全性。目前,h2t可以检测网站的header,并给出安全实践建议。依赖组件Python 3coloramarequests工 ...
关键词: headers PRINT header list scan 建议 h2t 安全 IGNORE arguments

今天给大家介绍的是一款名叫h2t的开源工具,广大研究人员可以利用这款工具来对目标站点进行安全扫描,并获取专业的安全实践建议。

虽然h2t的使用非常简单,但它能够很大程度地帮助系统管理员提升网站的安全性。目前,h2t可以检测网站的header,并给出安全实践建议。

依赖组件

Python 3

colorama

requests

工具安装

$ git clone https://github.com/gildasio/h2t
$ cd h2t
$ pip install -r requirements.txt
$ ./h2t.py –h

工具使用

h2t提供下列两种操作子命令:list和scan。

$./h2t.py -h
usage:h2t.py [-h] {list,l,scan,s} ...
 
h2t -HTTP Hardening Tool
 
positional arguments:
 {list,l,scan,s} sub-command help
 list (l) show a list of available headers in h2tcatalog (that can
 be used in scan subcommand-H option)
 scan (s) scan url to hardening headers
 
optional arguments:
 -h, --help show this help message and exit

List子命令

List子命令可以列举出h2t中所有支持的header,并提供相关的描述信息以及安全实践操作建议:

$./h2t.py list -h
usage:h2t.py list [-h] [-p PRINT [PRINT ...]] [-B]
 [-a | -H HEADERS [HEADERS...]]
 
optional arguments:
 -h, --help show this help message and exit
 -p PRINT [PRINT ...], --print PRINT [PRINT...]
 a list of additionalinformation about the headers to
 print. For now thereare two options: description and
 refs (you can useeither or both)
 -B, --no-banner dont print the h2t banner
 -a, --all list all available headers[default]
 -H HEADERS [HEADERS ...], --headers HEADERS[HEADERS ...]
 a list of headers to look for in theh2t catalog

Scan子命令

Scan子命令可以对目标站点进行安全扫描,并收集网站header:

$./h2t.py scan -h
usage:h2t.py scan [-h] [-v] [-a] [-g] [-b] [-H HEADERS [HEADERS ...]]
 [-p PRINT [PRINT ...]]
 [-i IGNORE_HEADERS[IGNORE_HEADERS ...]] [-B] [-E] [-n]
 [-u USER_AGENT] [-r | -s]
 url
 
positional arguments:
 url url to look for
 
optional arguments:
 -h, --help show this help message and exit
 -v, --verbose increase output verbosity: -v printresponse headers,
 -vv print response andrequest headers
 -a, --all scan all cataloged headers[default]
 -g, --good scan good headers only
 -b, --bad scan bad headers only
 -H HEADERS [HEADERS ...], --headers HEADERS[HEADERS ...]
 scan only these headers (see available inlist sub-
 command)
 -p PRINT [PRINT ...], --print PRINT [PRINT...]
 a list of additionalinformation about the headers to
 print. For now thereare two options: description and
 refs (you can useeither or both)
 -i IGNORE_HEADERS [IGNORE_HEADERS ...],--ignore-headers IGNORE_HEADERS [IGNORE_HEADERS ...]
 a list of headers toignore in the results
 -B, --no-banner dont print the h2t banner
 -E, --no-explanation dont print the h2t output explanation
 -o {normal,csv,json}, --output{normal,csv,json}
 choose which outputformat to use (available: normal,
 csv, json)
 -n, --no-redirect dont follow http redirects
 -u USER_AGENT, --user-agent USER_AGENT
 set user agent to scanrequest
 -k, --insecure dont verify SSL certificate as valid
 -r, --recommendation output only recommendations [default]
 -s, --status output actual status (eg: existentheaders only)

结果输出

目前,该工具只有“普通模式”这一种数据输出模式:

[+] 红色header为存在安全隐患的header,这些header可能会让你的网站陷入安全风险,或泄露某些敏感数据,我们建议大家修复这些问题。

[+] 黄色header为正常的header,代表网站没有使用到的header,我们建议大家使用这些header。

[-] 绿色header为正常的header,代表你网站已经在使用的header。

使用样例

建议采用Cookie HTTP Only

建议采用Cookie over SSL/TLS

建议移除Server header

建议采用Referrer-Policy

已使用X-Frame-Options,无需额外操作

已使用X-XSS-Protection,无需额外操作

运行截图

List h2t分类:

从文件获取扫描路径:

扫描url:

Verbose模式扫描:

Header信息:

项目地址

H2T:https://github.com/gildasio/h2t

* 参考来源:gildasio,FB小编Alpha_h4ck编译,转载自FreeBuf.COM

本文出处: https://www.toutiao.com/a6677376433465065997/
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部