如何卷曲此HTML表单?

时间:2019-12-26 23:13:21

标签: curl

我正在尝试将登录过程自动化到我的球型WLAN中。登录表单如下:

<form method="post" action="https://10.70.70.70/user/user_login_auth.jsp">
    <input align="center" type="text" name="username" placeholder="Username" id="username"  maxLength="256" AUTOCOMPLETE=OFF />
    <input align="center" type="password" name="password" placeholder="Password" id="password"  maxLength="64" AUTOCOMPLETE=OFF />
    <input type="hidden" name="email" id="email" />
    <input type="hidden" name="user" id="user" />
    <input type="hidden" name="ssid" id="ssid" />
    <input type="submit" class="submit" name="ok" value="Log In" />
</form>

我只需要在浏览器中输入我的用户名和密码。以下是我的初步尝试,但似乎无效。任何提示将不胜感激。

curl -X POST -F 'username=test' -F 'password=test' -k https://10.70.70.70/user/user_login_auth.jsp

更新:我添加了最小的HTML表单。每当我尝试卷曲服务器时,它只会返回登录页面。我假设我必须包含一些标头,然后尝试找出Chrome浏览器请求监控中请求的外观。

1 个答案:

答案 0 :(得分:0)

尝试一下:

curl -k -d 'username=test&password=test' -b /tmp/c -c /tmp/c https://10.70.70.70/user/user_login_auth.jsp
curl -k -b /tmp/c -c /tmp/c https://10.70.70.70/user