-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replaced locationtagger with geotext
- Loading branch information
Showing
9 changed files
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ MIT License | |
|
||
Copyright (c) 2023 Owais Shaikh | ||
Research @ RedHunt Labs Pvt Ltd | ||
Email: [email protected] | [email protected] | ||
Email: [email protected] | [email protected] | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,4 +163,6 @@ This tool is intended for research and educational purposes only. RedHunt Labs a | |
|
||
Copyright © 2023 RedHunt Labs Private Limited. | ||
|
||
By Owais Shaikh ([email protected] | [email protected]) | ||
By Owais Shaikh | ||
- Work: [email protected] | ||
- Personal: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
Copyright (c) Research @ RedHunt Labs Pvt Ltd | ||
Written by Owais Shaikh | ||
Email: [email protected] | [email protected] | ||
Email: [email protected] | [email protected] | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
Copyright (c) Research @ RedHunt Labs Pvt Ltd | ||
Written by Owais Shaikh | ||
Email: [email protected] | [email protected] | ||
Email: [email protected] | [email protected] | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
Copyright (c) Research @ RedHunt Labs Pvt Ltd | ||
Written by Owais Shaikh | ||
Email: [email protected] | [email protected] | ||
Email: [email protected] | [email protected] | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -42,7 +42,7 @@ def print_logo(): | |
⠀⠀⠀⠀⠀⡳⠀⠧⣤⡳⣝⢤⠼⠀⡯⠀⠀⠈⠀ A PII scanner | ||
⠀⠀⠀⠀⢀⣈⣋⣋⠮⡻⡪⢯⣋⢓⣉⡀ ______________ | ||
⠀⠀⠀⢀⣳⡁⡡⣅⠀⡗⣝⠀⡨⣅⢁⣗⠀⠀ (c) 2023 RedHunt Labs Pvt Ltd | ||
⠀⠀⠀⠀⠈⠀⠸⣊⣀⡝⢸⣀⣸⠊⠀⠉⠀⠀⠀⠀by Owais Shaikh | ||
⠀⠀⠀⠀⠈⠀⠸⣊⣀⡝⢸⣀⣸⠊⠀⠉⠀⠀⠀⠀by Owais Shaikh ([email protected] | [email protected]) | ||
⠀⠀⠀⠀⠀⠀⠀⠈⠈⠀⠀⠈⠈''' | ||
print (logo) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
Copyright (c) Research @ RedHunt Labs Pvt Ltd | ||
Written by Owais Shaikh | ||
Email: [email protected] | [email protected] | ||
Email: [email protected] | [email protected] | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -101,17 +101,10 @@ def read_pdf(pdf): | |
|
||
# python -m spacy download en_core_web_sm | ||
def regional_pii(text): | ||
import locationtagger | ||
try: | ||
place_entity = locationtagger.find_locations(text = text) | ||
except LookupError: | ||
nltk.downloader.download('punkt') | ||
nltk.download('averaged_perceptron_tagger') | ||
nltk.download('maxent_ne_chunker') | ||
nltk.download('words') | ||
place_entity = locationtagger.find_locations(text = text) | ||
from geotext import GeoText | ||
place_entity = GeoText(text) | ||
|
||
final_output = place_entity.address_strings + place_entity.regions + place_entity.countries | ||
final_output = list(set(place_entity.cities + place_entity.countries) | ||
return final_output | ||
|
||
def keywords_classify_pii(rules, intelligible_text_list): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
MIT License | ||
Copyright (c) Research @ RedHunt Labs Pvt Ltd | ||
Written by Owais Shaikh | ||
Email: [email protected] | [email protected] | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
""" | ||
|
||
import requests | ||
|
||
def push_data(data: str, url: str): | ||
headers = {'Content-type': 'application/json'} | ||
data = f"{"text":'{data}'}" | ||
|
||
req = requests.post ( | ||
url, # Example: https://hooks.slack.com/services/<>/<>/<> | ||
headers=headers, | ||
data=data, | ||
timeout=7 | ||
) | ||
|
||
if req is not None and req.status_code == 200: print('Scan results sent to webhook.') | ||
else: print('Couldn\'t send scan results to webhook. Reason: ' + req.text) |