代码之家  ›  专栏  ›  技术社区  ›  ibz

从Python手动生成x-gwt-rpc

  •  4
  • ibz  · 技术社区  · 16 年前

    我想从Python脚本访问GWT服务,所以我想手动生成一个x-GWT-rpc请求。似乎找不到关于GWT-RPC调用格式的任何信息,因为每个人都是从Java执行的(因此调用是由框架生成的)。在哪里可以找到有关这种格式的详细文档?

    2 回复  |  直到 16 年前
        1
  •  1
  •   pathed    15 年前
        2
  •  0
  •   Sᴀᴍ Onᴇᴌᴀ    9 年前

    我偶然发现了和你一样的问题,我想我很容易就解决了。 虽然我还没有弄清楚如何正确地捕获响应,但我还是成功地得到了响应并发送了请求。以下是我所做的:

    import requests 
    url  = 'yours url'
    header = {'Accept':'*/*',
            'Accept-Encoding':'gzip, deflate',
             etc...
            }
    cookie = {cookies if needed
    }
    
    data_g = 'this would be request payload u can see in F12 of browser '# u just copy it and paste it, !!!like a string (UTF-8 chars)
    t = requests.post(url, headers=header, data = data_g, cookies = cookie)
    print vars(t).keys()
    #line above will print all variables of t
    print t
    

    此外,您还可以查看以下几个好链接:

    https://github.com/GDSSecurity/GWT-Penetration-Testing-Toolset

    https://docs.google.com/document/d/1eG0YocsYYbNAtivkLtcaiEE5IOF5u4LUol8-LL0TIKU/edit?hl=de&forcehl=1