Jump to content

Recommended Posts

Posted (edited)

Hi everyone! i have Two-Problems:

  • I've used this code to decode and export cookies from Google Chrome application's "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Cookie" file but i can't receive any data:
#include <CryptProtect.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>

Global Const $g_sLoc_Output = @ScriptDir & "\Cookies.txt"
If FileExists($g_sLoc_Output) Then
   FileDelete($g_sLoc_Output)
EndIf
$hFO_Output = FileOpen($g_sLoc_Output ,1)
If $hFO_Output <> -1 Then
   FileWrite($hFO_Output, Chrome())
   FileFlush($hFO_Output)
   FileClose($hFO_Output)
EndIf

Func Chrome()
   Local $q, $r, $sOutput, $sLoc_ChromeDB = EnvGet("localappdata") & "\Google\Chrome\User Data\Default\Cookies"
   If FileExists($sLoc_ChromeDB) = False Then Return ""
   _SQLite_Startup()
   If @error Then
      MsgBox(16, "SQLite Error", "SQLite3.dll Can't be Loaded! - " & $__g_hPrintCallback_SQLite & @CRLF & @CRLF & "Exiting application")
      Exit -1
   EndIf
   _SQLite_Open($sLoc_ChromeDB)
   _SQLite_Query(-1, 'SELECT host_key, name, value, encrypted_value FROM cookies', $q)
   While _SQLite_FetchData($q, $r) = 0
      $sOutput = $sOutput & r[0] & @CRLF & r[1]
   WEnd
   _SQLite_Close()
   _SQLite_Shutdown()
   Return $sOutput
EndFunc
Edited by Ho3ein

I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites

That works fine for me :

#include <Constants.au3>
#include <SQLite.au3>

Opt ("MustDeclareVars", 1)

Local $sResult = Chrome ()
ConsoleWrite (@error & @CRLF)
MsgBox ($MB_SYSTEMMODAL,"",$sResult)

Func Chrome()
   Local $q, $r, $sOutput, $sLoc_ChromeDB = EnvGet("localappdata") & "\Google\Chrome\User Data\Default\Cookies"
   If Not FileExists($sLoc_ChromeDB) Then Return SetError (1, 0, "")
   _SQLite_Startup()
   If @error Then Return SetError (2, 0, "")
   _SQLite_Open($sLoc_ChromeDB)
   If @error Then Return SetError (3, 0, "")
   Local $aNames, $hQuery, $aRow
   _SQLite_Query(-1, "SELECT host_key, name, encrypted_value FROM cookies WHERE ROWID < 50", $hQuery)
   _SQLite_FetchNames ($hQuery, $aNames)
   Local $sOutput = StringFormat ("%-40s  %-40s", $aNames[0], $aNames[1]) & @TAB & $aNames[2] & @CRLF
   While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
      $sOutput &= StringFormat ("%-40s  %-40s", $aRow[0], $aRow[1]) & @CRLF & $aRow[2] & @CRLF
   WEnd
   _SQLite_Close()
   _SQLite_Shutdown()
   Return $sOutput
EndFunc

ps. value is useless for me as it is always equals to "".  Note also I only read rows under 50

Share this post


Link to post
Share on other sites
Posted (edited)

Hi @Nine. thanks for your coding, but "encrypted_value" value's are already encrypted. as i told, my 2nd problem is decrypting this values from my chrome Cookies & Login Data db then export them to tidy plain text file.

But thanks for your taking time for me :)

Edited by Ho3ein

I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
1 minute ago, Nine said:

You won't be able to decrypt it unless you know the key that was used.

I've tested some softwares that do this and actually worked fine for me.

It's not impossible.


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
Posted (edited)
7 minutes ago, Nine said:

great protection

It uses Windows API CryptProtect lib for crypt and decrypt data.

I've used this function in AutoIt too, but i did't get decrypted values.

Many freewares are built in this way, but i don't know how they work fine😕

https://gist.github.com/DakuTree/428e5b737306937628f2944fbfdc4ffc

Edited by Ho3ein

I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites
Just now, Nine said:

WHY asking for help in here ?

I want to code with my language (AutoIt) and export customized data as what i want.
 


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites

Any idea? 🤫




I've just got that Chrome 80 (and higher versions) requires to have Master Key in C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Local State file and this file's encrypted_key value has been encrypted via CryptProtectData (DPAPI), then for decrypt Cookie value or Logins value must be use AES-256 (GCB) Algorithm.

