3/06/2008

curl 实现表单提交

curl -D "/client/GK.txt" -d "spcode=608511&sppassword=sohu332416" "lu.blog.com:80/sp/login.do"

-D 将JSESSIONID 等值放入 GK.txt 文件中

curl -b "JSESSIONID=EC0AE12D30BA57B10AB68E558067B765;" -d "tonetype=0.5" "http://lu.blog.com/sp/UploadServlet?tonetype=0.5"

-b 带入JSESSIONID
-d 以POST方式提交

curl -b "JSESSIONID=AAB5E9FBA659044518C09A18B2310271;" -F file1/childring_file/7/1/爱神厄洛斯的漫游.asf" "lu.blog.com/sp/UploadServlet"

-F 上传文件

把产生的cookie保存在fee.cookie文件里
curl -d "user=test&pass=111111&ip=192.168.1.1&type=2&type=1&action=%C1%AC%BD%D3%CD%F8%C2%E7" --cookie-jar fee.cookie 192.168.252.4/login.jsp

读取上一步产生的session cookie即fee.cookie文件。共享上一步操作的session cookie值
curl --cookie fee.cookie --referer -d "http://192.168.252.4/user/network/connect_action.jsp?ip=192.168.1.1&type=2"