def _inject_post(r, value, pds, pre_func): rs = [] i_pts = parse_qs(r.content) if value in i_pts: nc = i_pts.copy() for p in pds: nc[value] = [pre_func(p), ] n_content = urlencode(nc) r_new = r.copy() r_new.content = n_content r_new.injection_point = value r_new.payload = p r_new._update_content_length() rs.append(r_new) return rs
def _inject_query(r, value, pds, pre_func): rs = [] i_pts = parse_qs(r.query) if value in i_pts: nq = i_pts.copy() parsed_url = urlparse.urlparse(r.url) for p in pds: nq[value] = [pre_func(p), ] s = list(parsed_url) s[4] = urlencode(nq) r_new = r.copy() r_new.url = urlparse.urlunparse(s) r_new.injection_point = value r_new.payload = p rs.append(r_new) return rs
def _inject_post(r, value, pds, pre_func): rs = [] i_pts = parse_qs(r.content) if value in i_pts: nc = i_pts.copy() for p in pds: nc[value] = [ pre_func(p), ] n_content = urlencode(nc) r_new = r.copy() r_new.raw_content = n_content r_new.content = n_content r_new.injection_point = value r_new.payload = p r_new.update_content_length() rs.append(r_new) return rs
def _inject_query(r, value, pds, pre_func): rs = [] i_pts = parse_qs(r.query) if value in i_pts: nq = i_pts.copy() parsed_url = urlparse.urlparse(r.url) for p in pds: nq[value] = [ pre_func(p), ] s = list(parsed_url) s[4] = urlencode(nq) r_new = r.copy() r_new.url = urlparse.urlunparse(s) r_new.injection_point = value r_new.payload = p rs.append(r_new) return rs