首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >在渗透中curl的常见用法

在渗透中curl的常见用法

作者头像
信安之路
发布2018-08-08 11:24:27
发布2018-08-08 11:24:27
1.5K0
举报
文章被收录于专栏:信安之路信安之路

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 "<xml>" --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

总结

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

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2017-09-27,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 信安之路 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 常规访问
  • 文件名正则
  • 域名正则
  • 目录正则
  • 常规下载页面
    • 添加下载进度条
  • 使用不同的版本的http协议
    • 默认1.0版本
    • 指定版本
  • 使用不同的ssl版本访问
    • tlsv1
    • sslv2
    • sslv3
  • 使用不同的ip协议
    • ipv4
    • ipv6
  • 指定user-agent
  • 指定cookie
  • 指定cookie文件
  • 提交post数据
  • 指定referer
  • 指定header
  • 显示访问网页的header
  • 跟随location跳转页面
  • 指定dns访问网站
  • 指定证书访问https的网页
  • 总结
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档