3

Regarding this question, I was setting some cookies on a PythonFlask app which is accessed directly via http://127.0.0.1:8000, and I realized that it seems that, after accessing the address above, no such information regarding the SITE was stored in cookies.sqlite.

For example:

OK

$ sqlite3 cookies.sqlite "select * from moz_cookies where baseDomain glob '*stackoverflow*'"

357167|stackoverflow.com||cc|0d41064c61774c12b5d369694f729429|stackoverflow.com|/|1784567753|1469906956225907|1469034954014292|0|0|0|0
366821|stackoverflow.com||_gat|1|.stackoverflow.com|/|1469907557|1469906957098821|1469906957098821|0|0|0|0

NOK

 $ sqlite3 cookies.sqlite "select * from moz_cookies where baseDomain glob '*127.0.0.1*'"
 $



I made a dump of this SQlite database (~/.mozilla/firefox/*.default/cookies.sqlite) and I tried to grep the the IP, but no good.

~/.mozilla/firefox/2r7mbtt8.default $ sqlite3 cookies.sqlite .dump > mozilla-30-07-2016.sql
~/.mozilla/firefox/2r7mbtt8.default $ grep --color "127.0.0.1" mozilla-30-07-2016.sql 
~/.mozilla/firefox/2r7mbtt8.default $



I was checking directly on Mozilla Firefox (Privacy > remove individual cookies), that the cookie was indeed stored.

enter image description here

With this, I have the following questions regarding Firefox:

  • Does it make some distinction when it comes to store cookies from websites that are accessed via IP address or IP+port ?
  • Does it store cookies from sites accessed via IP addresses in another SQlite database?
  • 1
    There must be a distinction on websites accessed by IP+port because the design of the same origin policy includes only unique hostnames based on domain name (And going to IP+port does not send the Host: header). Yet, I do not know how firefox stores the cookies for non-domian based pages. Moreover localhost is a very special security case for browsers. – grochmal Jul 30 '16 at 21:21
  • I see.. But I'm pretty sure that it does not stores in cookies.sqlite. I tried to search for the IP on other sqlite files in "~/.mozilla/firefox/.default", and there are some informations indeed, but these other databases don't seem to have the same data structure from "cookies.sqlite" database. – ivanleoncz Jul 30 '16 at 21:31

1 Answers1

3

it works here.

sqlite> select * from moz_cookies where basedomain='127.0.0.1';
56447|127.0.0.1||mythweb_id|popn9pcsh52ut89d1g1a601us6|127.0.0.1|/|1501456297|1469920297288887|1469920297288887|0|0|0|0

perhaps your cookie is a session cookie, not a persistent cookie. session cookies are not saved.

Jasen
  • 3,761