将 HTML 字符串转换为报告 Nessus 安全扫描程序的 HTML 页
Conversion of HTML string to HTML page of report Nessus security scanner
当我 运行 这个命令时,我得到一个 HTML 字符串:
report = client['SoftLayer_Network_Security_Scanner_Request'].getReport(id=19133434)
我使用 Python 将此数据写入 .html
文件。但是,当我通过浏览器打开文件时,某些 HTML 功能不可用。有人可以帮我解决这个问题吗?
Html代码
u'<html xmlns="w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><title>Nessus Scan Report</title><style type="text/css" media="all">\n\tUL.ulist {padding: 0 10px; line-height:25px; margin-bottom:0px; margin-top:0px;};\n\tLI.list {padding: 0 10px; line-height:25px; margin-bottom:0px; margin-top:0px; list-style: disc;}\n\tLI.list0 {padding: 0 10px; line-height:25px; margin-bottom:0px; margin-top:0px; list-style: disc; color:#357abd;}\n\tLI.list1 {padding: 0 10px; line-height:25px; margin-bottom:0px; margin-top:0px; l .....</html>
试试这个脚本:
"""
Get Report
Get the vulnerability report for a scan request.
Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Security_Scanner_Request/getReport
License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <sldn@softlayer.com>
"""
import webbrowser
import SoftLayer
# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'
# define the file's name
file = 'report.html'
# Create client
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
requestService = client['SoftLayer_Network_Security_Scanner_Request']
f = open(file, 'w')
try:
report = requestService.getReport(id=19133434)
f.write(report)
f.close()
webbrowser.open_new_tab(file)
except SoftLayer.SoftLayerAPIError as e:
print("Unable to get report. faultCode=%s, faultString=%s" % (e.faultCode, e.faultString))
让我知道你的结果,或者如果你仍然有问题
参考文献:
当我 运行 这个命令时,我得到一个 HTML 字符串:
report = client['SoftLayer_Network_Security_Scanner_Request'].getReport(id=19133434)
我使用 Python 将此数据写入 .html
文件。但是,当我通过浏览器打开文件时,某些 HTML 功能不可用。有人可以帮我解决这个问题吗?
Html代码
u'<html xmlns="w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><title>Nessus Scan Report</title><style type="text/css" media="all">\n\tUL.ulist {padding: 0 10px; line-height:25px; margin-bottom:0px; margin-top:0px;};\n\tLI.list {padding: 0 10px; line-height:25px; margin-bottom:0px; margin-top:0px; list-style: disc;}\n\tLI.list0 {padding: 0 10px; line-height:25px; margin-bottom:0px; margin-top:0px; list-style: disc; color:#357abd;}\n\tLI.list1 {padding: 0 10px; line-height:25px; margin-bottom:0px; margin-top:0px; l .....</html>
试试这个脚本:
"""
Get Report
Get the vulnerability report for a scan request.
Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Security_Scanner_Request/getReport
License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <sldn@softlayer.com>
"""
import webbrowser
import SoftLayer
# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'
# define the file's name
file = 'report.html'
# Create client
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
requestService = client['SoftLayer_Network_Security_Scanner_Request']
f = open(file, 'w')
try:
report = requestService.getReport(id=19133434)
f.write(report)
f.close()
webbrowser.open_new_tab(file)
except SoftLayer.SoftLayerAPIError as e:
print("Unable to get report. faultCode=%s, faultString=%s" % (e.faultCode, e.faultString))
让我知道你的结果,或者如果你仍然有问题
参考文献: