千家信息网

如何使用WriteHat生成渗透测试报告

发表于:2026-10-31 作者:千家信息网编辑
千家信息网最后更新 2026年10月31日,本篇文章给大家分享的是有关如何使用WriteHat生成渗透测试报告,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。关于WriteHatWr
千家信息网最后更新 2026年10月31日如何使用WriteHat生成渗透测试报告

本篇文章给大家分享的是有关如何使用WriteHat生成渗透测试报告,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

关于WriteHat

WriteHat是一款功能强大的渗透测试报告工具,在该工具的帮助下,广大研究人员可以轻松生成渗透测试报告,从此不必再将大量的时间放在Microsoft Word等文字编辑工具身上了。从Markdown到HTML,再到PDF,应有尽有。这款工具由渗透测试人员开发,专为渗透测试人员设计,但是我们也可以用它来生成任意类型的报告。该工具基于Python 3开发,由Django驱动。

功能介绍

轻松生成漂亮美观的渗透测试报告;

动态拖放报告生成器;

Markdown支持,包括代码块和图标等等;

剪贴、注释、标题和上传图像支持;

可自定义报告背景/页脚;

为各个报告部分分配操作人员和跟踪状态;

能够克隆和模板化报告;

搜索结果数据库;

支持多种评分类型(CVSS 3.1,DARED);

可以从同一组分析结果轻松生成多个报告;

可扩展的设计使高级用户能够创建高度定制的报告部分;

LDAP集成;

安装要求

该工具的使用要求本地主机安装Docker和Docker Compose。我们可以使用apt、pacman和dnf等工具来安装依赖组件:

$ sudo apt install docker.io docker-compose

部署WriteHat

方法一(仅供测试)

WriteHat可以使用下列一行命令轻松完成部署安装:

$ git clone https://github.com/blacklanternsecurity/writehat && cd writehat && docker-compose up

接下来,在浏览器中访问https://127.0.0.1即可使用WriteHat,默认用户名和密码为"admin / PLEASECHANGETHISFORHEA*VENSSAKE"。

方法二

首先,我们还是需要安装Docker和Docker Compose。接下来,在/opt目录中使用下列命令将该项目源码克隆至本地:

$ cd /opt$ git clone https://github.com/blacklanternsecurity/writehat$ cd writehat

接下来,在writehat/config/writehat.conf文件中创建安全保护密码,密码将用于:

MongoDB

MySQL

Django

管理员用户

添加我们的目标主机名,在writehat/config/writehat.conf文件中的allowed_hosts字段中设置。

设置完成后,在nginx/中替换自签名的SSL证书:

writehat.crtwritehat.key

现在,我们就可以使用下列命令测试工具是否配置正确:

$ docker-compose up --build

注意,如果使用了VPN,你则需要在首次使用docker-compose运行服务之前断开VPN连接,这样才能保证Docker能够正确创建虚拟网络。

现在,我们就需要安装并激活Systemd服务了,配置后WriteHat将会在设备启动时自动运行:

$ sudo cp writehat/config/writehat.service /etc/systemd/system/$ sudo systemctl enable writehat --now

我们可以使用下列命令跟踪服务日志:

$ sudo journalctl -xefu writehat.service

关于用户的创建,我们需要使用writehat/config/writehat.conf中定义的管理员凭证登录https://127.0.0.1/admin,因为有部分操作是只有管理员才能操作的,比如说数据库备份等等:

# Enter the app container$ docker-compose exec writehat bash # Promote the user and exit$ ./manage.py ldap_promote $ exit

如何编写自定义报告组件

每一个报告组件都有下列内容组成:

1、writehat/components/中的Python文件;

2、writehat/templates/componentTemplates/中的HTML模板;

3、writehat/static/css/component/中的CSS文件;

我们建议大家直接引用这些目录下的已有文件,如果想要自定义开发的话,请参考下列样例。

components/CustomComponent.py

from .base import * class CustomComponentForm(ComponentForm):     summary = forms.CharField(label='Component Text', widget=forms.Textarea, max_length=50000, required=False)    field_order = ['name', 'summary', 'pageBreakBefore', 'showTitle']  class Component(BaseComponent):     default_name = 'Custom Report Component'    formClass = CustomComponentForm     # the "templatable" attribute decides whether or not that field    # gets sa*ved if the report is ever converted into a template    fieldList = {        'summary': StringField(markdown=True, templatable=True),    }     # make sure to specify the HTML template    htmlTemplate = 'componentTemplates/CustomComponent.html'     # Font Awesome icon type + color (HTML/CSS)    # This is just eye candy in the web app    iconType = 'fas fa-stream'    iconColor = 'var(--blue)'     # the "preprocess" function is executed when the report is rendered    # use this to perform any last-minute operations on its data    def preprocess(self, context):         # for example, to uppercase the entire "summary" field:        #   context['summary'] = context['summary'].upper()        return context

componentTemplates/CustomComponent.html

{% load custom_tags %}
{% include 'componentTemplates/Heading.html' %}

{% markdown summary %}

componentTemplates/CustomComponent.css

div.custom-component-summary {    font-weight: bold;}

配置完成后,别忘了使用下列命令重启WriteHat服务:

$ docker-compose restart writehat

以上就是如何使用WriteHat生成渗透测试报告,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注行业资讯频道。

报告 测试 工具 生成 命令 文件 人员 用户 部分 服务 接下来 密码 管理员 组件 开发 支持 管理 配置 主机 功能 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网的科技 科技互联网政务服务 互联网前沿科技 互联网科技公司做什么 盛创互联网科技有限公司 科技大学互联网专业好不好 恒银科技与互联网金融 互联网时代科技改变生活 呼和浩特新华互联网科技学院 元气玛特互联网科技公司是外包吗 江苏苏星互联网科技有限公司 杭州披云加互联网科技有限公司 互联网科技包装股份有限公司上市 南京一网一红互联网科技有限公司 互联网界的黑科技 云南互联网科技学费 互联网科技博主张洲 互联网科技大会大佬 瑞安市蟠桃会互联网科技有限公司 恒生科技互联网指数十大成分股 互联网属科技 网络科技有限互联网 互联网科技公司官网 亿人帮互联网科技 阿里巴巴算科技企业还是互联网 宝灵互联网科技有限公司 威龙国际互联网科技公司 江苏互联网科技小贷 上海同邻互联网科技有限公司规模 科技和互联网行业的特点
0