curl使用技巧

1.客户端指定源端口:

#!/bin/bash
#起始源端口
Pno=39800
for ((i=1;i<=39800;i++)) ;
do
    Pno=`expr $Pno + 1`
     echo '=======' >> 1.log
     echo $Pno >> 1.log
     date >> 1.log
     curl -o /dev/null --local-port $Pno -s -w %{time_namelookup}::%{time_connect}::%{time_starttransfer}::%{time_total}::%{time_appconnect}"\n"   curl -o /dev/null -s -w %{time_namelookup}::%{time_connect}::%{time_starttransfer}::%{time_total}::%{time_appconnect}"\n"   http://10.20.192.92/ >> 1.log
     date >>1.log
         sleep 2
done

 

2.只要返回码:

curl -g -sL -w "%{http_code}\n" -o error.txt --header "User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" $sendhttp

3.代理转发:

curl -x 10.20.192.92:80 www.baidu.com

posted on 2021-06-15 14:31  古风尘  阅读(295)  评论(0编辑  收藏  举报

导航