@feardread/fear 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/FEAR.js +459 -0
  2. package/FEARServer.js +280 -0
  3. package/controllers/agent.js +438 -0
  4. package/controllers/auth/index.js +345 -0
  5. package/controllers/auth/token.js +50 -0
  6. package/controllers/blog.js +105 -0
  7. package/controllers/brand.js +10 -0
  8. package/controllers/cart.js +425 -0
  9. package/controllers/category.js +9 -0
  10. package/controllers/coupon.js +63 -0
  11. package/controllers/crud/crud.js +508 -0
  12. package/controllers/crud/index.js +36 -0
  13. package/controllers/email.js +34 -0
  14. package/controllers/enquiry.js +65 -0
  15. package/controllers/events.js +9 -0
  16. package/controllers/order.js +125 -0
  17. package/controllers/payment.js +31 -0
  18. package/controllers/product.js +147 -0
  19. package/controllers/review.js +247 -0
  20. package/controllers/tag.js +10 -0
  21. package/controllers/task.js +10 -0
  22. package/controllers/upload.js +41 -0
  23. package/controllers/user.js +401 -0
  24. package/index.js +7 -0
  25. package/libs/agent/index.js +561 -0
  26. package/libs/agent/modules/ai/ai.js +285 -0
  27. package/libs/agent/modules/ai/chat.js +518 -0
  28. package/libs/agent/modules/ai/config.js +688 -0
  29. package/libs/agent/modules/ai/operations.js +787 -0
  30. package/libs/agent/modules/analyze/api.js +546 -0
  31. package/libs/agent/modules/analyze/dorks.js +395 -0
  32. package/libs/agent/modules/ccard/README.md +454 -0
  33. package/libs/agent/modules/ccard/audit.js +479 -0
  34. package/libs/agent/modules/ccard/checker.js +674 -0
  35. package/libs/agent/modules/ccard/payment-processors.json +16 -0
  36. package/libs/agent/modules/ccard/validator.js +629 -0
  37. package/libs/agent/modules/code/analyzer.js +303 -0
  38. package/libs/agent/modules/code/jquery.js +1093 -0
  39. package/libs/agent/modules/code/react.js +1536 -0
  40. package/libs/agent/modules/code/refactor.js +499 -0
  41. package/libs/agent/modules/crypto/exchange.js +564 -0
  42. package/libs/agent/modules/net/proxy.js +409 -0
  43. package/libs/agent/modules/security/cve.js +442 -0
  44. package/libs/agent/modules/security/monitor.js +360 -0
  45. package/libs/agent/modules/security/scanner.js +300 -0
  46. package/libs/agent/modules/security/vulnerability.js +506 -0
  47. package/libs/agent/modules/security/web.js +465 -0
  48. package/libs/agent/modules/utils/browser.js +492 -0
  49. package/libs/agent/modules/utils/colorizer.js +285 -0
  50. package/libs/agent/modules/utils/manager.js +478 -0
  51. package/libs/cloud/index.js +228 -0
  52. package/libs/config/db.js +21 -0
  53. package/libs/config/validator.js +82 -0
  54. package/libs/db/index.js +318 -0
  55. package/libs/emailer/imap.js +126 -0
  56. package/libs/emailer/info.js +41 -0
  57. package/libs/emailer/smtp.js +77 -0
  58. package/libs/handler/async.js +3 -0
  59. package/libs/handler/error.js +66 -0
  60. package/libs/handler/index.js +161 -0
  61. package/libs/logger/index.js +49 -0
  62. package/libs/logger/morgan.js +24 -0
  63. package/libs/passport/passport.js +109 -0
  64. package/libs/search/api.js +384 -0
  65. package/libs/search/features.js +219 -0
  66. package/libs/search/service.js +64 -0
  67. package/libs/swagger/config.js +18 -0
  68. package/libs/swagger/index.js +35 -0
  69. package/libs/validator/index.js +254 -0
  70. package/models/blog.js +31 -0
  71. package/models/brand.js +12 -0
  72. package/models/cart.js +14 -0
  73. package/models/category.js +11 -0
  74. package/models/coupon.js +9 -0
  75. package/models/customer.js +0 -0
  76. package/models/enquiry.js +29 -0
  77. package/models/events.js +13 -0
  78. package/models/order.js +94 -0
  79. package/models/product.js +32 -0
  80. package/models/review.js +14 -0
  81. package/models/tag.js +10 -0
  82. package/models/task.js +11 -0
  83. package/models/user.js +68 -0
  84. package/package.json +12 -0
  85. package/routes/agent.js +615 -0
  86. package/routes/auth.js +13 -0
  87. package/routes/blog.js +19 -0
  88. package/routes/brand.js +15 -0
  89. package/routes/cart.js +105 -0
  90. package/routes/category.js +16 -0
  91. package/routes/coupon.js +15 -0
  92. package/routes/enquiry.js +14 -0
  93. package/routes/events.js +16 -0
  94. package/routes/mail.js +170 -0
  95. package/routes/order.js +19 -0
  96. package/routes/product.js +22 -0
  97. package/routes/review.js +11 -0
  98. package/routes/task.js +12 -0
  99. package/routes/user.js +17 -0
