forked from fnmsd/awvs_script_decode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoomla_2.script
More file actions
59 lines (53 loc) · 1.71 KB
/
Copy pathjoomla_2.script
File metadata and controls
59 lines (53 loc) · 1.71 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
57
58
59
#include helpers.inc;
#include string_helpers.inc;
// **************************************************************************************
function alert(http, path, vxml, details) {
var ri = new TReportItem();
ri.LoadFromFile(vxml);
ri.affects = path;
ri.alertPath = "Scripts/" + vxml;
ri.details = details;
ri.setHttpInfo(http);
AddReportItem(ri);
}
// **************************************************************************************
function test_Joomla_JCE_attack(dir, path){
if (!path.endsWith('/')) path = path + '/';
var http = new THTTPJob();
http.url = dir.url;
http.uri = path + 'index.php?option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&version=1576&cid=20';
http.verb = 'GET';
http.execute();
if (!http.wasError && http.responseStatus == 200){
var m = /\s:\s([\d\.]+)<\/title>/.exec(http.response.body);
if (m && m[1]) {
var versionStr = m[1].replace(".", "").replace(".", "").replace(".", "").replace(".", "").replace(".", "")
var version = parseInt(versionStr);
var vulnerable = false;
if (versionStr) {
// version 1.x
if (versionStr.startsWith("1")) {
if (version <= 1579) {
vulnerable = true;
}
}
else
// version 2.x
if (versionStr.startsWith("2")) {
if (version <= 2010) {
vulnerable = true;
}
}
//trace(version);
if (vulnerable) {
//trace('vuln');
vxml = "Joomla_JCE_file_upload.xml";
details = "Current JCE version [bold][dark]" + m[1] + "[/dark][/bold]."
alert(http, path, vxml, details);
}
}
}
}
}
var dir = getCurrentDirectory();
test_Joomla_JCE_attack(dir, dir.fullPath);