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

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

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

关于WriteHat

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

功能介绍

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

动态拖放报告生成器;

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

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

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

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

能够克隆和模板化报告;

搜索结果数据库;

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

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

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

LDAP集成;

安装要求

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

$sudoaptinstalldocker.iodocker-compose

部署WriteHat

方法一(仅供测试)

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

$gitclonehttps://github.com/blacklanternsecurity/writehat&&cdwritehat&&docker-composeup

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

方法二

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

$cd/opt$gitclonehttps://github.com/blacklanternsecurity/writehat$cdwritehat

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

MongoDB

MySQL

Django

管理员用户

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

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

writehat.crtwritehat.key

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

$docker-composeup--build

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

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

$sudocpwritehat/config/writehat.service/etc/systemd/system/$sudosystemctlenablewritehat--now

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

$sudojournalctl-xefuwritehat.service

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

#Entertheappcontainer$docker-composeexecwritehatbash#Promotetheuserandexit$./manage.pyldap_promote<ldap_username>$exit

如何编写自定义报告组件

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

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

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

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

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

components/CustomComponent.py

from.baseimport*classCustomComponentForm(ComponentForm):summary=forms.CharField(label='ComponentText',widget=forms.Textarea,max_length=50000,required=False)field_order=['name','summary','pageBreakBefore','showTitle']classComponent(BaseComponent):default_name='CustomReportComponent'formClass=CustomComponentForm#the"templatable"attributedecideswhetherornotthatfield#getssa*vedifthereportiseverconvertedintoatemplatefieldList={'summary':StringField(markdown=True,templatable=True),}#makesuretospecifytheHTMLtemplatehtmlTemplate='componentTemplates/CustomComponent.html'#FontAwesomeicontype+color(HTML/CSS)#ThisisjusteyecandyinthewebappiconType='fasfa-stream'iconColor='var(--blue)'#the"preprocess"functionisexecutedwhenthereportisrendered#usethistoperformanylast-minuteoperationsonitsdatadefpreprocess(self,context):#forexample,touppercasetheentire"summary"field:#context['summary']=context['summary'].upper()returncontext

componentTemplates/CustomComponent.html

{%loadcustom_tags%}<sectionclass="l{{level}}component{%ifpageBreakBefore%}page-break{%endif%}"id="container_{{id}}">{%include'componentTemplates/Heading.html'%}<divclass='markdown-align-justifycustom-component-summary'><p>{%markdownsummary%}</p></div></section>

componentTemplates/CustomComponent.css

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

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

$docker-composerestartwritehat

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

发布于 2021-12-23 21:14:41
收藏
分享
海报
0 条评论
45
上一篇:如何在kali Linux上创建一个用于隐藏文件的加密容器 下一篇:如何把企业的云上日志采集到本地SIEM
目录

    0 条评论

    本站已关闭游客评论,请登录或者注册后再评论吧~

    忘记密码?

    图形验证码