My code here suppose to grab list of injection string from table:* injection_text*, column: injection_code and inject it at the tail of the URL's crawled by my program, the URL's crawled are stored table: pages_crawl. my program suppose to display the result of the injection. the purpose of this program is to test for SQL injection vulnerabilities. its my Final year project. currently it is not displaying any vulnerabilities but if i inject manually into the URL's the site is vulnerable. Can anyone help me fix this code? currently it is injecting the string but it is removing the interger value in the url,
for example :
id=26381&cat=srigossip become id'&cat'
i want it to append the injection string to the end of the URL without altering the URL
' is my injection string
Can anyone help me fix this code?
// prepare the url for the GET injection
$urls = parse_url($row_pages['link']);
parse_str($urls['query'], $query_string);
$get_inject = "";
if (!empty($query_string))
{
$i = 0;
foreach ($query_string as $var => $value)
{
$get_inject .= (($i==0) ? "?" : "&") . $var . "=" . $row_injection_text['injection_code'];
$i++;
}
}
$url_to_inject = $urls['scheme'] . "://" . $urls['host'] . $urls['path'];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url_to_inject . $get_inject,
CURLOPT_USERAGENT => 'Desktop Browser Test'
));
$response = curl_exec($curl);
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size);
$body = substr($response, $header_size);
curl_close($curl);
$result_injection = checkForm($body, 'error in your SQL') ? "0" : "1";