https://xenarmor.com/how-to-recover-saved-passwords-google-chrome/

But i don't know how to use in AutoIt, i just have C++ code for this issue🙁

 


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites

Please do not PM, I prefer to use the forum.  You already mentioned there are tools out there that can do this, but in your PM you said you only wanted to get 2 website passwords, most sites have a "Forgot Password" so they should be able to resend you the passwords, can't they?

Also in Google Chrome you should be able to retrieve your passwords or use a password recovery tool see https://www.isunshare.com/internet/recover-or-find-passwords-saved-on-chrome-browser.html so once you have them and you store them in password manager there should be no reason for a script, right?

"I think AutoIt Forum's members think that decrypting credentials of Google Chrome is illegal, but there is a lots of free decryption tools for do this job, i want to get my credentials and cookies as what i want."

You need to remember that while your intentions might be good, this is a public form and others may use any code on here for bad, which hurts the AutoIt community.

Stay safe.

Share this post


Link to post
Share on other sites

Hi @Subz, The reason of this, is only that i can't access to my E-mail to Reset Password, but i sure that one of those passwords can be correct for 2 sites: www.zalando.de and ebay.com

I've written all of these codes but my problem is how to decrypt via Master Key


I recommend to you to get COVID-19, but don't get Wife

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Langmeister
      I am once again asking for your experienced assistance. If I open a website that uses notifications I am asked to allow or block them for that website after a few seconds. This notification pops up every time the page gets navigated to, even tho you have clicked on allow for several times. I am explicitly not searching for smth to get rid of "Chrome is being controlled by automated test sw". Instead I am searching for a line of script to disable all notifications by default: like here chrome://settings/content/notifications. 
      This is code should give you an example of what notifications I am talking about:
      #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sID _WD_Option("Driver", "C:\Program Files (x86)\AutoIt3\chromedriver.exe") _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://webradio.planetradio.de/") _WD_LoadWait($sSession)  
    • By Langmeister
      Hi, I need help performing actions in Salesforce using IE. I used to complete tasks via MouseMove/MouseClick etc. on the Chrome application of SF, but unfortunately this only works for me and not my colleagues due to different positions of things etc. Being unable to get Webdriver UDF or Chromedriver running to interact with the code directly, I chose to look into the IE UDF. ATM I'm trying to tick a specific checkbox in SF which simply allows me to "select all checkboxes" at the same time. Applying the following code on a random website with checkboxes works just fine for me: (in this case selecting cheese checkbox)
      #include <IE.au3> Local $oIE = _IECreate("http://www.echoecho.com/htmlforms09.htm") Local $oSubmit = _IEGetObjByName($oIE, "option3") _IEAction($oSubmit, "click") _IELoadWait($oIE) But applying it to the Salesforce website it does exactly nothing and responds with these warnings/errors:
      The script is exactly the same, except for website and the input name tag of the desired checkbox being different.
      #include <IE.au3> Local $oIE = _IECreate("Corporate Salesforce URL") Local $oSubmit = _IEGetObjByName($oIE, "myPage:myForm:oliListBlock:oliListTable:j_id36") _IEAction($oSubmit, "click") _IELoadWait($oIE) As its working with random websites my guess is that there has to be something done to get it work with SF.
      Hope the more experienced SF+AutoIt pros can help me out here. Thanks in advance!
    • By adityaparakh
      Hello ,

      A website I am trying to login with my credentials.
      And retrieve the cookie into a text file.
      Unable to do so.
      Is it that certain,  Httponly , type - are not allowed to be fetched.

      Then further ,
      I will be checking every 5 minutes if my session is active , else re-login and re-fetch the cookie.
      For the second part , I will probably fetch some table and see if not in appropriate format do Part 1 : Fetch Cookie - again.
      Any better way , tips would be appreciated.
       
      Thanks
       
    • By nooneclose
      I want wanting to run multiple tests on my company website. Sadly the process I want to automate requires opening a File Explorer to add an attachment. Is there a way in to automate a Chrome opened File Explorer?
      (I am using webdriver to automate the other 99% of the process just fine. But when I have it click on attach file and chrome opens a file explorer I do not know how to handle it.) 
      Any help would be greatly appreciated. 
    • By FUD
      hello 
      please i need help 
      i need to open link in default browser only one windows without duplicate if i try to open the same link 
       
      thanks 
×
×
  • Create New...