Last active
June 14, 2022 14:58
-
-
Save jimmy-ly00/ca4e23f264f32e2cb851b0b9e5a4d8dd to your computer and use it in GitHub Desktop.
Find PII (Personally Identifiable Information) using pdscan
This file contains hidden or 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
import glob | |
from selectors import EpollSelector | |
import subprocess | |
# Change these | |
ROOT_DIR = "/home/jimmy/desktop/spam" | |
PDSCAN_FILE = "/home/jimmy/desktop/pdscan" # Download from https://github.com/ankane/pdscan#installation | |
for filename in glob.iglob(ROOT_DIR + '**/**', recursive=True): | |
result = subprocess.run([PDSCAN_FILE, "file://" + filename,"--show-data", "--show-all"], capture_output=True, text=True) # remove "--show-all" for high confidence results | |
# print(result.stdout) | |
if "Empty buffer" in result.stdout or "No sensitive data found" in result.stdout: | |
pass | |
else: | |
print(result.stdout) | |
print("------------------------------------------------") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment