专栏名称: 信安之路
只分享干货,不扯蛋不蹭热点,共同学习共同成长,一起踏上信息安全之路!
目录
相关文章推荐
警民直通车浦东  ·  浦东警方多措并举护航新春出行高峰 ·  14 小时前  
警民直通车浦东  ·  浦东警方多措并举护航新春出行高峰 ·  14 小时前  
中工网  ·  涉春节档讨论,600余个账号被禁言! ·  15 小时前  
中工网  ·  涉春节档讨论,600余个账号被禁言! ·  15 小时前  
川观新闻  ·  最新披露!DeepSeek遭暴力破解,攻击I ... ·  2 天前  
互联网坊间八卦  ·  360辟谣:网传哺乳期员工被裁,内容失实 ·  5 天前  
互联网坊间八卦  ·  360辟谣:网传哺乳期员工被裁,内容失实 ·  5 天前  
漫步五角场  ·  中国银联2025年拟录用应届毕业生名单 ·  5 天前  
漫步五角场  ·  中国银联2025年拟录用应届毕业生名单 ·  5 天前  
51好读  ›  专栏  ›  信安之路

在渗透中curl的常见用法

信安之路  · 公众号  · 互联网安全  · 2017-09-27 00:00

正文

curl是利用URL语法在命令行方式下工作的开源文件传输工具。其功能以及参数非常多,然而,我们在渗透测试中可以用curl做什么呢?下面就举例说一下,欢迎大家拍砖!工具下载地址如下:

https://curl.haxx.se/download.html


常规访问

curl http://www.myh0st.cn

文件名正则

curl ftp://ftp.myh0st.cn/file[1-100].txt  

curl ftp://ftp.myh0st.cn/file[1-100:10].txt  

curl ftp://ftp.myh0st.cn/file[001-100].txt  

curl ftp://ftp.myh0st.cn/file[a-z].txt  

curl  ftp://ftp.myh0st.cn/file[a-z:2].txt  

域名正则

curl http://site.{one,two,three}.com  

目录正则

curl http://www.myh0st.cn/archive[1996-1999]/vol[1-4]/part{a,b,c}.html  


常规下载页面

curl -o index.html http://www.myh0st.cn/  

curl http://www.myh0st.cn/ > index.html  

添加下载进度条

curl -# http://www.myh0st.cn/   > index.html  


使用不同的版本的http协议

默认1.0版本

curl -0 http://www.myh0st.cn  

指定版本

curl --http1.1 http://www.myh0st.cn

curl --http2 http://www.myh0st.cn  


使用不同的ssl版本访问

tlsv1

curl -1 http://www.myh0st.cn  

curl --tlsv1 http://www.myh0st.cn

sslv2

curl -2 http://www.myh0st.cn  

curl --sslv2 http://www.myh0st.cn

sslv3

curl -3 http://www.myh0st.cn  

curl --sslv3 http://www.myh0st.cn


使用不同的ip协议

ipv4

curl -4 http://www.myh0st.cn  

curl --ipv4 http://www.myh0st.cn

ipv6

curl -6 http://www.myh0st.cn  

curl --ipv6 http://www.myh0st.cn

指定user-agent

curl -A "wget/1.0" http://www.myh0st.cn  

curl --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"  http://www.myh0st.cn  

curl --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)"  http://www.myh0st.cn  

指定cookie

curl -b "phpsession=Testtest" http://www.myh0st.cn  

curl --cookie "name=Daniel" http://www.myh0st.cn  

指定cookie文件

curl -c cookies.txt http://www.myh0st.cn  

curl --cookie-jar cookies.txt http://www.myh0st.cn  

提交post数据

curl -d "username=admin&password=pass" http://www.myh0st.cn  

curl --data "birthyear=1905&press=%20OK%20"  http://www.myh0st.cn/when.cgi

curl --data-urlencode "name=I am Daniel" http://curl.haxx.se

curl --data "" --header "Content-Type: text/xml" --request PROPFIND url.com

指定referer

curl -e "http://www.myh0st.cn/referer" http://www.myh0st.cn  

curl --referer http://www.myh0st.cn/referer http://www.myh0st.cn  

指定header

curl --header "Host:www.myh0st.cn" http://www.myh0st.cn  

显示访问网页的header

curl -D - http://www.myh0st.cn  

curl --dump-header headers_and_cookies http://www.myh0st.cn

跟随location跳转页面

curl -L http://www.myh0st.cn

curl --location http://www.myh0st.cn

指定dns访问网站

curl --dns-servers 8.8.8.8 http://www.myh0st.cn

指定证书访问https的网页

curl --cert mycert.pem https://www.myh0st.cn

总结

大家可以下载这个软件自己把玩一下,可能整理的不全,作为一款优秀的命令行版网页浏览工具,在实际的渗透中可以帮我们很多,有没有用全看自己如何去玩。有什么建议或者意见请下方留言。