def Permutations(self,log_id,options): section = None value = "AAAAAAA" for o in options: if o: if o in ["headers","cookies","query","body"]: section = o else: value = o ret = [] for key,parms in self.Parameters(log_id).items(): if parms: if not section or section == key: for p in parms: r_pram = "{0}.{1}".format(key,p) if p.find(".") == -1 else "{0}.[{1}]".format(key,p) ret.append(To.Dict(r_pram,value)) return ret
def replay_cmd(self, raw): try: args = Args(raw, [("log_id", int), ("parm", str), ("val", str), ("find", str)], 1) args.val = self._substitute(args.val) if self._validate(args, "log_id"): log = self.logs.Get(args.log_id) pv = To.Dict(args.parm, args.val) if args.parm else None res, err = self.replay.Request(log, pv, args.find) if not err: self.display.ResultHeader() self._result(args.log_id, "REPLY", pv, res, False, None) self.display.BR() else: self.display.Error(err) return True except: self._error() return False
def flip_cmd(self, raw): try: args = Args(raw, [("log_id", int), ("method", str)], 2) if self._validate(args, "log_id"): log = self.logs.Get(args.log_id) pv = To.Dict("method", args.method) res, err = self.replay.Request(log, pv, None, True, self.proxies) if not err: self.display.ResultHeader() flag = (str(log.status) == str(res.status_code)) self._result(args.log_id, "FLIP", pv, res, flag, None) self.display.BR() else: self.display.Error(err) return True except: self._error() return False
def reflected_cmd(self, raw): try: args = Args(raw, [("log_id", int), ("parm", str), ("val", str), ("find", str)], 3) args.val = self._substitute(args.val) if self._validate(args, "log_id"): log = self.logs.Get(args.log_id) pv = To.Dict(args.parm, args.val) res, err = self.replay.Request(log, pv, args.find) if not err: self.display.ResultHeader() flag, meta = Html.Reflected(res, args.val, self.options.Get("render")) self._result(args.log_id, "RFLCT", pv, res, flag, meta) self.display.BR() else: self.display.Error(err) return True except: self._error() return False