-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.tp
248 lines (220 loc) · 7.69 KB
/
template.tp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
const (
htmlTemplate = `
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1.0"
/>
<base href="{{ .Target }}" target="_blank">
<title>FFUF Report - </title>
<!-- CSS -->
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
/>
<link
rel="stylesheet"
type="text/css"
href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.7.1/ace.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<script>
var latest_editor = null;
function render_content(id){
var ele = document.getElementById('modal_'+id)
var instance = M.Modal.getInstance(ele);
instance.open();
const obj_id = "object_"+id;
const object_content = document.getElementById("object_"+id);
const location = window.location.href;
const url = new URL(window.location.href)
var construct = url.protocol+"//"+window.location.hostname
const u = url.pathname;
const split = u.split("/");
split.pop();
const final_url = split.join("/");
construct = construct+final_url+"/"+id;
console.log(construct);
fetch(construct).then(res=>res.text()).then(f=>{
object_content.innerHTML = f;
})
}
String.prototype.toHtmlEntities = function() {
return this.replace(/./gm, function(s) {
// return "&#" + s.charCodeAt(0) + ";";
return (s.match(/[a-z0-9\s]+/i)) ? s : "&#" + s.charCodeAt(0) + ";";
});
};
function render_content1(id){
var ele = document.getElementById('modal1_'+id)
var instance = M.Modal.getInstance(ele);
instance.open();
const obj_id = "object1_"+id;
const object_content = document.getElementById("object1_"+id);
const location = window.location.href;
const url = new URL(window.location.href)
var construct = url.protocol+"//"+window.location.hostname
const u = url.pathname;
const split = u.split("/");
split.pop();
const final_url = split.join("/");
construct = construct+final_url+"/"+id;
console.log(construct);
fetch(construct).then(res=>res.text()).then(f=>{
if(latest_editor){
latest_editor.destroy();
}
object_content.innerHTML = f.toHtmlEntities();
var editor = ace.edit("object1_"+id);
latest_editor = editor;
editor.setTheme("ace/theme/monokai");
editor.session.setMode("ace/mode/html");
})
}
</script>
<nav>
<div class="nav-wrapper">
<a href="#" class="brand-logo">FFUF</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
</ul>
</div>
</nav>
<main class="section no-pad-bot" id="index-banner">
<div class="container">
<br /><br />
<h1 class="header center ">FFUF Report</h1>
<div class="row center">
<pre>{{ .CommandLine }}</pre>
<pre>{{ .Time }}</pre>
<table id="ffufreport">
<thead>
<div style="display:none">
|result_raw|StatusCode|Input|Position|ContentLength|ContentWords|ContentLines|
</div>
<tr>
<th>Status</th>
{{ range .Keys }} <th>{{ . }}</th>
{{ end }}
<th>URL</th>
<th>Redirect location</th>
<th>Position</th>
<th>Length</th>
<th>Words</th>
<th>Lines</th>
<th>Type</th>
<th>Duration</th>
<th>Render</th>
<th>View</th>
</tr>
</thead>
<tbody>
{{range $result := .Results}}
<div style="display:none">
|result_raw|{{ $result.StatusCode }}{{ range $keyword, $value := $result.Input }}|{{ $value | printf "%s" }}{{ end }}|{{ $result.Url }}|{{ $result.RedirectLocation }}|{{ $result.Position }}|{{ $result.ContentLength }}|{{ $result.ContentWords }}|{{ $result.ContentLines }}|{{ $result.ContentType }}|
</div>
<tr class="result-{{ $result.StatusCode }}" style="background-color: {{$result.HTMLColor}};">
<td><font color="black" class="status-code">{{ $result.StatusCode }}</font></td>
{{ range $keyword, $value := $result.Input }}
<td>{{ $value | printf "%s" }}</td>
{{ end }}
<td><a href="{{ $result.Url }}">{{ $result.Url }}</a></td>
<td><a href="{{ $result.RedirectLocation }}">{{ $result.RedirectLocation }}</a></td>
<td>{{ $result.Position }}</td>
<td>{{ $result.ContentLength }}</td>
<td>{{ $result.ContentWords }}</td>
<td>{{ $result.ContentLines }}</td>
<td>{{ $result.ContentType }}</td>
<td>{{ $result.Duration }}</td>
<td>
<!-- Modal Trigger -->
<a class="waves-effect waves-light btn modal-trigger" onclick="render_content('{{ $result.ResultFile }}')">Render</a>
<!-- Modal Structure -->
<div style="height:60%" id="modal_{{ $result.ResultFile }}" class="modal">
<div style="height:100%" class="modal-content">
<code id="object_{{ $result.ResultFile }}"
width="100%"
height="100%"
>
</code>
</div>
<div class="modal-footer">
</div>
</div></td>
<td>
<!-- Modal Trigger -->
<a class="waves-effect waves-light btn modal-trigger" onclick="render_content1('{{ $result.ResultFile }}')">View</a>
<!-- Modal Structure -->
<div style="height:60%" id="modal1_{{ $result.ResultFile }}" class="modal">
<div style="height:100%" class="modal-content">
<div class="popme" id="object1_{{ $result.ResultFile }}"
width="100%"
height="100%"
>
</div>
</div>
<div class="modal-footer">
</div>
</div></td>
</tr>
{{ end }}
</tbody>
</table>
</div>
<br /><br />
</div>
</main>
<!--JavaScript at end of body for optimized loading-->
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.modal');
var instances = M.Modal.init(elems, options);
});
// Or with jQuery
$(document).ready(function(){
$('.modal').modal();
});
$(document).ready(function() {
$('#ffufreport').DataTable(
{
"aLengthMenu": [
[250, 500, 1000, 2500, -1],
[250, 500, 1000, 2500, "All"]
]
}
)
$('select').formSelect();
});
</script>
<style>
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
main {
flex: 1 0 auto;
}
.popme {
position: absolute !important;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
</style>
</body>
</html>
`
)