@@ -86,11 +86,36 @@ def _writer_footer(self):
86
86
self .html .addcontent ('<span class="text-muted">{0}</span>' .format (text ))
87
87
self .html .div .close ()
88
88
self .html .footer .close ()
89
+ self .html .addcontent ('<script type="text/javascript">'
90
+ 'function copyAll() {'
91
+ 'var targetValue = $("#all-target").val();'
92
+ 'navigator.clipboard.writeText(targetValue).then(function() {'
93
+ 'alert("复制成功");'
94
+ '}, function(err) {'
95
+ 'alert("复制失败");'
96
+ '});'
97
+ '}'
98
+ '</script>' )
99
+ self .html .addcontent ('<script type="text/javascript">'
100
+ 'function copySuc() {'
101
+ 'var targetValue = $("#suc-target").val();'
102
+ 'navigator.clipboard.writeText(targetValue).then(function() {'
103
+ 'alert("复制成功");'
104
+ '}, function(err) {'
105
+ 'alert("复制失败");'
106
+ '});'
107
+ '}'
108
+ '</script>' )
109
+
89
110
self .html .body .close ()
90
111
self .html .html .close ()
91
112
92
113
def write_results (self , results = None ):
93
114
if results :
115
+ self .html .addcontent ('<button onclick="copyAll()" class="btn btn-primary" '
116
+ 'style="margin-bottom: 10px">复制所有目标</button>' )
117
+ self .html .addcontent ('<button onclick="copySuc()" class="btn btn-success"'
118
+ ' style="margin-bottom: 10px">复制成功目标</button>' )
94
119
self .html .addcontent ('<table class="table table-striped table-bordered table-hover">'
95
120
'<thead class="thead-dark"><tr>'
96
121
'<th scope="col">Target</th>'
@@ -99,40 +124,59 @@ def write_results(self, results=None):
99
124
'<th scope="col">Component</th>'
100
125
'<th scope="col">Version</th>'
101
126
'<th scope="col">Status</th>'
127
+ '<th scope="col">Extra</th>'
102
128
'</tr></thead><tbody>'
103
129
)
104
- for result in results :
105
- content = (
106
- '<tr>'
107
- '<td><a href="{0}" target="_blank">{1}</a></td>'
108
- '<td>{2}</td>'
109
- '<td><a href="https://www.seebug.org/vuldb/ssvid-{3}" target="_blank">{4}</a></td>'
110
- '<td>{5}</td>'
111
- '<td>{6}</td>'
112
- '<td><span class="badge badge-success">{7}</span></td>'
113
- '</tr>'
114
- ) if result .status == 'success' else (
115
- '<tr>'
116
- '<td><a href="{0}" target="_blank">{1}</a></td>'
117
- '<td>{2}</td>'
118
- '<td><a href="https://www.seebug.org/vuldb/ssvid-{3}" target="_blank">{4}</a></td>'
119
- '<td>{5}</td>'
120
- '<td>{6}</td>'
121
- '<td><span class="badge badge-secondary">{7}</span></td>'
122
- '</tr>'
123
- )
130
+ all_target = []
131
+ suc_target = []
124
132
133
+ for result in results :
134
+ all_target .append (result .target )
135
+ if result .status == 'success' :
136
+ suc_target .append (result .target )
137
+ content = (
138
+ '<tr>'
139
+ '<td><a href="{0}" target="_blank">{1}</a></td>'
140
+ '<td>{2}</td>'
141
+ '<td><a href="https://www.seebug.org/vuldb/ssvid-{3}" target="_blank">{4}</a></td>'
142
+ '<td>{5}</td>'
143
+ '<td>{6}</td>'
144
+ '<td><span class="badge badge-success">{7}</span></td>'
145
+ '<td>{8}</td>'
146
+ '</tr>'
147
+ )
148
+ else :
149
+ content = (
150
+ '<tr>'
151
+ '<td><a href="{0}" target="_blank">{1}</a></td>'
152
+ '<td>{2}</td>'
153
+ '<td><a href="https://www.seebug.org/vuldb/ssvid-{3}" target="_blank">{4}</a></td>'
154
+ '<td>{5}</td>'
155
+ '<td>{6}</td>'
156
+ '<td><span class="badge badge-secondary">{7}</span></td>'
157
+ '<td>{8}</td>'
158
+ '</tr>'
159
+ )
160
+ result .result .get ('VerifyInfo' ).pop ('URL' )
161
+ extra_info = '/' .join ([item for item in result .result .get ('VerifyInfo' ).values ()])
125
162
self .html .addcontent (content .format (result .target ,
126
163
result .target ,
127
164
result .poc_name ,
128
165
result .vul_id ,
129
166
result .vul_id ,
130
167
result .app_name ,
131
168
result .app_version ,
132
- result .status )
169
+ result .status ,
170
+ extra_info )
133
171
)
134
172
135
173
self .html .addcontent ('</tbody></table>' )
174
+ self .html .addcontent ('<textarea id="all-target" style="display:none">{}</textarea>' .format (
175
+ '\n ' .join (all_target )
176
+ ))
177
+ self .html .addcontent ('<textarea id="suc-target" style="display:none">{}</textarea>' .format (
178
+ '\n ' .join (suc_target )
179
+ ))
136
180
137
181
def write_html (self , results = None ):
138
182
menus = {
0 commit comments