コード例 #1
0
ファイル: injection.py プロジェクト: lukejahnke/burst
def _inject_cookie(r, value, pds, pre_func):
  rs = []
  cookies = r.cookies
  for i, c in enumerate(cookies):
    if c.name == value:
      break
  else:
    return rs
  c = Cookie(value, "")
  for p in pds:
    c.value = pre_func(p)
    cookies[i] = c
    r_new = r.copy()
    r_new.headers = [ (h,v) for h,v in r.headers if h != 'Cookie' ]
    r_new.headers.append(('Cookie', "; ".join([str(x) for x in cookies])))
    r_new.injection_point = value
    r_new.payload = p
    rs.append(r_new)
  return rs
コード例 #2
0
ファイル: injection.py プロジェクト: unintendedquine/burst
def _inject_cookie(r, value, pds):
  rs = []
  cookies = r.cookies
  for i, c in enumerate(cookies):
    if c.name == value:
      break
  else:
    return rs
  c = Cookie(value, "")
  for p in pds:
    c.value = p
    cookies[i] = c
    r_new = r.copy()
    r_new.remove_header('Cookie')
    r_new.add_header('Cookie', "; ".join([str(x) for x in cookies]))
    r_new.injection_point = value
    r_new.payload = p
    rs.append(r_new)
  return rs
コード例 #3
0
ファイル: http.py プロジェクト: RahulPande90/burst
 def bind(self, r):
   """Bind the Request to another one. This method will copy the supplied
   request's cookies and response set-cookies to the Request."""
   r_new = self.copy()
   for c in r.get_header('Cookie'):
     r_new.add_header('Cookie', c)
   if r.response:
     cookies = []
     for c in r.response.get_header('Set-Cookie'):
       cookies.append(Cookie.parse(c, set_cookie=True))
     r_new.add_header('Cookie', "; ".join([str(x) for x in cookies]))
   return r_new
コード例 #4
0
 def bind(self, r):
     """Bind the Request to another one. This method will copy the supplied
 request's cookies and response set-cookies to the Request."""
     r_new = self.copy()
     for c in r.get_header('Cookie'):
         r_new.add_header('Cookie', c)
     if r.response:
         cookies = []
         for c in r.response.get_header('Set-Cookie'):
             cookies.append(Cookie.parse(c, set_cookie=True))
         r_new.add_header('Cookie', "; ".join([str(x) for x in cookies]))
     return r_new
コード例 #5
0
def _inject_cookie(r, target, payloads, append):
    rs = []
    cookies = r.cookies
    for i, c in enumerate(cookies):
        if c.name == target:
            original_value = c.value
            break
    else:
        return rs
    c = Cookie(target, "")
    for p in payloads:
        if append:
            c.value = original_value + p
        else:
            c.value = p
        cookies[i] = c
        r_new = r.copy()
        r_new.remove_header('Cookie')
        r_new.add_header('Cookie', "; ".join([str(x) for x in cookies]))
        r_new.injection_point = target
        r_new.payload = p
        rs.append(r_new)
    return rs
コード例 #6
0
ファイル: injection.py プロジェクト: RahulPande90/burst
def _inject_cookie(r, target, payloads, append):
  rs = []
  cookies = r.cookies
  for i, c in enumerate(cookies):
    if c.name == target:
      original_value = c.value
      break
  else:
    return rs
  c = Cookie(target, "")
  for p in payloads:
    if append:
      c.value = original_value + p
    else:
      c.value = p
    cookies[i] = c
    r_new = r.copy()
    r_new.remove_header('Cookie')
    r_new.add_header('Cookie', "; ".join([str(x) for x in cookies]))
    r_new.injection_point = target
    r_new.payload = p
    rs.append(r_new)
  return rs
コード例 #7
0
ファイル: http.py プロジェクト: RahulPande90/burst
 def cookies(self):
   cookies = []
   for h in self.get_header("Cookie"):
     cookies.extend(Cookie.parse(h))
   return cookies
コード例 #8
0
ファイル: http.py プロジェクト: RahulPande90/burst
 def cookies(self):
   cookies = []
   for h in self.get_header("Set-Cookie"):
     cookies.append(Cookie.parse(h, set_cookie=True))
   return cookies
コード例 #9
0
 def cookies(self):
     cookies = []
     for h in self.get_header("Set-Cookie"):
         cookies.append(Cookie.parse(h, set_cookie=True))
     return cookies
コード例 #10
0
 def cookies(self):
     cookies = []
     for h in self.get_header("Cookie"):
         cookies.extend(Cookie.parse(h))
     return cookies