Skip to content

Commit f991ec2

Browse files
committed
K: add scanners for credit cards, social security numbers, and phone numbers
1 parent 26b6f56 commit f991ec2

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

scripts/scan.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
# TODO: write the script
1+
#!/bin/bash
2+
3+
# === K: Credit Card Scanner ===
4+
printf "\n====== SCANNING FOR CREDIT CARD NUMBERS ======\n"
5+
grep -rE --color=always '(\b[0-9]{4}[- ]?){3}[0-9]{4}\b' . --exclude-dir={.git} --line-number
6+
echo "========= CREDIT CARD SCAN COMPLETE =========="
7+
8+
# === L: Social Security Number Scanner ===
9+
printf "\n==== SCANNING FOR SOCIAL SECURITY NUMBERS ====\n"
10+
grep -rE --color=always '\b[0-9]{3}-[0-9]{2}-[0-9]{4}\b' . --exclude-dir={.git} --line-number
11+
echo "======= SOCIAL SECURITY SCAN COMPLETE ========"
12+
13+
# === M: Phone Number Scanner ===
14+
printf "\n========= SCANNING FOR PHONE NUMBERS =========\n"
15+
grep -rE --color=always '\b[0-9]{3}-[0-9]{3}-[0-9]{4}\b' . --exclude-dir={.git} --line-number
16+
grep -rE --color=always '\([0-9]{3}\) [0-9]{3}-[0-9]{4}' . --exclude-dir={.git} --line-number
17+
echo "========= PHONE NUMBER SCAN COMPLETE ========="

0 commit comments

Comments
 (0)