1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
|
# dborg - DB.org.ai CLI
CLI tool for querying the DB.org.ai API services.
## Project Structure
```
dborg/
├── cmd/ # CLI commands
│ ├── admin.go # Admin commands (build tag: admin)
│ ├── npd.go # NPD breach data search
│ ├── osint.go # OSINT tools (username, BSSID, BreachForum)
│ ├── reddit.go # Reddit data retrieval
│ ├── root.go # Root command configuration
│ ├── skiptrace.go # Premium skiptrace operations
│ ├── sl.go # Stealer logs search
│ ├── update.go # Auto-update functionality
│ ├── version.go # Version command
│ └── x.go # Twitter/X username history
├── internal/ # Private application code
│ ├── client/ # API client implementation
│ │ ├── admin.go # Admin API methods
│ │ ├── client.go # Base HTTP client
│ │ ├── client_test.go # Client tests
│ │ ├── npd.go # NPD API methods
│ │ ├── osint.go # OSINT API methods
│ │ ├── reddit.go # Reddit API methods
│ │ ├── skiptrace.go # Skiptrace API methods
│ │ ├── sl.go # Stealer logs API methods
│ │ ├── usrsx.go # Username check API methods
│ │ └── x.go # Twitter/X API methods
│ ├── config/ # Configuration management
│ │ ├── config.go # Config structure
│ │ └── errors.go # Custom errors
│ ├── models/ # Data models
│ │ ├── admin.go # Admin response types
│ │ ├── npd.go # NPD response types
│ │ ├── osint.go # OSINT response types
│ │ ├── reddit.go # Reddit response types
│ │ ├── skiptrace.go # Skiptrace response types
│ │ ├── sl.go # Stealer logs types
│ │ ├── usrsx.go # Username check types
│ │ └── x.go # Twitter/X types
│ └── utils/ # Utility functions
│ ├── output.go # Output formatting helpers
│ ├── version.go # Version checking and auto-update
│ └── version_test.go # Version utility tests
├── go.mod
├── go.sum
├── main.go
├── Makefile
└── README.md
```
## Installation
```bash
go install git.db.org.ai/dborg@latest
```
To build with admin commands:
```bash
make build-admin
```
Or:
```bash
go build -tags admin -o dborg .
```
### Auto-Update
The CLI automatically checks for updates on startup. When a newer version is available:
- You'll be prompted to update
- Accepts with `Y` or `Enter` to install the latest version via `go install git.db.org.ai/dborg@latest`
- The binary automatically restarts with the new version
- Skip with `n` to continue with your current version
Check your current version:
```bash
dborg version
```
## Configuration
### Initial Setup
Run the initialization command to set up your API key:
```bash
dborg init
```
This will prompt you to enter your API key and save it to `~/.config/dborg/config.json`.
### Alternative Configuration Methods
You can also set your API key via environment variable:
```bash
export DBORG_API_KEY=your_api_key_here
```
**Note:** Environment variables take precedence over the config file.
## Commands
### NPD - Search NPD breach data
```bash
dborg npd --firstname John --lastname Doe --max_hits 20
```
Available flags:
- `--id`, `--firstname`, `--lastname`, `--middlename`
- `--dob`, `--ssn`, `--phone1`
- `--address`, `--city`, `--st`, `--zip`, `--county_name`
- `--name_suff`, `--aka1fullname`, `--aka2fullname`, `--aka3fullname`
- `--alt1dob`, `--alt2dob`, `--alt3dob`, `--startdat`
- `--max_hits` (default: 10)
- `--sort_by`
### SL - Search stealer logs
```bash
dborg sl "domain.com" --max_hits 20 --format json
```
Available flags:
- `--max_hits` (default: 10)
- `--sort_by` (ingest_timestamp or date_posted)
- `--ingest_start_date`, `--ingest_end_date`
- `--posted_start_date`, `--posted_end_date`
- `--format` (json, ulp, up, pul, etc.)
### OSINT - Open Source Intelligence tools
#### Username Check
Check username availability across hundreds of websites using WhatsMyName dataset:
```bash
dborg osint username john_doe --sites GitHub,Twitter --max_tasks 100
```
Available flags:
- `--sites`, `-s` (comma-separated list of specific sites to check)
- `--fuzzy`, `-f` (enable fuzzy validation mode)
- `--max_tasks`, `-m` (maximum concurrent tasks, default: 50)
#### BSSID Lookup
Lookup WiFi access point location by BSSID (MAC address):
```bash
dborg osint bssid 00:11:22:33:44:55 --google --osm
```
Available flags:
- `--all`, `-a` (show all related results instead of exact match only)
- `--google`, `-g` (include Google Maps URL for the location)
- `--osm`, `-o` (include OpenStreetMap URL for the location)
#### BreachForum Search
Search BreachForum data from breachdetect index:
```bash
dborg osint breachforum "search term" --max_hits 20
```
Available flags:
- `--max_hits`, `-m` (maximum number of results, default: 10)
### Reddit - Reddit data retrieval
#### Subreddit Posts
```bash
dborg reddit subreddit posts programming
```
#### Subreddit Comments
```bash
dborg reddit subreddit comments programming
```
#### User Posts
```bash
dborg reddit user posts spez
```
#### User Comments
```bash
dborg reddit user comments spez
```
#### User Profile
```bash
dborg reddit user about spez
```
### Skiptrace - Premium people search (requires premium access)
**Note:** All skiptrace commands require a premium API key. Contact support to upgrade for premium access.
#### Search People
```bash
dborg skiptrace people --first-name John --last-name Doe --city Austin --state TX
```
Required flags:
- `--first-name`, `-f` (first name)
- `--last-name`, `-l` (last name)
Optional flags:
- `--city`, `-c` (city)
- `--state`, `-s` (state, 2-letter code)
- `--age`, `-a` (age)
#### Get Person Report
```bash
dborg skiptrace report SX_KEY 1
```
Args: `[sx_key]` `[selection]` from previous search results
#### Phone Lookup
```bash
dborg skiptrace phone 5551234567
```
Args: 10-digit phone number (no +1 prefix)
#### Email Lookup
```bash
dborg skiptrace email [email protected]
```
### X - Twitter/X username history
```bash
dborg x elonmusk
```
### Admin Commands (requires build tag)
Only available when built with `-tags admin`:
```bash
dborg admin list
dborg admin create john_doe --credits 1000 --unlimited
dborg admin delete API_KEY
dborg admin credits API_KEY 500
dborg admin disable API_KEY
dborg admin disable API_KEY --enable
```
## Architecture Benefits
The refactored structure provides:
1. **Separation of Concerns**: API logic is separated from CLI commands
2. **Testability**: Components can be easily unit tested
3. **Maintainability**: Clear organization makes code easier to maintain
4. **Reusability**: Client can be reused in other Go applications
5. **Error Handling**: Centralized error handling with custom error types
6. **Configuration Management**: Single source of truth for configuration
7. **Type Safety**: Strongly typed models for API requests/responses
## Building
Standard build (no admin commands):
```bash
make build
```
Build with admin commands:
```bash
make build-admin
```
Run tests:
```bash
go test ./...
```
Clean:
```bash
make clean
```
## Development
The codebase follows Go best practices:
- Internal packages for private implementation
- Interface-based design for testability
- Structured error handling
- Clear separation between CLI and business logic
- Comprehensive type definitions for API interactions
|