Jump to content

Recommended Posts

What line did it occur on, and what is that line?

 

 

A fairly common way for an attack to try to gain a full system path through an error message is to use a GET/POST/Cookie key of name[] to try to cause your script to error.

 

 

For example:

 

<?php

 

$name = (isset($_GET['name'])) ? $_GET['name'] : '';

$name = trim($name);

 

?>

 

Would give an error if someone went to script.php?name[]=blah

 

Since that would set $name to an array and then pass it to trim(), which does not accept an array.

I don't allow any get methods other than logging out at the moment.

 

This is what my error log reads

582 Time: 15 Nov 09 - 6:12:39 PM (PST) 
583 File: /var/www/root.php 
584 Line: 240 
585 Code: E_NOTICE 
586 Message: Array to string conversion 
587 IP: took it out
################################################## 

 

That line is the line that strips slashes.

if (get_magic_quotes_gpc()){  
$_GET = array_map('stripslashes', $_GET);  
$_POST = array_map('stripslashes', $_POST);  
$_COOKIE = array_map('stripslashes', $_COOKIE);  
}

Either $_GET, $_POST or $_COOKIE contains an array. Probably someone who tried to do stuff like ?foo[]=bar or whatever to see if he could generate an error.

 

See this:

php > var_dump(array_map('stripslashes', array(array())));

Notice: Array to string conversion in php shell code on line 1

Call Stack:
   60.0963     115064   1. {main}() php shell code:0
   60.0964     116000   2. array_map() php shell code:1

array(1) {
  [0]=>
  string(5) "Array"
}

So in this case the error that was triggered was done by a user attempting to inject code, or create an error.  What was this user trying to accomplish exactly?  Thanks for the information thus far by the way.

 

Most of the time it is just people probing seeing if they can get something to work to exploit your code, what they were trying to accomplish we have no clue...you will have to track down the user by the IP and ask them in person or lookup adding an array to get data and see what type of exploits come out of it.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.