● Notice //GitHub (@shehzade) is temporarily suspended pending an automated false-positive review. All tools are hosted on this Code Mirror and available on request (contact); GitHub links will return once reinstated.
PUBLIC MIRRORGo v1.0

Multi-protocol network egress assessment and DLP verification framework featuring automated L4 sweeps, corporate proxy traversal, and covert protocol smuggling across 20+ channels.

$ git clone https://shehzade.io/repos/contraband.git Copy
Source ZIP (1.93 MB)
Code 174 Commits 1
contraband / pkg / client / dlp / pii.go
← Back to directory
88 lines · 3.9 KB
Raw
1package dlp
2
3import (
4 "fmt"
5 "math/rand"
6 "strings"
7)
8
9type EmployeeProfile struct {
10 ID string `json:"id"`
11 FirstName string `json:"first_name"`
12 LastName string `json:"last_name"`
13 Email string `json:"email"`
14 PhoneUS string `json:"phone_us"`
15 PhoneE164 string `json:"phone_e164"`
16 Department string `json:"department"`
17 JobTitle string `json:"job_title"`
18 Street string `json:"street"`
19 City string `json:"city"`
20 State string `json:"state"`
21 ZIP string `json:"zip"`
22 SSN string `json:"ssn"`
23 Salary int `json:"salary"`
24}
25
26var firstNames = []string{"James", "Mary", "Robert", "Patricia", "John", "Jennifer", "Michael", "Linda", "David", "Elizabeth", "William", "Barbara", "Richard", "Susan", "Joseph", "Jessica", "Thomas", "Sarah", "Charles", "Karen", "Christopher", "Nancy", "Daniel", "Lisa", "Matthew", "Margaret", "Anthony", "Betty", "Donald", "Sandra", "Mark", "Ashley", "Paul", "Dorothy", "Steven", "Kimberly", "Andrew", "Emily", "Kenneth", "Donna"}
27var lastNames = []string{"Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller", "Davis", "Rodriguez", "Martinez", "Hernandez", "Lopez", "Gonzalez", "Wilson", "Anderson", "Thomas", "Taylor", "Moore", "Jackson", "Martin", "Lee", "Perez", "Thompson", "White", "Harris", "Sanchez", "Clark", "Ramirez", "Lewis", "Robinson", "Walker", "Young", "Allen", "King", "Wright", "Scott", "Torres", "Nguyen", "Hill", "Flores"}
28var departments = []string{"Engineering", "Information Security", "Finance", "Legal", "Human Resources", "Product Management", "Sales Operations", "Customer Support", "Executive"}
29var jobTitles = []string{"Senior Software Engineer", "Staff Security Architect", "Financial Analyst", "Corporate Counsel", "HR Business Partner", "Lead Product Manager", "Enterprise Account Exec", "DevOps Engineer", "Director of Infrastructure"}
30var streets = []string{"Market St", "Main St", "Silicon Way", "Park Ave", "Lexington Ave", "Oak St", "Pine Rd", "Cedar Ln", "Maple Blvd", "Washington St"}
31var citiesStates = []struct{ City, State, ZIPPrefix string }{
32 {"San Francisco", "CA", "941"},
33 {"New York", "NY", "100"},
34 {"Austin", "TX", "787"},
35 {"Seattle", "WA", "981"},
36 {"Chicago", "IL", "606"},
37 {"Boston", "MA", "021"},
38}
39
40func GenerateRandomName(r *rand.Rand) string {
41 return firstNames[r.Intn(len(firstNames))] + " " + lastNames[r.Intn(len(lastNames))]
42}
43
44func GenerateRandomPhone(r *rand.Rand) string {
45 area := 200 + r.Intn(800)
46 prefix := 200 + r.Intn(800)
47 line := 1000 + r.Intn(9000)
48 return fmt.Sprintf("(%d) %d-%04d", area, prefix, line)
49}
50
51func GenerateRandomAddress(r *rand.Rand) string {
52 num := 100 + r.Intn(9900)
53 street := streets[r.Intn(len(streets))]
54 cs := citiesStates[r.Intn(len(citiesStates))]
55 zip := fmt.Sprintf("%s%02d", cs.ZIPPrefix, r.Intn(100))
56 return fmt.Sprintf("%d %s, %s, %s %s", num, street, cs.City, cs.State, zip)
57}
58
59func GenerateEmployeeProfile(r *rand.Rand, domain string) EmployeeProfile {
60 fn := firstNames[r.Intn(len(firstNames))]
61 ln := lastNames[r.Intn(len(lastNames))]
62 if domain == "" {
63 domain = "acme-corp.internal"
64 }
65 email := fmt.Sprintf("%s.%s@%s", strings.ToLower(fn), strings.ToLower(ln), domain)
66 cs := citiesStates[r.Intn(len(citiesStates))]
67 zip := fmt.Sprintf("%s%02d", cs.ZIPPrefix, r.Intn(100))
68 area := 200 + r.Intn(800)
69 pfx := 200 + r.Intn(800)
70 line := 1000 + r.Intn(9000)
71
72 return EmployeeProfile{
73 ID: fmt.Sprintf("EMP-%06d", r.Intn(1000000)),
74 FirstName: fn,
75 LastName: ln,
76 Email: email,
77 PhoneUS: fmt.Sprintf("(%d) %d-%04d", area, pfx, line),
78 PhoneE164: fmt.Sprintf("+1%d%d%04d", area, pfx, line),
79 Department: departments[r.Intn(len(departments))],
80 JobTitle: jobTitles[r.Intn(len(jobTitles))],
81 Street: fmt.Sprintf("%d %s", 100+r.Intn(9900), streets[r.Intn(len(streets))]),
82 City: cs.City,
83 State: cs.State,
84 ZIP: zip,
85 SSN: GenerateSSN(r, true),
86 Salary: 65000 + r.Intn(140000),
87 }
88}