forked from R3dFruitRollUp/aggressor_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.cna
More file actions
36 lines (28 loc) · 712 Bytes
/
web.cna
File metadata and controls
36 lines (28 loc) · 712 Bytes
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
# web.cna
$template = "";
sub loadTemplate {
$handle = openf(script_resource("test.html"));
@array = readAll($handle);
closef($handle);
foreach $line (@array) {
println($line);
$template .= $line . "\n";
}
println("Loaded template.");
}
sub hostPage {
$page = $template;
%replace = %(
TEST => "Whee!",
asdf => "Bleh"
);
foreach $key (keys(%replace)) {
$value = %replace["$key"];
println("Replacing $key with $value");
$page = replace($page, "##$key\#\#", $value);
}
site_kill(80, "/test");
site_host(localip(), 80, "/test", $page, "text/html", "Testing", false);
}
loadTemplate();
hostPage();