forked from fnmsd/awvs_script_decode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrupal_1.script
More file actions
49 lines (47 loc) · 1.73 KB
/
Copy pathdrupal_1.script
File metadata and controls
49 lines (47 loc) · 1.73 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
// **************************************************************************************
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 = "Pattern found: [pre][blue]" + matchedText + "[/blue][/pre]";
AddReportItem(ri);
}
// **************************************************************************************
function ExploitDrupal7InstallerVuln(dir) {
var worker = getHTTPWorker();
var payloads = new TList();
for (var j=1;j<=10;j++) {
var http = new THTTPJob();
http.url = dir.url;
http.verb = 'POST';
http.uri = dir.fullPath + '/install.php';
http.connectionKeepAlive = false;
payloads.add(http);
}
worker.executeRequests(payloads);
for (var j=0; j<payloads.count; j++) {
if (!payloads.item(j).wasError) {
var job = payloads.item(j);
if (job && job.response.body.indexOf(matchString) != -1) {
// got it
alert(http.uri, "drupal_7_installer_vuln.xml", job, matchString);
return true;
}
if (job && job.response.body.indexOf("Drupal already installed") == -1) {
// invalid response - we should receive "Drupal already installed" in the response.
// don't continue (install.php was deleted or the application is not really Drupal).
return true;
}
}
}
return false;
}
var matchString = "Select an installation profile";
var dir = getCurrentDirectory();
// try to exploit Drupal 7 installer vulnerability
for (var i=1; i<=10; i++)
if (ExploitDrupal7InstallerVuln(dir)) break;