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

Regular laZagne output being sent to stderr instead of stdout #223

Closed
newlog opened this issue Mar 20, 2018 · 5 comments
Closed

Regular laZagne output being sent to stderr instead of stdout #223

newlog opened this issue Mar 20, 2018 · 5 comments

Comments

@newlog
Copy link

newlog commented Mar 20, 2018

Hi there!

First of all, thanks for your amazing work on this tool.

I'm starting to play a little bit with it and I realized that many logs (e.g. not found passwords) are sent to stderr.

For example, the category titles (e.g. "------------ Ssh ------------") are sent to stderr instead of stdout, along with the "No password found" string. In my opinion, this should also be part of the standard output given that it's not a tool execution error but rather regular tool output.

I saw that anything not using the do_print (write_output.py, L116) method is printing to stderr.

This is happening because in the verbosity (laZagne.py, L68) method, the logging.StreamHandler() is executed without parameters instead of something like logging.StreamHandler(stream=sys.stdout).

Is this by design or should it be changed? To be honest, having the categories and the password not found lines being sent to stderr makes the output really difficult to parse.

I want to parse both the successful hits and the failed category attempts. If I try it using the script output I have the problem regarding stderr and stdout. If I try to store it in a file, the failed attempts do not get logged :(

What do you think? Any workaround? I'd like to avoid a 2>&1 so I don't end up ignoring real errors.

If you find this reasonable (StreamHandler(stream=sys.stdout)), I can send a PR.

Thanks for your hard work!


As a side note:

From laZagne.py, L97. As far as I can tell, b will never exist, so modulesToLaunch will always be empty.

@AlessandroZ
Copy link
Owner

Hi @newlog , it's not by design so do not hesitate to do a PR.
I don't understand your side note, I think you checked an old code, now it's like that.
Be sure to use the last source code on your PR, because I have done some commit today.
Thanks.

@newlog
Copy link
Author

newlog commented Mar 22, 2018

Hey,

Perfect. I'll send a PR.

About the side note, it's in the Linux directory, not the Windows one ;) Actually, everything that I said, applied to the Linux version.

AlessandroZ added a commit that referenced this issue Mar 26, 2018
@AlessandroZ
Copy link
Owner

I don't remember at all why I used modulesToLaunch. I don't use it anymore, so I removed it. Thanks

@m41nt41n3r
Copy link
Contributor

This fix may be applied to windows version, isn't it?

@AlessandroZ
Copy link
Owner

It has already been applied to all versions (Windows, Linux and Mac)

AlessandroZ added a commit that referenced this issue Aug 14, 2018
AlessandroZ added a commit that referenced this issue Aug 14, 2018
Former-commit-id: 997c42555b29da3443e283198ea04eb4285d50f1 [formerly 71d205d]
Former-commit-id: 0800ba2ca7aa13f257540d19158194fb8bd1da7b
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

No branches or pull requests

3 participants