-
Notifications
You must be signed in to change notification settings - Fork 67
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
Introduction of the mail:password analyzer. #84
Conversation
This patch fix #82 Also: * Edition of the mail analyzer in order to share its pattern.
Pull Request Test Coverage Report for Build 121
💛 - Coveralls |
If you ask yourself why there is a syntax issue, it's probably because of my usage of Black, The uncompromising Python code formatter. Feel free to fix yourself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very well done. Thank you for your contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed two minor issues. When you fix them, I will merge this PR :)
from pastepwn.analyzers.mailpasswordanalyzer import MailPasswordAnalyzer | ||
|
||
|
||
class TestDBConnAnalyzer(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this one 🙈 .
import unittest | ||
from unittest import mock | ||
|
||
from pastepwn.analyzers.mailpasswordanalyzer import MailPasswordAnalyzer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to do from pastepwn.analyzers import MailPasswordAnalyzer
if you add the analyzer to the package init file
for positive in positives: | ||
self.paste.body = positive | ||
self.assertTrue( | ||
self.analyzer.match(self.paste), f"{positive} do not match." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And as you stated in your comment, this somehow fails on Python 3.5 and earlier (see Travis). Maybe you can change it so that it does work with python 3.4 at least.
"{0} do not match.".format(positive)
should work.
from .pastebinurlanalyzer import PastebinURLAnalyzer | ||
from .privatekeyanalyzer import PrivateKeyAnalyzer | ||
from .regexanalyzer import RegexAnalyzer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sorting could lead to circular imports but I will check that myself before merging - no worries :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes! Looks good. Doing some testing later and merging eventually.
This patch fix #82
Also:
It was fun to write this #hacktoberfest solution. I hope you don't mind my edits.
Cheers,
Nissar