
h2t (HTTP Hardening Tool)는 웹사이트를 스캔하고 적용할 보안 헤더를 제안합니다.
h2t는 시스템 관리자가 웹사이트를 강화하는 데 도움을 주는 간단한 도구입니다.
현재 h2t는 웹사이트 헤더를 확인하고 개선 방법을 권장합니다.
$ git clone https://github.com/gildasio/h2t
$ cd h2t
$ pip install -r requirements.txt
$ ./h2t.py -h
... 또는 Docker 방식:
$ git clone https://github.com/gildasio/h2t
$ cd h2t
$ docker build -t h2t .
$ docker run --rm h2t -h
파일(예: ~/.bash_aliases)에 alias h2t='docker run --rm h2t'를 추가한 후 다음과 같이 실행할 수도 있습니다:
$ h2t -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 h2t catalog (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 하위 명령어는 h2t에 등록된 모든 헤더를 나열하며, 설명, 추가 정보 링크 및 방법에 대한 정보를 표시할 수 있습니다.
$ ./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 additional information about the headers to
print. For now there are two options: description and
refs (you can use either or both)
-B, --no-banner don't 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 the h2t catalog
scan 하위 명령어는 웹사이트를 스캔하여 헤더를 확인합니다.
$ ./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 print response headers,
-vv print response and request 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 in list sub-
command)
-p PRINT [PRINT ...], --print PRINT [PRINT ...]
a list of additional information about the headers to
print. For now there are two options: description and
refs (you can use either or both)
-i IGNORE_HEADERS [IGNORE_HEADERS ...], --ignore-headers IGNORE_HEADERS [IGNORE_HEADERS ...]
a list of headers to ignore in the results
-B, --no-banner don't print the h2t banner
-E, --no-explanation don't print the h2t output explanation
-o {normal,csv,json}, --output {normal,csv,json}
choose which output format to use (available: normal,
csv, json)
-n, --no-redirect don't follow http redirects
-u USER_AGENT, --user-agent USER_AGENT
set user agent to scan request
-k, --insecure don't verify SSL certificate as valid
-r, --recommendation output only recommendations [default]
-s, --status output actual status (eg: existent headers only)
현재 출력은 일반 모드만 지원합니다. 다음과 같이 이해하시면 됩니다:
-s 플래그를 사용할 때 표시됩니다.예시:






기여 지침은 CONTRIBUTING을 참조하세요.