[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

curl 无限循环发包post (windows 批处理goto)

本帖最后由 依山居 于 2015-10-11 05:33 编辑

curl 无限循环发包post (windows 批处理goto)
http://my.oschina.net/ysj/blog/515407



windows 下安装软件包管理器chocolatey,主要是为了用方便安装curl,wget等各种软件。

CMD中输入以下命令安装chocolatey:
  1. c:\@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
复制代码
一行命令安装curl:
  1. c:\cinst curl
复制代码
fiddler中有导出会话为各种脚本的,其中第一项就是curl script,存为XX.BAT,打开后得到以下一行命令:
  1. curl -k -i --raw -o 0.dat -X POST -d "keyword=%%E6%%88%%91%%E6%%98%%AF%%E5%%B9%%BF%%E5%%91%%8A7" "http://ourcoders.com/log/sitesearch/" -H "Host: ourcoders.com" -H "Connection: keep-alive" -H "Accept: application/json, text/javascript, */*; q=0.01" -H "Origin: [url]http://ourcoders.com[/url]" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "DNT: 1" -H "Referer: [url]http://ourcoders.com/search/[/url]" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: zh-CN,zh;q=0.8,en;q=0.6" -H "Cookie: PHPSESSID=9dnlvb603u0mrbud7du0m0kjt1; TINY4COCOA_USERID=33982; TINY4COCOA_SESSION=ef9be61c3c5b8b9ed0e76d13a8c804ff"
复制代码
改一下,加上goto就可以实现循环了:
  1. :g
  2. curl -k -i --raw -o 0.dat -X POST -d "keyword=%%E6%%88%%91%%E6%%98%%AF%%E5%%B9%%BF%%E5%%91%%8A7" "http://ourcoders.com/log/sitesearch/" -H "Host: ourcoders.com" -H "Connection: keep-alive" -H "Accept: application/json, text/javascript, */*; q=0.01" -H "Origin: [url]http://ourcoders.com[/url]" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "DNT: 1" -H "Referer: [url]http://ourcoders.com/search/[/url]" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: zh-CN,zh;q=0.8,en;q=0.6" -H "Cookie: PHPSESSID=9dnlvb603u0mrbud7du0m0kjt1; TINY4COCOA_USERID=33982; TINY4COCOA_SESSION=ef9be61c3c5b8b9ed0e76d13a8c804ff"
  3. goto g
复制代码

能解决 【得到 百度搜索结果  前10页的链接】我提出的那个问题么?
http://www.bathome.net/thread-41570-1-1.html

TOP

返回列表