• HTTP发包工具 -HTTPie


    原文:

    https://zm8.sm-tc.cn/?src=l4uLj8XQ0IuekZWWi5bRk5CZi5qN0ZyQktCPkIyL0M6cnMmcx8qdoM7PnMrIyMnI&uid=e96fb03443f13a7818306ad06a9a551c&hid=7004e08dc41ef5580b3280b8ff2054c4&pos=5&cid=9&time=1527521434654&from=click&restype=1&pagetype=0000004000000402&bu=ss_doc&query=http%E5%8F%91%E5%8C%85%E5%B7%A5%E5%85%B7&mode=&v=1&uc_param_str=dnntnwvepffrgibijbprsvdsdichei

    https://github.com/jakubroztocil/httpie

    一般用curl发送http协议包,这里介绍一款更为友好的发包工具 HTTPie(python版本)

    (其实也自制了一款perl版本的发包工具HTTP.pl

    一、安装 

    pip install --upgrade httpie

    或者 

    easy_install httpie

    或者 直接从github

    pip install --upgrade https://github.com/jakubroztocil/httpie/tarball/master

    可选的,

    pip install --upgrade pyopenssl pyasn1 ndg-httpsclient

    安装成功会 /usr/local/bin/http 

     

    二、配置

    参考:https://github.com/jkbr/httpie#config

    vim  ~/.httpie/config.json

    {
        "__meta__": {
            "about": "HTTPie configuration file",
            "help": "https://github.com/jkbr/httpie#config",
            "httpie": "0.8.0"
        },
        "default_options": ["--verbose"],
        "implicit_content_type": "form"
    }

    default_options: 配置默认选项,例如显示完整请求过程

    implicit_content_type:默认请求的content_type类型,可以选择form或者json类型,例如选择form表示默认指定请求体的Content-Type为application/x-www-form-urlencoded

    例如选择json表示默认指定请求体的Content-Type为application/json

     

    三、使用

    1.简介

    基本使用方法 

    http [选项] [请求方法] URL [ITEM [ITEM]]

    仔细查看帮助选项是快速入门的好办法

    http --help

    2.常见功能示例

    (1)发送查询字符串 ==

     (2)发送表单数据  

    Content-Type为application/x-www-form-urlencoded

    从文件读取数据发送表单 =@

     

     (3)发送JSON数据  :=

    Content-Type为application/json

    从文件读取JSON数据  :=@

       

    (4)发送文件表单 @

    Content-Type为multipart/form-data

     (5)是否自动重定向  --follow

    不自动重定向的

     自动重定向的

     (6)指定请求头  :

     (7) 基本认证  --auth:passwd

    缺少基本认证的

     指定基本认证的

    (8)像wget一样下载 --download

     

    更多使用方法请参照

    https://github.com/jakubroztocil/httpie

    后记: 

    本来这个工具让我觉得沮丧,觉得把我的工具瞄成了渣渣,但今天发了ta有个编码问题,瞬间满血复活了,我写的工具就没有这个问题(吼吼吼....)

    当使用httpie发送下面这个请求时

    http http://127.0.0.1:12354 a='(select 1 from(select count(*),concat((select (select (SELECT CHAR(100, 56, 100, 57, 48, 9
    7, 97, 57, 52, 51, 101, 52, 97, 100, 100, 50))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema
    .tables group by x)a)'

    编码为

    a=(select+1+from(select+count(*),concat((select+(select+(SELECT+CHAR(100,+56,+100,+57,+48,+97,+97,+57,+52,+51,+101,+52,+97,+100,+100,+50)))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)

    ta将不该编码的也编码了

    而用HTTP.pl

    ./HTTP.pl -url http://127.0.0.1:12354 -method POST -d a='(select 1 from(select count(*),concat((select (select (SELECT CHAR(100, 56, 100, 57, 48, 9
    7, 97, 57, 52, 51, 101, 52, 97, 100, 100, 50))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema
    .tables group by x)a)'

    编码为

    a=(select+1+from(select+count(*),concat((select+(select+(SELECT+CHAR(100,+56,+100,+57,+48,+97,+97,+57,+52,+51,+101,+52,+97,+100,+100,+50)))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)

  • 相关阅读:
    Web开发细节搜集
    excel设置单元格为文本
    网页QQ唤起
    .net提高文章
    代码重构学习
    js的undefined怎么判断
    微软.net一些类的源码
    FineMessBox的js依赖导致错误Uncaught ReferenceError: addEvent is not defined
    [译转]深入理解LayoutInflater.inflate()
    java 和 Android Base64加密
  • 原文地址:https://www.cnblogs.com/itfat/p/9103647.html
Copyright © 2020-2023  润新知