benjholla / CookieMonster

A utility for exfiltrating cookies from local browser cookie stores
MIT License
53 stars 30 forks source link

unable to run jar file against latest chrome version - windows #15

Open soujanyash opened 1 year ago

soujanyash commented 1 year ago

Hi, I am trying to run the jar file in my windows machine and the chrom version is 115. I always get error

C:\Users\djsou\CookieMonster\CookieMonster>java -jar CookieMonster.jar --browsers=chrome --domains=facebook.com
Selected Browsers: Chrome
Selected Domains: facebook.com
============================================================
Searching cookies for domain: facebook.com
============================================================
Searching in browser: Chrome
============================================================
java.nio.file.FileSystemException: C:\Users\djsou\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies -> .cookies.db: The process cannot access the file because it is being used by another process
        at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
        at java.base/sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:208)
        at java.base/sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:284)
        at java.base/java.nio.file.Files.copy(Files.java:1299)
        at cmonster.browsers.ChromeBrowser.processCookies(ChromeBrowser.java:142)
        at cmonster.browsers.Browser.getCookiesForDomain(Browser.java:40)
        at cmonster.CookieMonster.dumpCookies(CookieMonster.java:131)
        at cmonster.CookieMonster.main(CookieMonster.java:107)
No cookies found.
============================================================
============================================================
Finished.

Looks like the cookies file not able to be copied before starting reading it. Is there anything missing here ?

soujanyash commented 1 year ago
C:\Users\djsou\CookieMonster\CookieMonster>java -version
java version "16.0.2" 2021-07-20
Java(TM) SE Runtime Environment (build 16.0.2+7-67)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)
benjholla commented 1 year ago

It looks like a file lock, do you get the error if you close the Chrome process and then run your command again? If that is the case, do you get the error when running your command as administrator while the chrome is running?

On Mon, Jul 31, 2023, 5:29 PM soujanyash @.***> wrote:

C:\Users\djsou\CookieMonster\CookieMonster>java -version java version "16.0.2" 2021-07-20 Java(TM) SE Runtime Environment (build 16.0.2+7-67) Java HotSpot(TM) 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)

— Reply to this email directly, view it on GitHub https://github.com/benjholla/CookieMonster/issues/15#issuecomment-1659188845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGCUPKBDFYTWZPJAO7GAHLXTAPVLANCNFSM6AAAAAA262RGLQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

soujanyash commented 1 year ago

When I close the chrome completely and then run succceds. With running as administrator, same exception happens.

benjholla commented 1 year ago

Sounds like an issue introduced by new chrome behavior. We might be able to copy the file first. I'm not sure if chrome uses a read lock or just a write lock, but could be worth a try.

Something like: https://stackoverflow.com/questions/6167136/how-to-copy-a-file-while-it-is-being-used-by-another-process

On Tue, Aug 1, 2023, 11:49 AM soujanyash @.***> wrote:

When I close the chrome completely and then run succceds. With running as administrator, same exception happens.

— Reply to this email directly, view it on GitHub https://github.com/benjholla/CookieMonster/issues/15#issuecomment-1660598411, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGCUPLM6L7KWNTD4PNYHELXTEQOZANCNFSM6AAAAAA262RGLQ . You are receiving this because you commented.Message ID: @.***>

TiloGit commented 3 weeks ago
chrome.exe --disable-features=LockProfileCookieDatabase

https://stackoverflow.com/a/76442546/1747983