-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract browser cookies support even if the application browser is running. #222
Comments
我也遇到了这个问题 |
+1 |
When the file utils/fileutil/fileutil.go line98-108 func CopyFile(src, dst string) error {
s, err := os.ReadFile(src) // The programe can't read Cookies because the file is locked by other process
if err != nil {
return err
}
err = os.WriteFile(dst, s, 0o600)
if err != nil {
return err
}
return nil
} Maybe its better to handle this case by skipping reading files, not throw errors. |
Yes, it could be the issue. I will release a major update in the coming weeks and this particular ISSUSE will be resolved at the same time. |
BTW, I wonder why don't you throw errors in place so you can keep the actual line number for debugging? It took me quite a while to adrress this issue. Finally I came up with a temp work around by commenting out these lines of code: browingdata/browingdata.go func (d *Data) addSources(items []item.Item) {
for _, source := range items {
switch source {
case item.ChromiumPassword:
d.sources[source] = &password.ChromiumPassword{}
// case item.ChromiumCookie:
// d.sources[source] = &cookie.ChromiumCookie{}
case item.ChromiumBookmark:
d.sources[source] = &bookmark.ChromiumBookmark{}
......
}
}
} PS: It will leave a file called |
@sheepdog0x3e Yep, it seems that the reason is that the temporary Cookie files were not deleted. On which platform did this ISSUSE occur? Windows or macOS? |
Windows. |
The core reason for this issue is the file I tried to copy this file mannually by using windows' So I comment (I find out that I can comment this line out then the program will not try to parse cookie. And I don't have to delete the temp file either) var DefaultChromium = []Item{
ChromiumKey,
ChromiumPassword,
// ChromiumCookie,
ChromiumBookmark,
ChromiumHistory,
ChromiumDownload,
ChromiumCreditCard,
ChromiumLocalStorage,
ChromiumSessionStorage,
ChromiumExtension,
} Maybe you should check if you have the priv to open target files first, if not, then continue to parse next item . |
@sheepdog0x3e Thanks Bro. The temporary solution is to disable |
作者大哥,什么时候能解决这个问题 |
Discuss the specific solution to this issue in this ISSUSE. 👇 |
Describe the bug
Use
./hack-browser-data -vv
paste result here[NOTICE] [browser.go:51,pickChromium] find browser Microsoft Edge success
[NOTICE] [browser.go:53,pickChromium] find browser microsoft_edge_default success
[NOTICE] [browser.go:47,pickChromium] find browser Chromium failed, profile folder does not exist
[NOTICE] [browser.go:47,pickChromium] find browser Vivaldi failed, profile folder does not exist
[NOTICE] [browser.go:47,pickChromium] find browser QQ failed, profile folder does not exist
[NOTICE] [browser.go:47,pickChromium] find browser Brave failed, profile folder does not exist
[NOTICE] [browser.go:47,pickChromium] find browser Yandex failed, profile folder does not exist
[NOTICE] [browser.go:47,pickChromium] find browser 360speed failed, profile folder does not exist
[NOTICE] [browser.go:51,pickChromium] find browser Chrome success
[NOTICE] [browser.go:53,pickChromium] find browser chrome_default success
[NOTICE] [browser.go:47,pickChromium] find browser Chrome Beta failed, profile folder does not exist
[NOTICE] [browser.go:47,pickChromium] find browser Opera failed, profile folder does not exist
[NOTICE] [browser.go:47,pickChromium] find browser OperaGX failed, profile folder does not exist
[NOTICE] [browser.go:47,pickChromium] find browser CocCoc failed, profile folder does not exist
[NOTICE] [browser.go:91,pickFirefox] find browser firefox Firefox failed, profile folder does not exist
[INFO] [chromium_windows.go:35,GetMasterKey] microsoft_edge_default initialized master key success
[NOTICE] [browsingdata.go:71,Output] output to file results/microsoft_edge_default_localstorage.csv success
[NOTICE] [browsingdata.go:71,Output] output to file results/microsoft_edge_default_extension.csv success
[NOTICE] [browsingdata.go:71,Output] output to file results/microsoft_edge_default_history.csv success
[NOTICE] [browsingdata.go:71,Output] output to file results/microsoft_edge_default_download.csv success
[NOTICE] [browsingdata.go:71,Output] output to file results/microsoft_edge_default_cookie.csv success
[ERROR] [main.go:60,func1] open C:\Users\Prisoner-Test\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies: The process cannot access the file because it is being used by another process.
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x82837b]
goroutine 1 [running]:
hack-browser-data/internal/browingdata.(*Data).Output(0xc000179420?, {0xa174b9, 0x7}, {0xc00027d690, 0xe}, {0xa12217?, 0x0?})
/source/internal/browingdata/browsingdata.go:51 +0x7b
main.Execute.func1(0xc000140240?)
/source/cmd/hack-browser-data/main.go:62 +0x23e
github.com/urfave/cli/v2.(*App).RunContext(0xc000041ba0, {0xa9bf48?, 0xc00001a0b8}, {0xc0000303e0, 0x2, 0x2})
/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/app.go:322 +0x97c
github.com/urfave/cli/v2.(*App).Run(...)
/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/app.go:224
main.Execute()
/source/cmd/hack-browser-data/main.go:73 +0x7f6
main.main()
/source/cmd/hack-browser-data/main.go:24 +0x17
Desktop (please complete the following information):
--
[ERROR] [main.go:60,func1] open C:\Users\Prisoner-Test\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies: The process cannot access the file because it is being used by another process.
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x82837b]
goroutine 1 [running]:
hack-browser-data/internal/browingdata.(*Data).Output(0xc0004378f0?, {0xc00001a100, 0x7}, {0xc000416670, 0xe}, {0xc00001a0e0?, 0x0?})
/source/internal/browingdata/browsingdata.go:51 +0x7b
main.Execute.func1(0xc000144240?)
/source/cmd/hack-browser-data/main.go:62 +0x23e
github.com/urfave/cli/v2.(*App).RunContext(0xc000041ba0, {0xa9bf48?, 0xc00001a118}, {0xc000102000, 0x8, 0x8})
/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/app.go:322 +0x97c
github.com/urfave/cli/v2.(*App).Run(...)
/go/pkg/mod/github.com/urfave/cli/v2@v2.4.0/app.go:224
main.Execute()
/source/cmd/hack-browser-data/main.go:73 +0x7f6
main.main()
/source/cmd/hack-browser-data/main.go:24 +0x17
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: