categories: []
date: '2023-10-25T10:06:55.141114+08:00'
tags: []
title: curl 命令行工具
updated: 2023-10-25T10:22:35.913+8:0

正常get请求

curl https://putdown.top

-k

忽略证书

bp抓包

curl https://putdown.top -k

https://gh.putdown.top/https://github.com/futalk/tuchuang/raw/main/img/Snipaste_2023-10-25_10-23-03_d41d8cd98f00b204e9800998ecf8427e.jpg

-A 修改ua头

https://putdown.top -k -A Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.61
  • 对比上图发生了改变

https://gh.putdown.top/https://github.com/futalk/tuchuang/raw/main/img/Snipaste_2023-10-25_10-24-42_d41d8cd98f00b204e9800998ecf8427e.jpg

-X 修改请求方式

https://putdown.top -k -A Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.61 -X POST

https://gh.putdown.top/https://github.com/futalk/tuchuang/raw/main/img/Snipaste_2023-10-25_10-27-08_d41d8cd98f00b204e9800998ecf8427e.jpg

-H 添加http请求头

  • 这边随便写个A:B
curl https://putdown.top -k -A Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.61 -H A:B

https://gh.putdown.top/https://github.com/futalk/tuchuang/raw/main/img/Snipaste_2023-10-25_10-29-25_d41d8cd98f00b204e9800998ecf8427e.jpg

-d 发送 POST 请求的数据

curl https://putdown.top -k -A Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.61 -X POST -d uaername=admin;passowrd=123456

https://gh.putdown.top/https://github.com/futalk/tuchuang/raw/main/img/Snipaste_2023-10-25_10-33-34_d41d8cd98f00b204e9800998ecf8427e.jpg

-F 上传文件

  • 正常上传文件
curl https://putdown.top -k -F [email protected]
  • 上传文件修改文件名
curl https://putdown.top -k -F [email protected];filename=aaa.txt
  • 指定MIME 类型
curl https://putdown.top -k -F [email protected];filename=aaa.txt;type=image/png

-o 同于wget命令

-O 将服务器回应保存成文件,并将 URL 的最后部分当作文件名。

以上功能比较常用,后续再补充。。。。。。。。。