Beispiel #1
0
    def __init__(self, reqresp, varsSet, dictio, dictio2=None, proxy=None):

        self.reqsgenerated = 0

        self.request = reqresp
        self.allvars = False
        self.allpost = False
        self.allheaders = False
        self.final = False
        self.child = None
        if proxy != None:
            if proxy.count("-"):
                self.proxy = proxy.split("-")
                print self.proxy
            else:
                self.proxy = [proxy]
        else:
            self.proxy = proxy
            # self.proxy=proxy
        self.kk = varsSet
        if varsSet == "allvars":
            self.allvars = True
            self.varSET = self.request.variablesGET()
        elif varsSet == "allpost":
            self.allpost = True
            self.varSET = self.request.variablesPOST()
        elif varsSet == "allheaders":
            self.allheaders = True
            self.varSET = self.request.getHeaders()
        elif varsSet != "None":
            raise Exception, "Unknown variable set: " + varsSet

            #################### Importante aqui se guarda un nuevo diccionario, mediante el constructor por copia
            # Esto se hace para que cada diccionario de cada requestGenerator tenga su propio iterador! y no usen
            # todos el mismo :D
            ####################

        self.dictio = dictionary(dictio)
        if dictio2:
            self.dictio2 = dictionary(dictio2)
        else:
            self.dictio2 = None

        self.currentDictio1 = None

        self.currentVarSet = 0
Beispiel #2
0
    def __init__(self, reqresp, varsSet, dictio, dictio2=None, proxy=None):

        self.reqsgenerated = 0

        self.request = reqresp
        self.proxy = proxy
        self.allvars = False
        self.allpost = False
        self.allheaders = False
        self.final = False
        self.child = None

        self.kk = varsSet
        if varsSet == "allvars":
            self.allvars = True
            self.varSET = self.request.variablesGET()
        elif varsSet == "allpost":
            self.allpost = True
            self.varSET = self.request.variablesPOST()
        elif varsSet == "allheaders":
            self.allheaders = True
            self.varSET = self.request.getHeaders()
        elif varsSet != "None":
            raise Exception, "Unknown variable set: " + varsSet

        #################### Importante aqui se guarda un nuevo diccionario, mediante el constructor por copia
        # Esto se hace para que cada diccionario de cada requestGenerator tenga su propio iterador! y no usen
        # todos el mismo :D
        ####################

        self.dictio = dictionary(dictio)
        if dictio2:
            self.dictio2 = dictionary(dictio2)
        else:
            self.dictio2 = None

        self.currentDictio1 = None

        self.currentVarSet = 0
Beispiel #3
0
		hidelines=optsd["--hl"][0].split(",")
	if "--hh" in optsd:
		hidechars=optsd["--hh"][0].split(",")
	if "--hs" in optsd:
		hideregex=re.compile(optsd["--hs"][0],re.MULTILINE|re.DOTALL)

	payloadtype='; '.join(optsd["-z"])

	selected_dic = []
	if "-z" in optsd:
	    for i in optsd["-z"]:
		vals = i.split(",")
		t, par = vals[:2]
		p = select_payload(t)(par)

		d = dictionary()
		d.setpayload(p)
		if len(vals) == 3:
		    encoding = vals[2]
		    d.setencoder([select_encoding(i).encode for i in encoding.split("@")])

		selected_dic.append(d)

	printer_tool = None
	if "-o" in optsd:
	    printer_tool = select_printer(optsd['-o'][0])

	if "-m" in optsd:
	    iterat_tool = select_iteration(optsd['-m'][0])
	else:
	    iterat_tool = select_iteration('product')
Beispiel #4
0
	if "--hc" in optsd:
		hidecodes=optsd["--hc"].split(",")
	if "--hw" in optsd:
		hidewords=optsd["--hw"].split(",")
	if "--hl" in optsd:
		hidelines=optsd["--hl"].split(",")

	payloadtype=optsd ["-z"]
	d2=None

	if optsd ["-z"].lower()=="file":
		list=optsd["-f"].split(",")
		dic1=payload_file(list[0])
		if len (list)==2:
			dic2=payload_file(list[1])
			d2=dictionary()
			d2.setpayload(dic2)
			
	elif optsd ["-z"].lower()=="range":
		dic1=payload_range(optsd["-r"],len(optsd["-r"].split("-")[1]))
	elif optsd ["-z"].lower()=="hexa-range":
		dic1=payload_hexrange(optsd["-r"])
	else:
		print "Bad argument: -z dicttype : Specify type od dictionary (file,range,hexa-range)"
		sys.exit (-1)

	d1=dictionary()
	d1.setpayload(dic1)

		
	if "-e" in optsd:
Beispiel #5
0
    if "--hc" in optsd:
        hidecodes = optsd["--hc"].split(",")
    if "--hw" in optsd:
        hidewords = optsd["--hw"].split(",")
    if "--hl" in optsd:
        hidelines = optsd["--hl"].split(",")

    payloadtype = optsd["-z"]
    d2 = None

    if optsd["-z"].lower() == "file":
        list = optsd["-f"].split(",")
        dic1 = payload_file(list[0])
        if len(list) == 2:
            dic2 = payload_file(list[1])
            d2 = dictionary()
            d2.setpayload(dic2)

    elif optsd["-z"].lower() == "range":
        dic1 = payload_range(optsd["-r"], len(optsd["-r"].split("-")[1]))
    elif optsd["-z"].lower() == "hexa-range":
        dic1 = payload_hexrange(optsd["-r"])
    else:
        print "Bad argument: -z dicttype : Specify type od dictionary (file,range,hexa-range)"
        sys.exit(-1)

    d1 = dictionary()
    d1.setpayload(dic1)

    if "-e" in optsd:
        encodings = optsd["-e"].split(",")
Beispiel #6
0
        hidelines = optsd["--hl"][0].split(",")
    if "--hh" in optsd:
        hidechars = optsd["--hh"][0].split(",")
    if "--hs" in optsd:
        hideregex = re.compile(optsd["--hs"][0], re.MULTILINE | re.DOTALL)

    payloadtype = '; '.join(optsd["-z"])

    selected_dic = []
    if "-z" in optsd:
        for i in optsd["-z"]:
            vals = i.split(",")
            t, par = vals[:2]
            p = select_payload(t)(par)

            d = dictionary()
            d.setpayload(p)
            if len(vals) == 3:
                encoding = vals[2]
                d.setencoder(
                    [select_encoding(i).encode for i in encoding.split("@")])

            selected_dic.append(d)

    printer_tool = None
    if "-o" in optsd:
        printer_tool = select_printer(optsd['-o'][0])

    if "-m" in optsd:
        iterat_tool = select_iteration(optsd['-m'][0])
    else: