Skip to content
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

Fix database file path location parser #188

Merged
merged 5 commits into from
Jul 8, 2023
Merged

Conversation

mr-pmillz
Copy link
Contributor

@mr-pmillz mr-pmillz commented Jul 8, 2023

I've encountered an issue in how absolute file paths are handled that are passed to the -D, --db-location flag.

Bug 🐛

https://github.com/sensepost/gowitness/blob/master/storage/db.go#L52 is missing logic to appropriately handle absolute file paths, for example:
'sqlite:///tmp/testing/gowitness.sqlite3' returns an empty string after being parsed via url.Parse() when calling the .Host method.

Expected Functionality

Ability to specify absolute file paths to the -D, --db-location argument.

Solution

I've implemented a helper function that fixes the issue and added some unit tests for verification.

Passing Tests

Tested it with two trial runs that garnered the desired functionality.
Test cases are passing:
image

Issue Representation Example Code

Here's an example demonstrating the issue: GoPlayground

Lemme know if this PR requires adjustments. 🍻

@leonjza
Copy link
Member

leonjza commented Jul 8, 2023

Amazing, thank you!

@leonjza leonjza merged commit ef4269b into sensepost:master Jul 8, 2023
@Hackndo
Copy link

Hackndo commented Oct 29, 2023

I was trying to fix this (bug still in release), but couldn't reproduce while compiling from source. Now I understand why. Thank you!

@leonjza
Copy link
Member

leonjza commented Oct 29, 2023

Ill roll a new release later today.

@leonjza
Copy link
Member

leonjza commented Oct 29, 2023

Landed in 2.5.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants