forked from fnmsd/awvs_script_decode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsymphony.script
More file actions
56 lines (49 loc) · 1.82 KB
/
Copy pathsymphony.script
File metadata and controls
56 lines (49 loc) · 1.82 KB
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
#include helpers.inc;
#include reporting_helpers.inc;
#include string_helpers.inc;
// **************************************************************************************
function alert(uri, vxml, job, matchedText)
{
var ri = new TReportItem();
ri.LoadFromFile(vxml);
ri.affects = uri;
ri.alertPath = "Scripts/" + vxml;
ri.setHttpInfo(job);
if (matchedText)
ri.Details = "Installed version: [blue]" + matchedText + "[/blue]";
AddReportItem(ri);
}
// **************************************************************************************
function checkVersion(dir, path){
if (!path.endsWith('/')) path = path + '/';
var http = new THTTPJob();
http.url = dir.url;
http.verb = 'GET';
http.uri = path + 'README.markdown';
http.execute();
if ((!http.wasError && http.response.body.indexOf("# Symphony 2") != -1)){
var regex = /- Version:\s([\d\.]+)/i;
var result = [];
var e;
while (e = regex.exec(http.response.body))
if (e && e[1])
{
var found = false;
versionStr = e[1];
version = parseInt(e[1].replace(".", "").replace(".", "").replace(".", ""));
if (version <= 231) {
alert(path, "symphony_231_sql_injection.xml", http, versionStr);
found = true;
}
if (found) break;
};
}
}
var dir = getCurrentDirectory();
var alreadyReportedWebApplication = getGlobalValue("detectedAppSymphony");
if (!alreadyReportedWebApplication)
{
setGlobalValue("detectedAppSymphony", 1, true);
KBase("Symphony web application", "Symphony web application was detected in directory [dark][bold]" + dir.fullPath + "[/bold][/dark].");
}
checkVersion(dir, dir.fullPath);