Example #1
0
    def setMessage(self, content, isRequest):

        # Instantiate GWTParser
        gwt = GWTParser()

        if content is None:
            # clear our display
            self._gwtMessageTabInput.setText(None)
            self._gwtMessageTabInput.setEditable(False)

        else:

            if isRequest:
                r = self._helpers.analyzeRequest(content)
            else:
                r = self._extender._helpers.analyzeResponse(content)

            # Get body contents
            msg = content[r.getBodyOffset():].tostring()
            print(msg)

            text = gwt.deserialize(msg)
            print(text)
            value = gwt.display()

            print(value)

            #self._gwtMessageTabInput.setText(self._helpers.stringToBytes(value))
            self._gwtMessageTabInput.setText(msg)
            self._gwtMessageTabInput.setEditable(self._editable)

        self._currentMessage = content
Example #2
0
    def parseGWT(self, event):

        gwt = GWTParser()
        gwt.burp

        gwt_Deser = gwt.deserialize(self.gwtTextArea.text)
        value = gwt.display()

        self.parsedGWTField.text = str(value)
        self.insertPointField.text = gwt.get_fuzzstr()
Example #3
0
    def parseGWTBody(self, event):

        # Get IHTTPRequestResponse object , run getRequest against it to create IRequestInfo object
        # IHttpRequestResponse[] getSelectedMessages();
        msg = self.context.getSelectedMessages()[0].getRequest()

        # Analyze the IRequestInfo object and create a temp value to grab the body contents
        r_temp = self._helpers.analyzeRequest(msg)
        message = msg[r_temp.getBodyOffset():].tostring()

        values = []

        # Clear the contents of each text area/box if they're not empty
        if len(self.gwtTextArea.text) > 1:
            self.gwtTextArea.text = ""
            self.parsedGWTField.text = ""
            self.insertPointField.text = ""

        # Write the GWT-RPC request to the text area
        for value in message:
            self.gwtTextArea.append(value)

        # Call parseGWT when sent via Context-Menu
        try:
            gwt = GWTParser()
            gwt.burp

            gwt_Deser = gwt.deserialize(self.gwtTextArea.text)
            value = gwt.display()

            self.parsedGWTField.text = str(value)
            self.insertPointField.text = gwt.get_fuzzstr()

        except Exception as er:
            # Print whatever exception occurred if the body was not parsed properly
            print(
                "[!] Exception occurred, is the body a valid GWT-RPC?\nException:"
            )
            print(er)
Example #4
0
        elif options.replace_value:
            gwt.replace_value = options.replace_value
        elif options.burp:
            gwt.burp = options.burp

        if options.write:
            if os.path.exists(options.write):
                print("Output file entered already exists")
                exit()

            fout = open(options.write, "w")
            gwt.fout = fout

        elif options.append:
            fout = open(options.append, "a")
            gwt.fout = fout

        gwt.deserialize(options.rpc_request)

        if options.pretty:
            gwt.display()

        gwt.get_fuzzstr()

        if gwt.fout:
            gwt.fout.close()

    else:
        print("\nMissing RPC Request Payload\n")
        parser.print_help()
        
        
        if options.write:
            if os.path.exists(options.write):
                print( "Output file entered already exists" )
                exit()
                
            fout = open( options.write, "w" )
            gwt.fout = fout
            
        elif options.append:
            fout = open( options.append, "a" )
            gwt.fout = fout
        
        gwt.deserialize( options.rpc_request )
        
        if options.pretty:
            gwt.display()
        
        gwt.get_fuzzstr()
        
        if gwt.fout:
            gwt.fout.close()
        
    else:
        print( "\nMissing RPC Request Payload\n" )
        parser.print_help()