Skip to content

Instantly share code, notes, and snippets.

@inian
Created June 9, 2015 03:41
Show Gist options
  • Select an option

  • Save inian/a294fd769215459fa798 to your computer and use it in GitHub Desktop.

Select an option

Save inian/a294fd769215459fa798 to your computer and use it in GitHub Desktop.

Revisions

  1. inian created this gist Jun 9, 2015.
    11 changes: 11 additions & 0 deletions cookieinject.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    cookieFile = ""
    def start(context, argv):
    global cookieFile
    cookieFile = argv[1]

    def request(context, flow):
    f = open(cookieFile)
    cookie =f.read().strip()
    f.close()
    if cookie != "":
    flow.request.headers["Cookie"] = [cookie]