@@ -0,0 +1,395 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const https = require('https');
4
+ const colorizer = require('../utils/colorizer');
5
+
6
+ /**
7
+ * Google Dorks Module
8
+ * Generates and manages Google dork queries for security reconnaissance
9
+ */
10
+ const GoogleDorks = function() {
11
+ const ensureOutputDir = () => {
12
+ if (!fs.existsSync(this.outputDir)) {
13
+ fs.mkdirSync(this.outputDir, { recursive: true });
14
+ }
15
+ }
16
+ this.outputDir = path.join(process.cwd(), 'dork-results');
17
+ ensureOutputDir();
18
+
19
+ // Predefined dork templates by category
20
+ this.dorkTemplates = {
21
+ 'sensitive-files': [
22
+ 'intitle:"index of" "password.txt"',
23
+ 'intitle:"index of" "config.php"',
24
+ 'intitle:"index of" ".env"',
25
+ 'intitle:"index of" "backup.sql"',
26
+ 'filetype:sql "password" site:',
27
+ 'filetype:log inurl:"access.log"',
28
+ 'filetype:bak inurl:"backup"',
29
+ 'ext:xml intext:"password"'
30
+ ],
31
+ 'login-pages': [
32
+ 'intitle:"login" site:',
33
+ 'inurl:admin intitle:"login"',
34
+ 'inurl:wp-admin site:',
35
+ 'intitle:"Dashboard" inurl:admin',
36
+ 'inurl:"/phpmyadmin" intitle:"phpMyAdmin"',
37
+ 'intitle:"Admin Login" OR intitle:"Administrator Login"'
38
+ ],
39
+ 'exposed-databases': [
40
+ 'intitle:"phpMyAdmin" "Welcome to phpMyAdmin"',
41
+ 'inurl:"/db/main.php" "phpMyAdmin"',
42
+ 'intitle:"index of" "database.sql"',
43
+ 'filetype:sql inurl:backup',
44
+ 'ext:sql intext:INSERT INTO',
45
+ 'inurl:mongoadmin'
46
+ ],
47
+ 'vulnerable-servers': [
48
+ 'intitle:"Apache Status" "Apache Server Status for"',
49
+ 'intitle:"Directory Listing For" inurl:logs',
50
+ 'intitle:"Index of" .bash_history',
51
+ 'intitle:"index of" "server-status"',
52
+ 'inurl:"/server-status" intitle:"Apache Status"'
53
+ ],
54
+ 'api-keys': [
55
+ 'filetype:env "API_KEY"',
56
+ 'filetype:log "api_key"',
57
+ 'filetype:json "api_key"',
58
+ '"Authorization: Bearer" filetype:log',
59
+ 'site:github.com "API_KEY" OR "API_SECRET"',
60
+ 'filetype:yml "api_key" OR "apikey"'
61
+ ],
62
+ 'cloud-storage': [
63
+ 'site:s3.amazonaws.com intitle:"index of"',
64
+ 'site:blob.core.windows.net intitle:"index of"',
65
+ 'site:storage.googleapis.com intitle:"index of"',
66
+ 'inurl:s3.amazonaws.com "Bucket Listing"',
67
+ 'site:s3.amazonaws.com filetype:xls OR filetype:csv'
68
+ ],
69
+ 'error-messages': [
70
+ 'intitle:"error" "sql syntax"',
71
+ 'intext:"Warning: mysql_" site:',
72
+ 'intext:"Uncaught exception" site:',
73
+ 'intitle:"500 Internal Server Error"',
74
+ 'intitle:"Exception Details" site:'
75
+ ],
76
+ 'credentials': [
77
+ 'filetype:xls inurl:"password"',
78
+ 'filetype:csv inurl:"username" inurl:"password"',
79
+ 'intext:"username" filetype:log',
80
+ 'ext:txt intext:"userid" intext:"password"',
81
+ 'filetype:config inurl:web.config intext:connectionString'
82
+ ],
83
+ 'webcams': [
84
+ 'inurl:"/view/view.shtml"',
85
+ 'intitle:"Live View / - AXIS"',
86
+ 'inurl:"/axis-cgi/mjpg"',
87
+ 'intitle:"EvoCam" inurl:"webcam.html"',
88
+ 'inurl:"viewerframe?mode="'
89
+ ],
90
+ 'vulnerable-apps': [
91
+ 'inurl:wp-content/uploads/ filetype:pdf',
92
+ 'inurl:"/jmx-console/" intitle:"JMX Management Console"',
93
+ 'intitle:"Jenkins" "Dashboard"',
94
+ 'intitle:"Grafana" inurl:"/login"',
95
+ 'intitle:"Kibana" inurl:"/app/kibana"'
96
+ ]
97
+ };
98
+ }
99
+
100
+ GoogleDorks.prototype = {
101
+ /**
102
+ * Show help and available commands
103
+ */
104
+ showHelp() {
105
+ console.log(colorizer.section('Google Dorks Module - Help'));
106
+ console.log();
107
+
108
+ console.log(colorizer.cyan('Available Commands:'));
109
+ console.log(colorizer.bullet('list-dorks [category] - List available dork templates'));
110
+ console.log(colorizer.bullet('generate-dork <target> - Generate dorks for a target domain'));
111
+ console.log(colorizer.bullet('custom-dork <query> - Create custom dork query'));
112
+ console.log(colorizer.bullet('dork-categories - Show all dork categories'));
113
+ console.log(colorizer.bullet('save-dorks <file> - Save generated dorks to file'));
114
+ console.log(colorizer.bullet('load-custom-dorks <file> - Load custom dorks from file'));
115
+ console.log(colorizer.bullet('dork-help - Show this help'));
116
+ console.log();
117
+
118
+ console.log(colorizer.cyan('Categories:'));
119
+ Object.keys(this.dorkTemplates).forEach(cat => {
120
+ console.log(colorizer.dim(` • ${cat} (${this.dorkTemplates[cat].length} dorks)`));
121
+ });
122
+ console.log();
123
+
124
+ console.log(colorizer.info('Examples:'));
125
+ console.log(colorizer.dim(' list-dorks sensitive-files'));
126
+ console.log(colorizer.dim(' generate-dork example.com'));
127
+ console.log(colorizer.dim(' custom-dork site:example.com filetype:pdf'));
128
+ console.log();
129
+
130
+ console.log(colorizer.warning('Legal Notice:'));
131
+ console.log(colorizer.dim(' Only use these dorks on systems you own or have explicit'));
132
+ console.log(colorizer.dim(' permission to test. Unauthorized access is illegal.'));
133
+ console.log();
134
+ },
135
+
136
+ /**
137
+ * List available dork categories
138
+ */
139
+ showCategories() {
140
+ console.log(colorizer.section('Available Dork Categories'));
141
+ console.log();
142
+
143
+ Object.entries(this.dorkTemplates).forEach(([category, dorks]) => {
144
+ console.log(colorizer.cyan(`${category.toUpperCase()}`));
145
+ console.log(colorizer.dim(` ${dorks.length} dork templates available`));
146
+ console.log(colorizer.dim(` Use: list-dorks ${category}`));
147
+ console.log();
148
+ });
149
+ },
150
+
151
+ /**
152
+ * List dorks by category
153
+ */
154
+ listDorks(args) {
155
+ const category = args[0];
156
+
157
+ if (!category) {
158
+ console.log(colorizer.section('All Available Dorks'));
159
+ console.log();
160
+
161
+ Object.entries(this.dorkTemplates).forEach(([cat, dorks]) => {
162
+ console.log(colorizer.cyan(`${cat.toUpperCase()} (${dorks.length} dorks)`));
163
+ dorks.forEach((dork, i) => {
164
+ console.log(colorizer.numbered(i + 1, dork));
165
+ });
166
+ console.log();
167
+ });
168
+ return;
169
+ }
170
+
171
+ if (!this.dorkTemplates[category]) {
172
+ console.log(colorizer.error(`Category "${category}" not found`));
173
+ console.log(colorizer.info('Available categories:'));
174
+ Object.keys(this.dorkTemplates).forEach(cat => {
175
+ console.log(colorizer.dim(` • ${cat}`));
176
+ });
177
+ return;
178
+ }
179
+
180
+ console.log(colorizer.section(`Dorks: ${category.toUpperCase()}`));
181
+ console.log();
182
+
183
+ this.dorkTemplates[category].forEach((dork, i) => {
184
+ console.log(colorizer.numbered(i + 1, dork));
185
+ });
186
+ console.log();
187
+ },
188
+
189
+ /**
190
+ * Generate dorks for a specific target
191
+ */
192
+ generateDork(args) {
193
+ const target = args[0];
194
+
195
+ if (!target) {
196
+ console.log(colorizer.error('Please provide a target domain'));
197
+ console.log(colorizer.info('Usage: generate-dork example.com'));
198
+ return;
199
+ }
200
+
201
+ console.log(colorizer.section(`Generated Dorks for: ${target}`));
202
+ console.log();
203
+
204
+ const results = {};
205
+
206
+ Object.entries(this.dorkTemplates).forEach(([category, dorks]) => {
207
+ results[category] = dorks.map(template => {
208
+ // Add site: operator to templates that support it
209
+ if (template.includes('site:') && !template.match(/site:\S+/)) {
210
+ return template.replace('site:', `site:${target}`);
211
+ } else if (!template.includes('site:')) {
212
+ return `${template} site:${target}`;
213
+ }
214
+ return template;
215
+ });
216
+ });
217
+
218
+ // Display results
219
+ Object.entries(results).forEach(([category, dorks]) => {
220
+ console.log(colorizer.cyan(`${category.toUpperCase()}`));
221
+ dorks.forEach((dork, i) => {
222
+ console.log(colorizer.numbered(i + 1, dork));
223
+ console.log(colorizer.dim(`https://www.google.com/search?q=${encodeURIComponent(dork)}`));
224
+ });
225
+ console.log();
226
+ });
227
+
228
+ // Save to file
229
+ const filename = `dorks_${target.replace(/\./g, '_')}_${Date.now()}.txt`;
230
+ const filepath = path.join(this.outputDir, filename);
231
+
232
+ const content = Object.entries(results)
233
+ .map(([cat, dorks]) => {
234
+ return `# ${cat.toUpperCase()}\n${dorks.map((d, i) => `${i + 1}. ${d}`).join('\n')}`;
235
+ })
236
+ .join('\n\n');
237
+
238
+ fs.writeFileSync(filepath, content);
239
+ console.log(colorizer.success(`Dorks saved to: ${filepath}`));
240
+ console.log();
241
+ },
242
+
243
+ /**
244
+ * Create custom dork query
245
+ */
246
+ customDork(args) {
247
+ if (args.length === 0) {
248
+ console.log(colorizer.error('Please provide a dork query'));
249
+ console.log();
250
+ console.log(colorizer.cyan('Google Dork Operators:'));
251
+ console.log(colorizer.bullet('site: - Limit to specific domain'));
252
+ console.log(colorizer.bullet('filetype: - Search specific file types'));
253
+ console.log(colorizer.bullet('intitle: - Search in page title'));
254
+ console.log(colorizer.bullet('inurl: - Search in URL'));
255
+ console.log(colorizer.bullet('intext: - Search in page text'));
256
+ console.log(colorizer.bullet('ext: - File extension'));
257
+ console.log(colorizer.bullet('cache: - Show cached version'));
258
+ console.log(colorizer.bullet('link: - Pages linking to URL'));
259
+ console.log(colorizer.bullet('related: - Similar pages'));
260
+ console.log();
261
+ console.log(colorizer.info('Example: custom-dork site:example.com filetype:pdf confidential'));
262
+ return;
263
+ }
264
+
265
+ const query = args.join(' ');
266
+ const encodedQuery = encodeURIComponent(query);
267
+ const searchUrl = `https://www.google.com/search?q=${encodedQuery}`;
268
+
269
+ console.log(colorizer.section('Custom Dork Query'));
270
+ console.log();
271
+ console.log(colorizer.cyan('Query: ') + colorizer.bright(query));
272
+ console.log(colorizer.cyan('URL: ') + colorizer.dim(searchUrl));
273
+ console.log();
274
+
275
+ // Save to history
276
+ const historyFile = path.join(this.outputDir, 'dork_history.txt');
277
+ const timestamp = new Date().toISOString();
278
+ fs.appendFileSync(historyFile, `[${timestamp}] ${query}\n`);
279
+
280
+ console.log(colorizer.success(`✓ Query saved to history`));
281
+ console.log();
282
+ },
283
+
284
+ /**
285
+ * Save dorks to file
286
+ */
287
+ saveDorks(args) {
288
+ const filename = args[0] || `dorks_${Date.now()}.txt`;
289
+ const filepath = path.join(this.outputDir, filename);
290
+
291
+ const content = Object.entries(this.dorkTemplates)
292
+ .map(([category, dorks]) => {
293
+ return `# ${category.toUpperCase()}\n${dorks.map((d, i) => `${i + 1}. ${d}`).join('\n')}`;
294
+ })
295
+ .join('\n\n');
296
+
297
+ fs.writeFileSync(filepath, content);
298
+
299
+ console.log(colorizer.success(`✓ Dorks saved to: ${filepath}`));
300
+ console.log(colorizer.info(`Total dorks: ${Object.values(this.dorkTemplates).flat().length}`));
301
+ console.log();
302
+ },
303
+
304
+ /**
305
+ * Load custom dorks from file
306
+ */
307
+ loadCustomDorks(args) {
308
+ const filename = args[0];
309
+
310
+ if (!filename) {
311
+ console.log(colorizer.error('Please provide a filename'));
312
+ console.log(colorizer.info('Usage: load-custom-dorks mydorks.txt'));
313
+ return;
314
+ }
315
+
316
+ const filepath = fs.existsSync(filename) ? filename : path.join(this.outputDir, filename);
317
+
318
+ if (!fs.existsSync(filepath)) {
319
+ console.log(colorizer.error(`File not found: ${filepath}`));
320
+ return;
321
+ }
322
+
323
+ try {
324
+ const content = fs.readFileSync(filepath, 'utf8');
325
+ const lines = content.split('\n').filter(line => line.trim() && !line.startsWith('#'));
326
+
327
+ if (lines.length === 0) {
328
+ console.log(colorizer.warning('No valid dorks found in file'));
329
+ return;
330
+ }
331
+
332
+ // Add to custom category
333
+ if (!this.dorkTemplates['custom']) {
334
+ this.dorkTemplates['custom'] = [];
335
+ }
336
+
337
+ this.dorkTemplates['custom'] = [
338
+ ...this.dorkTemplates['custom'],
339
+ ...lines.map(l => l.replace(/^\d+\.\s*/, '').trim())
340
+ ];
341
+
342
+ console.log(colorizer.success(`✓ Loaded ${lines.length} custom dorks`));
343
+ console.log(colorizer.info('Use: list-dorks custom'));
344
+ console.log();
345
+
346
+ } catch (err) {
347
+ console.log(colorizer.error(`Failed to load dorks: ${err.message}`));
348
+ }
349
+ },
350
+ /**
351
+ * Generate advanced dorks with combinations
352
+ */
353
+ generateAdvancedDorks(args) {
354
+ const target = args[0];
355
+
356
+ if (!target) {
357
+ console.log(colorizer.error('Please provide a target domain'));
358
+ return;
359
+ }
360
+
361
+ console.log(colorizer.section(`Advanced Dorks for: ${target}`));
362
+ console.log();
363
+
364
+ // Advanced combination dorks
365
+ const advanced = [
366
+ `site:${target} (ext:xml OR ext:conf OR ext:cnf OR ext:reg OR ext:inf OR ext:rdp OR ext:cfg OR ext:txt OR ext:ora OR ext:ini)`,
367
+ `site:${target} intext:"sql syntax near" OR intext:"syntax error has occurred" OR intext:"incorrect syntax near"`,
368
+ `site:${target} intext:"Warning: mysql_connect()" OR intext:"Warning: mysql_query()"`,
369
+ `site:${target} (inurl:backup OR inurl:old OR inurl:bak OR inurl:copy)`,
370
+ `site:${target} (intitle:"index of" OR intitle:"directory listing") (password OR passwords OR passwd)`,
371
+ `site:${target} filetype:log intext:"password" OR intext:"username"`,
372
+ `site:${target} inurl:admin OR inurl:administrator OR inurl:login OR inurl:wp-admin`,
373
+ `site:${target} (inurl:phpinfo.php OR inurl:info.php OR inurl:test.php)`,
374
+ `site:${target} ext:sql (intext:"insert into" OR intext:"create table")`,
375
+ `site:${target} (filetype:env OR filetype:yml) (intext:"api_key" OR intext:"password")`
376
+ ];
377
+
378
+ console.log(colorizer.cyan('ADVANCED COMBINATION DORKS'));
379
+ advanced.forEach((dork, i) => {
380
+ console.log(colorizer.numbered(i + 1, dork));
381
+ console.log(colorizer.dim(` → https://www.google.com/search?q=${encodeURIComponent(dork)}`));
382
+ });
383
+ console.log();
384
+
385
+ // Save
386
+ const filename = `advanced_dorks_${target.replace(/\./g, '_')}_${Date.now()}.txt`;
387
+ const filepath = path.join(this.outputDir, filename);
388
+ fs.writeFileSync(filepath, advanced.join('\n'));
389
+
390
+ console.log(colorizer.success(`Advanced dorks saved to: ${filepath}`));
391
+ console.log();
392
+ }
393
+ }
394
+
395
+ module.exports = GoogleDorks;