<s> '''<STR_LIT>''' <EOL> from burp import IBurpExtender <EOL> from burp import IContextMenuFactory <EOL> from javax . swing import JMenuItem <EOL> import sys <EOL> import os <EOL> import re <EOL> import jarray <EOL> import java <EOL> module_folder = os . path . dirname ( '<STR_LIT>' ) <EOL> sys . path . insert ( <NUM_LIT:0> , module_folder ) <EOL> import webcommon <EOL> class BurpExtender ( IBurpExtender , IContextMenuFactory ) : <EOL> def registerExtenderCallbacks ( self , callbacks ) : <EOL> self . _callbacks = callbacks <EOL> self . _helpers = callbacks . getHelpers ( ) <EOL> callbacks . setExtensionName ( "<STR_LIT>" ) <EOL> callbacks . registerContextMenuFactory ( self ) <EOL> def createMenuItems ( self , invocation ) : <EOL> menu = [ ] <EOL> menu . append ( JMenuItem ( "<STR_LIT>" , None , actionPerformed = lambda x , inv = invocation : self . urlSet ( inv ) ) ) <EOL> menu . append ( JMenuItem ( "<STR_LIT>" , None , actionPerformed = lambda x , inv = invocation : self . bodySet ( inv ) ) ) <EOL> menu . append ( JMenuItem ( "<STR_LIT>" , None , actionPerformed = lambda x , inv = invocation : self . cookieSet ( inv ) ) ) <EOL> return menu <EOL> def urlSet ( self , invocation ) : <EOL> invMessage = invocation . getSelectedMessages ( ) <EOL> hostname = invMessage [ <NUM_LIT:0> ] . getHttpService ( ) . getHost ( ) <EOL> port = invMessage [ <NUM_LIT:0> ] . getHttpService ( ) . getPort ( ) <EOL> bytes_req = invMessage [ <NUM_LIT:0> ] . getRequest ( ) <EOL> r1 = self . _helpers . analyzeRequest ( invMessage [ <NUM_LIT:0> ] ) <EOL> offsets = [ ] <EOL> no_of_parameters = len ( r1 . getParameters ( ) ) <EOL> for p1 in r1 . getParameters ( ) : <EOL> if p1 . getType ( ) == <NUM_LIT:0> : <EOL> offset = [ ] <EOL> offset . append ( p1 . getValueStart ( ) ) <EOL> offset . append ( p1 . getValueEnd ( ) ) <EOL> offsets . append ( jarray . array ( offset , '<STR_LIT:i>' ) ) <EOL> self . _callbacks . sendToIntruder ( hostname , port , <NUM_LIT:1> , bytes_req , offsets ) <EOL> def bodySet ( self , invocation ) : <EOL> invMessage = invocation . getSelectedMessages ( ) <EOL> hostname = invMessage [ <NUM_LIT:0> ] . getHttpService ( ) . getHost ( ) <EOL> port = invMessage [ <NUM_LIT:0> ] . getHttpService ( ) . getPort ( ) <EOL> bytes_req = invMessage [ <NUM_LIT:0> ] . getRequest ( ) <EOL> r1 = self . _helpers . analyzeRequest ( invMessage [ <NUM_LIT:0> ] ) <EOL> offsets = [ ] <EOL> no_of_parameters = len ( r1 . getParameters ( ) ) <EOL> for p1 in r1 . getParameters ( ) : <EOL> if p1 . getType ( ) == <NUM_LIT:1> : <EOL> offset = [ ] <EOL> offset . append ( p1 . getValueStart ( ) ) <EOL> offset . append ( p1 . getValueEnd ( ) ) <EOL> offsets . append ( jarray . array ( offset , '<STR_LIT:i>' ) ) <EOL> self . _callbacks . sendToIntruder ( hostname , port , <NUM_LIT:1> , bytes_req , offsets ) <EOL> def cookieSet ( self , invocation ) : <EOL> invMessage = invocation . getSelectedMessages ( ) <EOL> hostname = invMessage [ <NUM_LIT:0> ] . getHttpService ( ) . getHost ( ) <EOL> port = invMessage [ <NUM_LIT:0> ] . getHttpService ( ) . getPort ( ) <EOL> bytes_req = invMessage [ <NUM_LIT:0> ] . getRequest ( ) <EOL> r1 = self . _helpers . analyzeRequest ( invMessage [ <NUM_LIT:0> ] ) <EOL> offsets = [ ] <EOL> no_of_parameters = len ( r1 . getParameters ( ) ) <EOL> for p1 in r1 . getParameters ( ) : <EOL> if p1 . getType ( ) == <NUM_LIT:2> : <EOL> offset = [ ] <EOL> offset . append ( p1 . getValueStart ( ) ) <EOL> offset . append ( p1 . getValueEnd ( ) ) <EOL> offsets . append ( jarray . array ( offset , '<STR_LIT:i>' ) ) <EOL> self . _callbacks . sendToIntruder ( hostname , port , <NUM_LIT:1> , bytes_req , offsets ) </s>
