-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
634 lines (634 loc) · 36.3 KB
/
Copy pathscript.js
File metadata and controls
634 lines (634 loc) · 36.3 KB
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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
(function(){
"use strict";
const MAX_LEN=80;
const MAX_DOM=60;
const MAX_NUM=12;
const VERSION="2.2.0";
const LIVE_MAX=12;
const LIVE_DELAY_MS=450;
let unloginall="";
let unemailall="";
let lastNames=[];
let lastLogins=[];
let lastEmails=[];
let liveRunning=false;
function escapeHtml(s){
if(s==null||s===undefined)return"";
return String(s).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");
}
function encodeQ(s){
return encodeURIComponent(String(s||""));
}
function sanitizeName(raw){
if(typeof raw!=="string")return"";
let t=raw.trim().replace(/[\u0000-\u001F\u007F]/g,"");
t=t.replace(/[^\p{L}\p{N}\s\-\.'\u2019]/gu,"");
return t.substring(0,MAX_LEN);
}
function sanitizeNum(raw){
if(typeof raw!=="string")return"";
return raw.trim().replace(/[^\d]/g,"").substring(0,MAX_NUM);
}
function sanitizeDomain(raw){
if(typeof raw!=="string")return"";
let t=raw.trim().toLowerCase().replace(/[^a-z0-9.\-]/g,"");
if(t.length>MAX_DOM)t=t.substring(0,MAX_DOM);
if(!/^[a-z0-9]([a-z0-9\-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9\-]*[a-z0-9])?)+$/.test(t))return"";
return t;
}
function isLikelyHandle(s){
if(!s||s.length<3)return false;
return !/\s/.test(s)&&(/[0-9_\-\.]/.test(s)||s===s.toLowerCase());
}
function uniqueScored(arr){
const seen=new Map();
const out=[];
for(const item of arr){
if(!item||!item.v||typeof item.v!=="string")continue;
const k=item.v.toLowerCase();
if(k.length<2)continue;
if(seen.has(k)){
if(item.s>seen.get(k).s)seen.set(k,item);
}else{
seen.set(k,item);
}
}
seen.forEach(v=>out.push(v));
out.sort((a,b)=>b.s-a.s||a.v.localeCompare(b.v));
return out;
}
function scoreName(p,base){
let s=40;
if(p===base.fl||p===base.lf)s=95;
else if(p===base.fdotl||p===base.ldotf)s=90;
else if(p===base.fi||p===base.li)s=75;
else if(p===base.l)s=70;
else if(p.indexOf(" " )>-1)s=85;
else s=55;
if(p.length<3)s-=20;
if(p.length>40)s-=15;
return Math.max(5,Math.min(99,s));
}
function scoreLogin(p,base){
let s=50;
const common=["."+base.ll,base.fl+base.ll,base.fl+"."+base.ll,base.fl+"_"+base.ll,base.fl+"-"+base.ll,base.fi+base.ll,base.fl];
if(common.indexOf(p)>-1||p===base.fl+"."+base.ll||p===base.fl+base.ll)s=92;
else if(p.indexOf(".")>-1||p.indexOf("_")>-1)s=80;
else if(/[0-9]/.test(p))s=78;
else if(p===base.fl||p===base.ll)s=70;
else s=60;
if(p.length<3)s-=25;
if(p.length>32)s-=10;
return Math.max(5,Math.min(99,s));
}
function leet(s){
return s.replace(/a/gi,"4").replace(/e/gi,"3").replace(/i/gi,"1").replace(/o/gi,"0").replace(/s/gi,"5");
}
function tableToJson(table){
const data=[];
if(!table)return data;
const headers=Array.from(table.querySelectorAll("thead th")).map(th=>th.textContent.trim());
const rows=table.querySelectorAll("tbody tr");
rows.forEach(row=>{
const rowData={};
const cells=row.querySelectorAll("td");
cells.forEach((cell,index)=>{
if(index>=headers.length)return;
const link=cell.querySelector("a");
rowData[headers[index]]=link?link.getAttribute("href")||"":cell.textContent.trim();
});
data.push(rowData);
});
return data;
}
function downloadBlob(content,fileName,mime){
try{
const blob=new Blob([content],{type:mime||"application/octet-stream"});
const url=URL.createObjectURL(blob);
const a=document.createElement("a");
a.href=url;
a.download=fileName;
a.rel="noopener";
document.body.appendChild(a);
a.click();
setTimeout(()=>{
try{document.body.removeChild(a);}catch(e){}
URL.revokeObjectURL(url);
},120);
}catch(err){}
}
function downloadJson(tablename){
try{
const table=document.getElementById(tablename+"-table");
if(!table)return;
const json=tableToJson(table);
downloadBlob(JSON.stringify(json,null,2),"IdentityForge-"+tablename+"-results.json","application/json");
}catch(err){}
}
function downloadCsv(list,prefix){
if(!list||!list.length)return;
const lines=["pattern,score"];
list.forEach(i=>lines.push('"'+String(i.v).replace(/"/g,'""')+'",'+i.s));
downloadBlob(lines.join("\n"),"IdentityForge-"+prefix+".csv","text/csv;charset=utf-8");
}
function downloadMd(names,logins,notes){
const ts=new Date().toISOString();
let md="# IdentityForge Investigation Report\n\nGenerated: "+ts+"\nVersion: "+VERSION+"\n\n";
if(notes)md+="## Analyst Notes\n\n"+notes+"\n\n";
md+="## Name Patterns\n\n";
names.forEach(i=>md+="- `"+i.v+"` (score "+i.s+")\n");
md+="\n## Login / Username Patterns\n\n";
logins.forEach(i=>md+="- `"+i.v+"` (score "+i.s+")\n");
md+="\n---\n*For authorized OSINT use only. Verify all leads manually.*\n";
downloadBlob(md,"IdentityForge-report.md","text/markdown;charset=utf-8");
}
function copyText(txt){
try{
if(navigator.clipboard&&navigator.clipboard.writeText){
navigator.clipboard.writeText(txt).then(()=>showToast("Copied")).catch(()=>fallbackCopy(txt));
}else fallbackCopy(txt);
}catch(e){fallbackCopy(txt);}
}
function fallbackCopy(txt){
try{
const ta=document.createElement("textarea");
ta.value=txt;
ta.style.position="fixed";
ta.style.left="-9999px";
document.body.appendChild(ta);
ta.select();
document.execCommand("copy");
document.body.removeChild(ta);
showToast("Copied");
}catch(e){}
}
function showToast(msg){
let t=document.getElementById("if-toast");
if(!t){
t=document.createElement("div");
t.id="if-toast";
t.className="if-toast";
document.body.appendChild(t);
}
t.textContent=msg;
t.classList.add("show");
setTimeout(()=>t.classList.remove("show"),1800);
}
function emtools(value){
const e=encodeQ(value);
return '<a href="https://epieos.com/?q='+e+'" target="_blank" rel="noopener noreferrer">Epieos</a><br><a href="https://predictasearch.com/?q='+e+'" target="_blank" rel="noopener noreferrer">Predicta</a><br><a href="https://www.google.com/search?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer"><i class="bi-google"></i></a> / <a href="https://www.google.com/search?q=%22'+e+'%22&tbm=isch" target="_blank" rel="noopener noreferrer"><i class="bi bi-person-square"></i></a><br><a href="https://www.bing.com/search?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer">Bing</a> / <a href="https://yandex.com/search/?text=%22'+e+'%22" target="_blank" rel="noopener noreferrer">Yandex</a> / <a href="https://duckduckgo.com/?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer">DDG</a>';
}
function nogh(img){
try{
if(img&&img.parentNode){
img.onerror=null;
img.parentNode.innerHTML='<i class="bi bi-github"></i> N/A';
}
}catch(e){}
return true;
}
function buildNameRow(item,f,l,linumRef){
const value=item.v;
const s=escapeHtml(value);
const e=encodeQ(value);
const badge=item.s>=85?'<span class="badge bg-success badge-score">'+item.s+'</span>':item.s>=70?'<span class="badge bg-primary badge-score">'+item.s+'</span>':'<span class="badge bg-secondary badge-score">'+item.s+'</span>';
let row='<tr><td style="width:20%">'+badge+' '+s+'</td>';
row+='<td><a href="https://www.google.com/search?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer"><i class="bi-google"></i></a></td>';
row+='<td><a href="https://duckduckgo.com/?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer">DDG</a></td>';
row+='<td><a href="https://search.brave.com/search?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer">Brave</a></td>';
row+='<td><a href="https://www.google.com/search?q=%22'+e+'%22&tbs=itp:face&tbm=isch" target="_blank" rel="noopener noreferrer"><i class="bi bi-person-square"></i></a></td>';
row+='<td><a href="https://www.google.com/search?q=%22'+e+'%22+AND+(%E2%9C%86+OR+%E2%98%8E+OR+%E2%98%8F+OR+%F0%9F%93%B1+OR+%F0%9F%93%9E)" target="_blank" rel="noopener noreferrer"><i class="bi bi-telephone-fill"></i></a></td>';
row+='<td><a href="https://www.google.com/search?q=%22'+e+'%22+AND+(%F0%9F%93%A7+OR+%F0%9F%93%A8+OR+%F0%9F%93%A9+OR+%E2%9C%89)" target="_blank" rel="noopener noreferrer"><i class="bi bi-envelope"></i></a></td>';
row+='<td><a href="https://www.google.com/maps/search/%22'+e+'%22" target="_blank" rel="noopener noreferrer"><i class="bi bi-map"></i></a></td>';
row+='<td><a href="https://www.google.com/search?q=%22'+e+'%22+ext:pdf" target="_blank" rel="noopener noreferrer"><i class="bi bi-filetype-pdf"></i></a></td>';
row+='<td><a href="https://www.bing.com/search?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer">Bing</a></td>';
row+='<td><a href="https://yandex.com/search/?text=%22'+e+'%22" target="_blank" rel="noopener noreferrer">Yandex</a></td>';
row+='<td><a href="https://www.reddit.com/search/?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer">Reddit</a></td>';
row+='<td><a href="https://github.com/search?q='+e+'&type=users" target="_blank" rel="noopener noreferrer">GH</a></td>';
row+='<td><a href="https://web.archive.org/web/*/'+e+'" target="_blank" rel="noopener noreferrer">Archive</a></td>';
row+='<td><a href="https://www.facebook.com/public/'+e+'" target="_blank" rel="noopener noreferrer"><i class="bi-facebook"></i></a></td>';
row+='<td><a href="https://x.com/search?q='+e+'&src=typed_query&f=user" target="_blank" rel="noopener noreferrer"><i class="bi-twitter-x"></i></a></td>';
row+='<td><a href="https://www.tiktok.com/search/user?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer"><i class="bi-tiktok"></i></a></td>';
row+='<td><a href="https://www.flickr.com/search/people/?username=%22'+e+'%22" target="_blank" rel="noopener noreferrer"><i class="bi-camera2"></i></a></td>';
row+='<td><a href="https://vk.com/search?c%5Bname%5D=1&c%5Bper_page%5D=40&c%5Bq%5D='+e+'&c%5Bsection%5D=people" target="_blank" rel="noopener noreferrer">vk</a></td>';
row+='<td>';
if(linumRef.v===0){
const ef=encodeQ(f);const el=encodeQ(l);
row+='<a href="https://www.linkedin.com/pub/dir?firstName='+ef+'&lastName='+el+'" target="_blank" rel="noopener noreferrer"><i class="bi-linkedin"></i></a>';
linumRef.v++;
}
row+='</td></tr>';
return row;
}
function buildLoginRow(item,dom1,dom2,dom3,dom4){
const value=item.v;
const s=escapeHtml(value);
const e=encodeQ(value);
const badge=item.s>=85?'<span class="badge bg-success badge-score">'+item.s+'</span>':item.s>=70?'<span class="badge bg-primary badge-score">'+item.s+'</span>':'<span class="badge bg-secondary badge-score">'+item.s+'</span>';
const vg=value+"@gmail.com";
const vo=value+"@outlook.com";
const vi=value+"@"+dom1;
const vy=value+"@"+dom2;
const vh=value+"@"+dom3;
const vm=value+"@"+dom4;
let row='<tr><td style="width:16%">'+badge+' '+s+'</td>';
row+='<td><a href="https://www.google.com/search?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer">Google</a></td>';
row+='<td><a href="https://duckduckgo.com/?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer">DDG</a></td>';
row+='<td><a href="https://www.bing.com/search?q=%22'+e+'%22" target="_blank" rel="noopener noreferrer">Bing</a></td>';
row+='<td><a href="https://yandex.com/search/?text=%22'+e+'%22" target="_blank" rel="noopener noreferrer">Yandex</a></td>';
row+='<td><a href="https://www.google.com/search?q=%22'+encodeQ(vg)+'%22+OR+%22'+encodeQ(vo)+'%22+OR+%22'+encodeQ(vi)+'%22+OR+%22'+encodeQ(vy)+'%22+OR+%22'+encodeQ(vh)+'%22+OR+%22'+encodeQ(vm)+'%22" target="_blank" rel="noopener noreferrer"><i class="bi-google"></i> emails</a></td>';
row+='<td><a href="https://www.facebook.com/'+e+'" target="_blank" rel="noopener noreferrer"><i class="bi-facebook"></i></a></td>';
row+='<td><a href="https://x.com/'+e+'" target="_blank" rel="noopener noreferrer"><i class="bi-twitter-x"></i></a></td>';
row+='<td><a href="https://instagram.com/'+e+'" target="_blank" rel="noopener noreferrer"><i class="bi-instagram"></i></a></td>';
row+='<td><a href="https://www.tiktok.com/@'+e+'" target="_blank" rel="noopener noreferrer"><i class="bi-tiktok"></i></a></td>';
row+='<td><a href="https://www.twitch.tv/'+e+'" target="_blank" rel="noopener noreferrer"><i class="bi-twitch"></i></a></td>';
row+='<td><a href="https://github.com/'+e+'" target="_blank" rel="noopener noreferrer"><i class="bi-github"></i></a></td>';
row+='<td><a href="https://seintpl.github.io/imagstodon/?u='+e+'" target="_blank" rel="noopener noreferrer"><i class="bi bi-mastodon"></i></a></td>';
row+='<td><a href="https://whatsmyname.app/?q='+e+'" target="_blank" rel="noopener noreferrer">WMN</a></td></tr>';
return {row:row,emails:{vg:vg,vo:vo,vi:vi,vy:vy,vh:vh,vm:vm},value:value,score:item.s};
}
function openGroup(urls){
if(!Array.isArray(urls))return;
let i=0;
const step=()=>{
if(i>=urls.length)return;
try{window.open(urls[i],"_blank","noopener,noreferrer");}catch(e){}
i++;
if(i<urls.length)setTimeout(step,350);
};
step();
}
function checkGitHub(username){
return fetch("https://api.github.com/users/"+encodeURIComponent(username),{
method:"GET",
headers:{"Accept":"application/vnd.github+json"},
credentials:"omit",
cache:"no-store"
}).then(function(res){
if(res.status===200)return res.json().then(function(data){
return{status:"found",login:data.login||username,html_url:data.html_url||("https://github.com/"+username),name:data.name||"",bio:data.bio||"",avatar:data.avatar_url||"",public_repos:data.public_repos||0,followers:data.followers||0};
});
if(res.status===404)return{status:"not_found"};
if(res.status===403)return{status:"rate_limited"};
return{status:"error",code:res.status};
}).catch(function(){return{status:"error"};});
}
function renderLiveRow(username,score,result){
const s=escapeHtml(username);
const badge=score>=85?'<span class="badge bg-success badge-score">'+score+'</span>':score>=70?'<span class="badge bg-primary badge-score">'+score+'</span>':'<span class="badge bg-secondary badge-score">'+score+'</span>';
let statusHtml="";
let detail="";
if(!result||result.status==="pending"){
statusHtml='<span class="badge bg-secondary">Checking…</span>';
}else if(result.status==="found"){
statusHtml='<span class="badge bg-success">Found</span>';
const name=result.name?escapeHtml(result.name):"";
const bio=result.bio?escapeHtml(String(result.bio).substring(0,120)):"";
detail='<a href="'+escapeHtml(result.html_url)+'" target="_blank" rel="noopener noreferrer">'+escapeHtml(result.login||username)+'</a>';
if(name)detail+=' · '+name;
if(result.public_repos!=null)detail+=' · repos '+result.public_repos;
if(result.followers!=null)detail+=' · followers '+result.followers;
if(bio)detail+='<div class="small text-muted">'+bio+'</div>';
if(result.avatar)detail+=' <img src="'+escapeHtml(result.avatar)+'" class="avatar-sm ms-1" alt="">';
}else if(result.status==="not_found"){
statusHtml='<span class="badge bg-dark">Not found</span>';
}else if(result.status==="rate_limited"){
statusHtml='<span class="badge bg-warning text-dark">Rate limited</span>';
}else{
statusHtml='<span class="badge bg-danger">Error</span>';
}
return'<tr id="live-row-'+escapeHtml(username)+'"><td>'+badge+' '+s+'</td><td>'+statusHtml+'</td><td>'+detail+'</td></tr>';
}
function runLiveDiscovery(){
if(liveRunning)return;
const list=window.__if_logins;
if(!list||!list.length){
showToast("Generate patterns first");
return;
}
const targets=list.slice(0,LIVE_MAX);
const tbody=document.getElementById("live-tbody");
const statusEl=document.getElementById("live-status");
if(!tbody)return;
liveRunning=true;
tbody.innerHTML="";
targets.forEach(function(item){
tbody.innerHTML+=renderLiveRow(item.v,item.s,{status:"pending"});
});
if(statusEl)statusEl.textContent="Checking "+targets.length+" usernames on GitHub (sequential, rate-aware)…";
let idx=0;
function next(){
if(idx>=targets.length){
liveRunning=false;
if(statusEl)statusEl.textContent="Done. Only GitHub is checked directly from the browser; other platforms require external tools or manual review.";
return;
}
const item=targets[idx];
const uname=item.v;
checkGitHub(uname).then(function(result){
const row=document.getElementById("live-row-"+uname);
if(row){
const tmp=document.createElement("tbody");
tmp.innerHTML=renderLiveRow(uname,item.s,result);
if(tmp.firstChild)row.replaceWith(tmp.firstChild);
}
idx++;
setTimeout(next,LIVE_DELAY_MS);
}).catch(function(){
const row=document.getElementById("live-row-"+uname);
if(row){
const tmp=document.createElement("tbody");
tmp.innerHTML=renderLiveRow(uname,item.s,{status:"error"});
if(tmp.firstChild)row.replaceWith(tmp.firstChild);
}
idx++;
setTimeout(next,LIVE_DELAY_MS);
});
}
next();
}
function saveHistory(entry){
try{
const key="if-history";
let h=JSON.parse(localStorage.getItem(key)||"[]");
if(!Array.isArray(h))h=[];
h.unshift(entry);
h=h.slice(0,12);
localStorage.setItem(key,JSON.stringify(h));
}catch(e){}
}
function mashup(){
try{
const f=sanitizeName(document.getElementById("first").value);
const m=sanitizeName(document.getElementById("middle").value);
const l=sanitizeName(document.getElementById("last").value);
const n=sanitizeNum(document.getElementById("num").value);
let dom1=sanitizeDomain(document.getElementById("dom1").value)||"icloud.com";
let dom2=sanitizeDomain(document.getElementById("dom2").value)||"yahoo.com";
let dom3=sanitizeDomain(document.getElementById("dom3").value)||"hotmail.com";
let dom4=sanitizeDomain(document.getElementById("dom4").value)||"msn.com";
document.getElementById("dom1").value=dom1;
document.getElementById("dom2").value=dom2;
document.getElementById("dom3").value=dom3;
document.getElementById("dom4").value=dom4;
const notesEl=document.getElementById("notes");
const notes=notesEl?String(notesEl.value||"").substring(0,2000):"";
const out=document.getElementById("resultArea");
if(!f||!l){
out.innerHTML='<div class="alert alert-warning alert-safe" role="alert"><i class="bi bi-exclamation-triangle me-2"></i>Enter at least a first and last name.</div>';
return;
}
const rootAware=isLikelyHandle(f)||isLikelyHandle(l)||isLikelyHandle(m);
const base={fl:f+" "+l,lf:l+" "+f,fdotl:f.charAt(0)+". "+l,ldotf:l+" "+f.charAt(0)+".",l:l,fi:f.charAt(0),li:l.charAt(0),fl:f.toLowerCase(),ll:l.toLowerCase(),ml:m.toLowerCase()};
const nameRaw=[];
nameRaw.push({v:f+" "+l,s:95});
nameRaw.push({v:f.charAt(0)+". "+l,s:88});
nameRaw.push({v:l+" "+f,s:90});
nameRaw.push({v:l+" "+f.charAt(0)+".",s:82});
nameRaw.push({v:l,s:65});
if(m.length>0){
nameRaw.push({v:f+" "+m+" "+l,s:93});
nameRaw.push({v:f.charAt(0)+". "+m.charAt(0)+". "+l,s:80});
nameRaw.push({v:f+" "+m.charAt(0)+". "+l,s:84});
nameRaw.push({v:l+" "+f+" "+m,s:86});
nameRaw.push({v:l+" "+f.charAt(0)+". "+m.charAt(0)+".",s:78});
nameRaw.push({v:m+" "+l,s:70});
}
if(rootAware){
if(f.length>=3)nameRaw.push({v:f,s:88});
if(l.length>=3)nameRaw.push({v:l,s:85});
}
const uniqueNames=uniqueScored(nameRaw);
const orParts=uniqueNames.map(i=>'"'+i.v+'"');
const orname=orParts.join(" OR ");
const ornameEnc=encodeQ(orname);
const linumRef={v:0};
let namesBody="";
uniqueNames.forEach(item=>{namesBody+=buildNameRow(item,f,l,linumRef);});
const fbUrls=uniqueNames.map(i=>"https://www.facebook.com/public/"+encodeQ(i.v));
const twUrls=uniqueNames.map(i=>"https://x.com/search?q="+encodeQ(i.v)+"&src=typed_query&f=user");
const ttUrls=uniqueNames.map(i=>"https://www.tiktok.com/search/user?q="+encodeQ(i.v));
const flUrls=uniqueNames.map(i=>"https://www.flickr.com/search/people/?username="+encodeQ(i.v));
const vkUrls=uniqueNames.map(i=>"https://vk.com/search?c%5Bname%5D=1&c%5Bper_page%5D=40&c%5Bq%5D="+encodeQ(i.v)+"&c%5Bsection%5D=people");
window.__if_fb=fbUrls;window.__if_tw=twUrls;window.__if_tt=ttUrls;window.__if_fl=flUrls;window.__if_vk=vkUrls;
let allRow='<tr class="table-success"><td style="width:20%;font-weight:600">ALL <span title="Allow pop-ups"><i class="bi-info-circle"></i></span></td>';
allRow+='<td><a href="https://www.google.com/search?q='+ornameEnc+'" target="_blank" rel="noopener noreferrer"><i class="bi-google"></i></a></td>';
allRow+='<td><a href="https://duckduckgo.com/?q='+ornameEnc+'" target="_blank" rel="noopener noreferrer">DDG</a></td>';
allRow+='<td><a href="https://search.brave.com/search?q='+ornameEnc+'" target="_blank" rel="noopener noreferrer">Brave</a></td>';
allRow+='<td><a href="https://www.google.com/search?q='+ornameEnc+'&tbs=itp:face&tbm=isch" target="_blank" rel="noopener noreferrer"><i class="bi bi-person-square"></i></a></td>';
allRow+='<td><a href="https://www.google.com/search?q=('+ornameEnc+')+AND+(%E2%9C%86+OR+%E2%98%8E+OR+%E2%98%8F+OR+%F0%9F%93%B1+OR+%F0%9F%93%9E)" target="_blank" rel="noopener noreferrer"><i class="bi bi-telephone-fill"></i></a></td>';
allRow+='<td><a href="https://www.google.com/search?q=('+ornameEnc+')+AND+(%F0%9F%93%A7+OR+%F0%9F%93%A8+OR+%F0%9F%93%A9+OR+%E2%9C%89)" target="_blank" rel="noopener noreferrer"><i class="bi bi-envelope"></i></a></td>';
allRow+='<td><a href="https://www.google.com/maps/search/'+ornameEnc+'" target="_blank" rel="noopener noreferrer"><i class="bi bi-map"></i></a></td>';
allRow+='<td><a href="https://www.google.com/search?q=('+ornameEnc+')+ext:pdf" target="_blank" rel="noopener noreferrer"><i class="bi bi-filetype-pdf"></i></a></td>';
allRow+='<td><a href="https://www.bing.com/search?q='+ornameEnc+'" target="_blank" rel="noopener noreferrer">Bing</a></td>';
allRow+='<td><a href="https://yandex.com/search/?text='+ornameEnc+'" target="_blank" rel="noopener noreferrer">Yandex</a></td>';
allRow+='<td><a href="https://www.reddit.com/search/?q='+ornameEnc+'" target="_blank" rel="noopener noreferrer">Reddit</a></td>';
allRow+='<td><a href="https://github.com/search?q='+ornameEnc+'&type=users" target="_blank" rel="noopener noreferrer">GH</a></td>';
allRow+='<td><a href="https://web.archive.org/web/*/" target="_blank" rel="noopener noreferrer">Archive</a></td>';
allRow+='<td><a href="#" onclick="openGroup(window.__if_fb);return false;"><i class="bi-facebook"></i></a></td>';
allRow+='<td><a href="#" onclick="openGroup(window.__if_tw);return false;"><i class="bi-twitter-x"></i></a></td>';
allRow+='<td><a href="#" onclick="openGroup(window.__if_tt);return false;"><i class="bi-tiktok"></i></a></td>';
allRow+='<td><a href="#" onclick="openGroup(window.__if_fl);return false;"><i class="bi-camera2"></i></a></td>';
allRow+='<td><a href="#" onclick="openGroup(window.__if_vk);return false;">vk</a></td>';
allRow+='<td><a href="https://www.google.com/search?q='+ornameEnc+'+site:pastebin.com" target="_blank" rel="noopener noreferrer"><i class="bi bi-file-earmark-binary"></i></a></td></tr>';
const fl=f.toLowerCase();
const ll=l.toLowerCase();
const ml=m.toLowerCase();
const loginRaw=[];
const addL=(v,sc)=>loginRaw.push({v:v,s:sc});
addL(fl+"."+ll,94);
addL(ll+"."+fl,88);
addL(fl.charAt(0)+"."+ll,90);
addL(ll+"."+fl.charAt(0),82);
addL(fl+ll,92);
addL(ll+fl,86);
addL(fl.charAt(0)+ll,91);
addL(ll+fl.charAt(0),80);
addL(fl+ll.charAt(0),78);
addL(fl+"."+ll.charAt(0),76);
addL(fl+"_"+ll,89);
addL(ll+"_"+fl,84);
addL(fl+"-"+ll,87);
addL(ll+"-"+fl,83);
addL(fl.charAt(0)+"_"+ll,85);
addL(ll+"_"+fl.charAt(0),79);
addL(fl.charAt(0)+"-"+ll,81);
addL(ll+"-"+fl.charAt(0),77);
addL(fl,72);
addL(ll,70);
if(rootAware){
if(fl.length>=3)addL(fl,90);
if(ll.length>=3)addL(ll,88);
}
const years=[];
if(n.length===4){
const y=parseInt(n,10);
if(y>=1900&&y<=2030){
years.push(String(y));
years.push(String(y-1));
years.push(String(y+1));
years.push(String(y-2));
years.push(String(y+2));
}
}else if(n.length>0){
years.push(n);
}
years.forEach(yr=>{
addL(fl+"."+ll+yr,86);
addL(ll+"."+fl+yr,80);
addL(fl.charAt(0)+"."+ll+yr,84);
addL(fl+ll+yr,88);
addL(ll+fl+yr,82);
addL(fl.charAt(0)+ll+yr,85);
addL(fl+"_"+ll+yr,83);
addL(fl+"-"+ll+yr,81);
addL(fl+yr,74);
addL(ll+yr,72);
});
if(m.length>0){
addL(fl+ml+ll,88);
addL(ll+fl+ml,82);
addL(fl+ml.charAt(0)+ll,86);
addL(fl.charAt(0)+ml.charAt(0)+ll,84);
addL(ll+fl.charAt(0)+ml.charAt(0),78);
addL(ml+ll,75);
addL(ll+ml,73);
addL(ml,68);
years.forEach(yr=>{
addL(fl+ml+ll+yr,84);
addL(fl+ml.charAt(0)+ll+yr,80);
addL(fl.charAt(0)+ml.charAt(0)+ll+yr,78);
addL(ml+ll+yr,72);
});
}
const topForLeet=uniqueScored(loginRaw).slice(0,8);
topForLeet.forEach(item=>{
const lt=leet(item.v);
if(lt!==item.v&<.length>=3)addL(lt,Math.max(40,item.s-18));
});
const uniqueLogins=uniqueScored(loginRaw);
let loginsBody="";
let grall='<tr class="table-secondary"><td></td><td>Github<br>avatar</td><td>Gravatar<br>@gmail.com</td><td>Gravatar<br>@outlook.com</td><td>Gravatar<br>@'+escapeHtml(dom1)+'</td><td>Gravatar<br>@'+escapeHtml(dom2)+'</td><td>Gravatar<br>@'+escapeHtml(dom3)+'</td><td>Gravatar<br>@'+escapeHtml(dom4)+'</td></tr>';
let emRows="";
let permall="";
unloginall='<tr class="table-secondary"><td>username</td><td>possible avatar (unavatar.io)</td></tr>';
unemailall='<tr class="table-secondary"><td>@</td><td>gmail.com</td><td>outlook.com</td><td>'+escapeHtml(dom1)+'</td><td>'+escapeHtml(dom2)+'</td><td>'+escapeHtml(dom3)+'</td><td>'+escapeHtml(dom4)+'</td></tr>';
const emailList=[];
uniqueLogins.forEach(item=>{
const built=buildLoginRow(item,dom1,dom2,dom3,dom4);
loginsBody+=built.row;
const {vg,vo,vi,vy,vh,vm}=built.emails;
emRows+='<tr><td style="width:14%;vertical-align:middle">'+escapeHtml(item.v)+'</td><td>'+emtools(vg)+'</td><td>'+emtools(vo)+'</td><td>'+emtools(vi)+'</td><td>'+emtools(vy)+'</td><td>'+emtools(vh)+'</td><td>'+emtools(vm)+'</td></tr>';
const md5g=typeof md5==="function"?md5(vg):"";
const md5o=typeof md5==="function"?md5(vo):"";
const md5i=typeof md5==="function"?md5(vi):"";
const md5y=typeof md5==="function"?md5(vy):"";
const md5h=typeof md5==="function"?md5(vh):"";
const md5m=typeof md5==="function"?md5(vm):"";
grall+='<tr><td style="width:14%;vertical-align:middle">'+escapeHtml(item.v)+'</td><td style="vertical-align:middle"><a href="https://github.com/'+encodeQ(item.v)+'" target="_blank" rel="noopener noreferrer"><img src="https://github.com/'+encodeQ(item.v)+'.png" class="avatar-img" onerror="nogh(this)" alt=""></a></td><td><img src="https://s.gravatar.com/avatar/'+md5g+'" class="avatar-sm" alt=""></td><td><img src="https://s.gravatar.com/avatar/'+md5o+'" class="avatar-sm" alt=""></td><td><img src="https://s.gravatar.com/avatar/'+md5i+'" class="avatar-sm" alt=""></td><td><img src="https://s.gravatar.com/avatar/'+md5y+'" class="avatar-sm" alt=""></td><td><img src="https://s.gravatar.com/avatar/'+md5h+'" class="avatar-sm" alt=""></td><td><img src="https://s.gravatar.com/avatar/'+md5m+'" class="avatar-sm" alt=""></td></tr>';
unloginall+='<tr><td style="width:20%;vertical-align:middle">'+escapeHtml(item.v)+'</td><td><img src="https://unavatar.io/'+encodeQ(item.v)+'" style="width:160px;max-width:100%;border-radius:8px" alt=""></td></tr>';
unemailall+='<tr><td style="width:14%;vertical-align:middle">'+escapeHtml(item.v)+'</td><td><img src="https://unavatar.io/'+encodeQ(vg)+'" class="avatar-sm" alt=""></td><td><img src="https://unavatar.io/'+encodeQ(vo)+'" class="avatar-sm" alt=""></td><td><img src="https://unavatar.io/'+encodeQ(vi)+'" class="avatar-sm" alt=""></td><td><img src="https://unavatar.io/'+encodeQ(vy)+'" class="avatar-sm" alt=""></td><td><img src="https://unavatar.io/'+encodeQ(vh)+'" class="avatar-sm" alt=""></td><td><img src="https://unavatar.io/'+encodeQ(vm)+'" class="avatar-sm" alt=""></td></tr>';
permall+='<tr><td>'+escapeHtml(vg)+'</td></tr><tr><td>'+escapeHtml(vo)+'</td></tr><tr><td>'+escapeHtml(vi)+'</td></tr><tr><td>'+escapeHtml(vy)+'</td></tr><tr><td>'+escapeHtml(vh)+'</td></tr><tr><td>'+escapeHtml(vm)+'</td></tr><tr></tr>';
emailList.push(vg,vo,vi,vy,vh,vm);
});
lastNames=uniqueNames;
lastLogins=uniqueLogins;
lastEmails=emailList;
saveHistory({f:f,m:m,l:l,n:n,ts:Date.now()});
const nameListTxt=uniqueNames.map(i=>i.v).join("\n");
const loginListTxt=uniqueLogins.map(i=>i.v).join("\n");
let html='<div class="d-flex flex-wrap gap-2 mb-3 align-items-center">';
html+='<button class="btn btn-outline-secondary btn-sm" onclick="copyText(window.__if_nameList)"><i class="bi bi-clipboard me-1"></i>Copy names</button>';
html+='<button class="btn btn-outline-secondary btn-sm" onclick="copyText(window.__if_loginList)"><i class="bi bi-clipboard me-1"></i>Copy logins</button>';
html+='<button class="btn btn-outline-primary btn-sm" onclick="downloadCsv(window.__if_names,\'names\')">CSV names</button>';
html+='<button class="btn btn-outline-primary btn-sm" onclick="downloadCsv(window.__if_logins,\'logins\')">CSV logins</button>';
html+='<button class="btn btn-outline-success btn-sm" onclick="downloadMd(window.__if_names,window.__if_logins,document.getElementById(\'notes\')?document.getElementById(\'notes\').value:\'\')"><i class="bi bi-markdown me-1"></i>Markdown report</button>';
if(rootAware)html+='<span class="badge bg-info">Root-aware mode active</span>';
html+='<span class="badge bg-dark ms-auto">v'+VERSION+'</span></div>';
html+='<ul class="nav nav-tabs mb-3" id="ifTabs" role="tablist">';
html+='<li class="nav-item" role="presentation"><button class="nav-link active" id="tab-names" data-bs-toggle="tab" data-bs-target="#pane-names" type="button" role="tab">Names <span class="badge bg-primary">'+uniqueNames.length+'</span></button></li>';
html+='<li class="nav-item" role="presentation"><button class="nav-link" id="tab-logins" data-bs-toggle="tab" data-bs-target="#pane-logins" type="button" role="tab">Logins <span class="badge bg-primary">'+uniqueLogins.length+'</span></button></li>';
html+='<li class="nav-item" role="presentation"><button class="nav-link" id="tab-live" data-bs-toggle="tab" data-bs-target="#pane-live" type="button" role="tab">Live Discovery</button></li>';
html+='<li class="nav-item" role="presentation"><button class="nav-link" id="tab-emails" data-bs-toggle="tab" data-bs-target="#pane-emails" type="button" role="tab">Email tools</button></li>';
html+='<li class="nav-item" role="presentation"><button class="nav-link" id="tab-grav" data-bs-toggle="tab" data-bs-target="#pane-grav" type="button" role="tab">Avatars</button></li>';
html+='<li class="nav-item" role="presentation"><button class="nav-link" id="tab-un" data-bs-toggle="tab" data-bs-target="#pane-un" type="button" role="tab">Unavatar</button></li>';
html+='<li class="nav-item" role="presentation"><button class="nav-link" id="tab-perm" data-bs-toggle="tab" data-bs-target="#pane-perm" type="button" role="tab">Permutator</button></li>';
html+='</ul>';
html+='<div class="tab-content">';
html+='<div class="tab-pane fade show active" id="pane-names" role="tabpanel"><div class="card-section"><div class="card-header d-flex justify-content-between align-items-center flex-wrap gap-2"><span>Name patterns (scored & sorted)</span><button class="btn btn-outline-primary btn-sm" onclick="downloadJson(\'names\')">JSON</button></div><div class="table-responsive"><table class="table table-sm table-hover mb-0" id="names-table"><thead><tr style="display:none"><th>name</th><th>google</th><th>ddg</th><th>brave</th><th>images</th><th>phone</th><th>email</th><th>maps</th><th>pdf</th><th>bing</th><th>yandex</th><th>reddit</th><th>github</th><th>archive</th><th>facebook</th><th>x</th><th>tiktok</th><th>flickr</th><th>vk</th><th>other</th></tr></thead><tbody>'+namesBody+allRow+'</tbody></table></div></div></div>';
html+='<div class="tab-pane fade" id="pane-logins" role="tabpanel"><div class="card-section"><div class="card-header d-flex justify-content-between align-items-center flex-wrap gap-2"><span>Login patterns (scored, root-aware, leet on top)</span><button class="btn btn-outline-primary btn-sm" onclick="downloadJson(\'logins\')">JSON</button></div><div class="table-responsive"><table class="table table-sm table-hover mb-0" id="logins-table"><thead><tr style="display:none"><th>login</th><th>google</th><th>ddg</th><th>bing</th><th>yandex</th><th>common_emails</th><th>facebook</th><th>x</th><th>instagram</th><th>tiktok</th><th>twitch</th><th>github</th><th>mastodon</th><th>whatsmyname</th></tr></thead><tbody>'+loginsBody+'</tbody></table></div></div></div>';
html+='<div class="tab-pane fade" id="pane-live" role="tabpanel"><div class="card-section"><div class="card-header d-flex justify-content-between align-items-center flex-wrap gap-2"><span>Live account discovery</span><button class="btn btn-success btn-sm" id="liveBtn" onclick="runLiveDiscovery()"><i class="bi bi-radar me-1"></i>Check top logins on GitHub</button></div><div class="p-3"><p class="small text-muted mb-2">Direct existence checks are limited to platforms that allow browser requests. GitHub public user API is checked here. Facebook, Instagram, X, TikTok and most others block cross-origin access; use the Logins tab links or external tools (WhatsMyName, Sherlock, Maigret) for those. Checks run sequentially with delay to respect rate limits. Top '+LIVE_MAX+' scored logins are tested.</p><p class="small mb-2" id="live-status">Click the button to start.</p><div class="table-responsive"><table class="table table-sm table-hover mb-0"><thead><tr><th>Username</th><th>Status</th><th>Details</th></tr></thead><tbody id="live-tbody"><tr><td colspan="3" class="text-muted">No checks run yet</td></tr></tbody></table></div></div></div></div>';
html+='<div class="tab-pane fade" id="pane-emails" role="tabpanel"><div class="card-section"><div class="card-header">Email search tools</div><div class="table-responsive"><table class="table table-sm table-hover mb-0"><tbody>'+emRows+'</tbody></table></div></div></div>';
html+='<div class="tab-pane fade" id="pane-grav" role="tabpanel"><div class="card-section"><div class="card-header">GitHub & Gravatar (client-side image checks)</div><div class="table-responsive"><table class="table table-sm table-hover mb-0"><tbody>'+grall+'</tbody></table></div></div></div>';
html+='<div class="tab-pane fade" id="pane-un" role="tabpanel"><div class="card-section"><div class="card-header">Unavatar (rate-limited)</div><div class="p-3"><p class="small text-muted mb-2">Unavatar limit ~300/24h. Use sparingly. Full live multi-platform enumeration requires external tools (Sherlock, Maigret, WhatsMyName).</p><button class="btn btn-success btn-sm me-2 mb-2" onclick="document.getElementById(\'unlogin\').innerHTML=unloginall">Load by login</button><button class="btn btn-success btn-sm mb-2" onclick="document.getElementById(\'unemail\').innerHTML=unemailall">Load by email</button><div class="table-responsive mt-2"><table class="table table-sm" id="unlogin"><tbody><tr><td class="text-muted">Click to load</td></tr></tbody></table></div><div class="table-responsive mt-3"><table class="table table-sm" id="unemail"><tbody><tr><td class="text-muted">Click to load</td></tr></tbody></table></div></div></div></div>';
html+='<div class="tab-pane fade" id="pane-perm" role="tabpanel"><div class="card-section"><div class="card-header">Email permutator</div><div class="table-responsive"><table class="table table-sm table-hover mb-0"><tbody>'+permall+'</tbody></table></div></div></div>';
html+='</div>';
out.innerHTML=html;
window.__if_nameList=nameListTxt;
window.__if_loginList=loginListTxt;
window.__if_names=uniqueNames;
window.__if_logins=uniqueLogins;
}catch(err){
const out=document.getElementById("resultArea");
if(out)out.innerHTML='<div class="alert alert-danger" role="alert"><i class="bi bi-x-circle me-2"></i>Generation failed. Check inputs and try again.</div>';
}
}
function domdefault(){
document.getElementById("dom1").value="icloud.com";
document.getElementById("dom2").value="yahoo.com";
document.getElementById("dom3").value="hotmail.com";
document.getElementById("dom4").value="msn.com";
}
function initFromUrl(){
try{
const p=new URLSearchParams(window.location.search);
if(p.has("f"))document.getElementById("first").value=sanitizeName(p.get("f")||"");
if(p.has("m"))document.getElementById("middle").value=sanitizeName(p.get("m")||"");
if(p.has("l"))document.getElementById("last").value=sanitizeName(p.get("l")||"");
if(p.has("n"))document.getElementById("num").value=sanitizeNum(p.get("n")||"");
}catch(e){}
}
function toggleTheme(){
const html=document.documentElement;
const cur=html.getAttribute("data-bs-theme")||"light";
const next=cur==="light"?"dark":"light";
html.setAttribute("data-bs-theme",next);
const btn=document.getElementById("themeBtn");
if(btn)btn.innerHTML=next==="dark"?'<i class="bi bi-sun"></i>':'<i class="bi bi-moon-stars"></i>';
try{localStorage.setItem("if-theme",next);}catch(e){}
}
function loadTheme(){
try{
const saved=localStorage.getItem("if-theme");
if(saved==="dark"||saved==="light"){
document.documentElement.setAttribute("data-bs-theme",saved);
const btn=document.getElementById("themeBtn");
if(btn)btn.innerHTML=saved==="dark"?'<i class="bi bi-sun"></i>':'<i class="bi bi-moon-stars"></i>';
}
}catch(e){}
}
document.addEventListener("DOMContentLoaded",function(){
loadTheme();
initFromUrl();
const go=document.getElementById("goBtn");
if(go)go.addEventListener("click",mashup);
const def=document.getElementById("domDefaultBtn");
if(def)def.addEventListener("click",domdefault);
const th=document.getElementById("themeBtn");
if(th)th.addEventListener("click",toggleTheme);
document.querySelectorAll("#first,#middle,#last,#num").forEach(el=>{
el.addEventListener("keydown",function(ev){if(ev.key==="Enter"){ev.preventDefault();mashup();}});
});
const ver=document.getElementById("verBadge");
if(ver)ver.textContent="v"+VERSION;
});
window.openGroup=openGroup;
window.downloadJson=downloadJson;
window.downloadCsv=downloadCsv;
window.downloadMd=downloadMd;
window.copyText=copyText;
window.nogh=nogh;
window.runLiveDiscovery=runLiveDiscovery;
Object.defineProperty(window,"unloginall",{get:function(){return unloginall;},set:function(v){unloginall=v;}});
Object.defineProperty(window,"unemailall",{get:function(){return unemailall;},set:function(v){unemailall=v;}});
})();