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

Dehashed Module #1133

Merged
merged 14 commits into from
Feb 18, 2021
Merged

Dehashed Module #1133

merged 14 commits into from
Feb 18, 2021

Conversation

krishnasism
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Jan 20, 2021

Codecov Report

Merging #1133 (47ff30a) into master (4ffad6a) will decrease coverage by 0.08%.
The diff coverage is 28.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1133      +/-   ##
==========================================
- Coverage   50.78%   50.69%   -0.09%     
==========================================
  Files         442      444       +2     
  Lines       35777    35946     +169     
==========================================
+ Hits        18168    18222      +54     
- Misses      17609    17724     +115     
Impacted Files Coverage Δ
modules/sfp_dehashed.py 18.51% <18.51%> (ø)
test/unit/modules/test_sfp_dehashed.py 60.00% <60.00%> (ø)
modules/sfp_pageinfo.py 32.35% <0.00%> (-3.14%) ⬇️
modules/sfp_shodan.py 18.37% <0.00%> (-1.63%) ⬇️
modules/sfp_s3bucket.py 22.12% <0.00%> (-0.40%) ⬇️
modules/sfp_binaryedge.py 13.18% <0.00%> (-0.15%) ⬇️
test/unit/spiderfoot/test_spiderfootdb.py 96.12% <0.00%> (+1.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ffad6a...47ff30a. Read the comment docs.

'api_key': 'Token for api key',
'per_page': 'Maximum number of results per page.(Max: 10000)',
'max_pages': 'Maximum number of pages to fetch(Max: 10 pages)',
'pause': 'Amount of time to wait before each API call'
Copy link
Owner

@smicallef smicallef Jan 21, 2021

Choose a reason for hiding this comment

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

"Number of seconds to wait between each API call."


# Option descriptions
optdescs = {
'api_key_username': 'Username for api key',
Copy link
Owner

@smicallef smicallef Jan 21, 2021

Choose a reason for hiding this comment

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

"Dehashed username."

# Option descriptions
optdescs = {
'api_key_username': 'Username for api key',
'api_key': 'Token for api key',
Copy link
Owner

Choose a reason for hiding this comment

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

"Dehashed API key."

self.notifyListeners(evt)

if password:
evt = SpiderFootEvent('PASSWORD_COMPROMISED', f"{email} : {password} [{leakSource}]", self.__name__, pevent)
Copy link
Owner

@smicallef smicallef Jan 21, 2021

Choose a reason for hiding this comment

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

Remove space before and after : (same as scylla module)

self.notifyListeners(evt)

if passwordHash:
evt = SpiderFootEvent('HASH_COMPROMISED', f"{email} : {passwordHash} [{leakSource}]", self.__name__, pevent)
Copy link
Owner

@smicallef smicallef Jan 21, 2021

Choose a reason for hiding this comment

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

Remove space before and after : (same as scylla module)

time.sleep(self.opts['pause'])

if res['code'] == "400":
self.sf.error("Too many requests were performed in a small amount of time. Please wait a bit before querying the API.")
Copy link
Owner

Choose a reason for hiding this comment

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

Not sure how useful such an error would be since it would occur mid-scan, and the SpiderFoot user wouldn't be able to do anything about it. Better if it backed off and tried again after a few seconds.

self.notifyListeners(evt)

if passwordHash:
evt = SpiderFootEvent('HASH_COMPROMISED', f"{email} : {passwordHash} [{leakSource}]", self.__name__, event)
Copy link
Owner

Choose a reason for hiding this comment

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

Remove space before and after : (same as scylla module)

self.notifyListeners(evt)

if password:
evt = SpiderFootEvent('PASSWORD_COMPROMISED', f"{email} : {password} [{leakSource}]", self.__name__, event)
Copy link
Owner

Choose a reason for hiding this comment

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

Remove space before and after : (same as scylla module)

headers=headers,
timeout=15,
useragent=self.opts['_useragent'],
verify=False)
Copy link
Owner

Choose a reason for hiding this comment

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

I'd leave verify enabled (default) since we are wanting to ensure certificate validity of the Dehashed endpoint.

Copy link
Owner

@smicallef smicallef left a comment

Choose a reason for hiding this comment

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

Just some minor feedback. I'll merge once updated. Thanks Krishnasis!

return None

# Handle events sent to this module
def handleEvent(self, event):
Copy link
Owner

Choose a reason for hiding this comment

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

This needs to prevent reporting duplicate events. If you test the module with airbnb.com, you'll see many of the same emails and breaches reported multiple times.

Copy link
Contributor Author

@krishnasism krishnasism Feb 10, 2021

Choose a reason for hiding this comment

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

Update :

  • Skipping same email + breached data
  • not reporting same emails

@smicallef smicallef merged commit e9490fa into smicallef:master Feb 18, 2021
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