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

Introduction of the mail:password analyzer. #84

Closed
wants to merge 6 commits into from
Closed

Introduction of the mail:password analyzer. #84

wants to merge 6 commits into from

Conversation

funilrys
Copy link

@funilrys funilrys commented Oct 3, 2019

This patch fix #82

Also:

  • Edition of the mail analyzer in order to share its pattern.

It was fun to write this #hacktoberfest solution. I hope you don't mind my edits.

Cheers,
Nissar

This patch fix #82

Also:
  * Edition of the mail analyzer in order to share its pattern.
@coveralls
Copy link

coveralls commented Oct 3, 2019

Pull Request Test Coverage Report for Build 121

  • 13 of 15 (86.67%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 60.477%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pastepwn/analyzers/mailpasswordanalyzer.py 5 7 71.43%
Totals Coverage Status
Change from base Build 120: 0.1%
Covered Lines: 1622
Relevant Lines: 2682

💛 - Coveralls

@funilrys
Copy link
Author

funilrys commented Oct 3, 2019

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.
Cheers.

Copy link
Owner

@d-Rickyy-b d-Rickyy-b left a 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!

Copy link
Owner

@d-Rickyy-b d-Rickyy-b left a 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):
Copy link
Owner

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
Copy link
Owner

@d-Rickyy-b d-Rickyy-b Oct 3, 2019

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."
Copy link
Owner

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
Copy link
Owner

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 :)

Copy link
Owner

@d-Rickyy-b d-Rickyy-b left a 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.

@funilrys funilrys closed this Oct 6, 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.

Email and password pair analyzer
3 participants