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

Added support for writing results as JSON. #119

Closed
wants to merge 1 commit into from

Conversation

itsbriany
Copy link

@itsbriany itsbriany commented Dec 11, 2018

Added the ability to dump results as JSON so that third party tools can process gobuster output. This should address issue #75.

Copy link
Owner

@OJ OJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against the idea of having JSON output to file, but the method used right now isn't good given the caching to memory. Please seen inline comments. Thank you.

@@ -65,6 +65,7 @@ All funds that are donated to this project will be donated to charity. A full lo
* `-l` - show the length of the response.
* `-n` - "no status" mode, disables the output of the result's status code.
* `-o <file>` - specify a file name to write the output to.
* `-oj <file>` - specify a file name to write the output as JSON.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single-letters only for parameters (thanks to the command line parsing).

@@ -33,6 +34,7 @@ type Gobuster struct {
context context.Context
requestsExpected int
requestsIssued int
cachedResults []Result
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bad idea. This will blow out memory big time for huge result sets. Data should be streamed out as it's captured rather that cached and then serialised in one hit.

@@ -145,13 +153,20 @@ func (g *Gobuster) worker(wordChan <-chan string, wg *sync.WaitGroup) {
continue
} else {
for _, r := range res {
g.cacheResult(r)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result should not be cached here.

g.resultChan <- r
}
}
}
}
}

func (g *Gobuster) cacheResult(r Result) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function not necessary. It should be handled in the result handler.

@firefart
Copy link
Collaborator

firefart commented Mar 4, 2019

@itsbriany can you also please taret the v3.0-working branch as this is the current development branch

@OJ
Copy link
Owner

OJ commented Mar 21, 2019

Ping @itsbriany, you still keen to get this moving?

@itsbriany
Copy link
Author

Hi @OJ, it doesn't look like I will be working on this any time soon. Feel free to take over or delegate the task to someone else. I still appreciate your feedback though!

@kulinacs kulinacs mentioned this pull request Apr 18, 2019
@OJ OJ closed this Jun 20, 2019
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.

None yet

3 participants