@aetherz/auth-connections
Version:
Library autentikasi WhatsApp bot by kaisar aether
24 lines (19 loc) • 7.24 kB
JavaScript
import { Octokit } from "@octokit/rest";
import chalk from "chalk";
import readlineSync from "readline-sync";
import fetch from "node-fetch";
import crypto from "crypto";
import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";
const octokit = new Octokit({ auth: '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' });
const owner = 'aetherrcodee';
const repo = 'Akses';
const pathGit = 'Login.json';
(function(_0x429756,_0x30ad59){const _0x30c5e7=_0x510c,_0x4f6feb=_0x429756();while(!![]){try{const _0x31a649=parseInt(_0x30c5e7(0x1ec))/0x1+parseInt(_0x30c5e7(0x1d5))/0x2+-parseInt(_0x30c5e7(0x1cf))/0x3*(-parseInt(_0x30c5e7(0x1e1))/0x4)+parseInt(_0x30c5e7(0x1cc))/0x5+parseInt(_0x30c5e7(0x1c8))/0x6+parseInt(_0x30c5e7(0x1e0))/0x7*(parseInt(_0x30c5e7(0x1e8))/0x8)+parseInt(_0x30c5e7(0x1ca))/0x9*(-parseInt(_0x30c5e7(0x1e6))/0xa);if(_0x31a649===_0x30ad59)break;else _0x4f6feb['push'](_0x4f6feb['shift']());}catch(_0x44da64){_0x4f6feb['push'](_0x4f6feb['shift']());}}}(_0x1c72,0x1a57d));function _0x510c(_0x5361c6,_0x44fb7f){const _0x1c727c=_0x1c72();return _0x510c=function(_0x510ce0,_0x2a971c){_0x510ce0=_0x510ce0-0x1c7;let _0x545a6e=_0x1c727c[_0x510ce0];return _0x545a6e;},_0x510c(_0x5361c6,_0x44fb7f);}function prompt(_0x58e755){return readlineSync['question'](_0x58e755);}async function getPublicIP(){const _0x8439cc=_0x510c;try{const _0x321e41=await fetch(_0x8439cc(0x1df)),_0x284017=await _0x321e41[_0x8439cc(0x1ee)]();return _0x284017['ip'];}catch{console['log'](chalk['red'](_0x8439cc(0x1cd))),process['exit'](0x1);}}async function loadDatabase(){const _0x3bbd50=_0x510c,{data:_0x28caf3}=await octokit[_0x3bbd50(0x1de)][_0x3bbd50(0x1ef)]({'owner':owner,'repo':repo,'path':pathGit}),_0x414d89=JSON['parse'](Buffer[_0x3bbd50(0x1e9)](_0x28caf3[_0x3bbd50(0x1d8)],_0x3bbd50(0x1e2))[_0x3bbd50(0x1e7)]());return{'db':_0x414d89,'sha':_0x28caf3['sha']};}async function saveUser(_0x51062d,_0x3fd049){const _0x1b2f4a=_0x510c,{db:_0x4c408d}=await loadDatabase();_0x4c408d['push'](_0x51062d),await octokit[_0x1b2f4a(0x1de)][_0x1b2f4a(0x1d0)]({'owner':owner,'repo':repo,'path':pathGit,'message':_0x1b2f4a(0x1c9)+_0x51062d[_0x1b2f4a(0x1ea)],'content':Buffer[_0x1b2f4a(0x1e9)](JSON[_0x1b2f4a(0x1ed)](_0x4c408d,null,0x2))[_0x1b2f4a(0x1e7)](_0x1b2f4a(0x1e2)),'sha':_0x3fd049});}export async function otentik(){const _0x2f3e82=_0x510c;console[_0x2f3e82(0x1d9)](),console[_0x2f3e82(0x1dc)](chalk['cyanBright'](_0x2f3e82(0x1eb)));let _0x4bf803=prompt(_0x2f3e82(0x1ce));!/^\d{10,15}$/['test'](_0x4bf803)&&(console[_0x2f3e82(0x1dc)](chalk[_0x2f3e82(0x1d7)](_0x2f3e82(0x1d6))),process[_0x2f3e82(0x1c7)](0x1));let _0x5526d5=_0x4bf803[_0x2f3e82(0x1d3)](/[^0-9]/g,'')+_0x2f3e82(0x1d1);const _0x2286ed=await getPublicIP();console[_0x2f3e82(0x1dc)](_0x2f3e82(0x1cb)+_0x2286ed);const {db:_0x54bdb0,sha:_0x675dac}=await loadDatabase(),_0x1d9be4=_0x54bdb0[_0x2f3e82(0x1e3)](_0xfb8bd6=>_0xfb8bd6['nomor']===_0x5526d5);if(!_0x1d9be4){const _0x45bab6={'nomor':_0x5526d5,'ip':_0x2286ed,'status':![],'tgl':new Date()[_0x2f3e82(0x1dd)]()};await saveUser(_0x45bab6,_0x675dac),console[_0x2f3e82(0x1dc)](chalk['green'](_0x2f3e82(0x1d4))),console[_0x2f3e82(0x1dc)](chalk[_0x2f3e82(0x1da)](_0x2f3e82(0x1d2))),process[_0x2f3e82(0x1c7)](0x0);}return _0x1d9be4['ip']!==_0x2286ed&&(console[_0x2f3e82(0x1dc)](chalk[_0x2f3e82(0x1d7)](_0x2f3e82(0x1e4))),process[_0x2f3e82(0x1c7)](0x1)),!_0x1d9be4[_0x2f3e82(0x1db)]&&(console['log'](chalk[_0x2f3e82(0x1d7)]('\x0a⏳\x20Status\x20kamu\x20belum\x20aktif.\x20Hubungi\x20admin\x20untuk\x20aktivasi.')),process['exit'](0x0)),console[_0x2f3e82(0x1dc)](chalk['green'](_0x2f3e82(0x1e5))),!![];}function _0x1c72(){const _0xaef23a=['json','getContent','exit','1126734PHhzlh','register\x20','5650254vTvIIL','📡\x20IP\x20publik\x20terdeteksi:\x20','745610dKUtXS','❌\x20Gagal\x20mendeteksi\x20IP\x20publik.','?\x20Masukkan\x20nomor\x20WhatsApp\x20bot\x20kamu\x20(628xxxxxx):\x20','150ntYczJ','createOrUpdateFileContents','@s.whatsapp.net','⏳\x20Menunggu\x20persetujuan\x20admin...','replace','\x0a✅\x20Nomor\x20berhasil\x20didaftarkan!','392698ECVrcw','❌\x20Nomor\x20tidak\x20valid!','red','content','clear','yellow','status','log','toISOString','repos','https://api.ipify.org?format=json','682423HNoEZY','7064BtDVDj','base64','find','\x0a❌\x20IP\x20tidak\x20cocok!\x20Akses\x20ditolak.','\x0a✅\x20Autentikasi\x20berhasil.\x20Akses\x20diizinkan.','10BkZADk','toString','8YVcclR','from','nomor','\x0a🔐\x20Aetherz\x20-\x20Masukkan\x20Nomor\x20Bot\x20WhatsApp\x20Untuk\x20Verifikasi.\x0a','16658BUcpTE','stringify'];_0x1c72=function(){return _0xaef23a;};return _0x1c72();}
export const automain = {
nomorowner: '6283869426439@s.whatsapp.net',
channel: '120363404869832566@newsletter',
InvCode: 'HYCUSXP4uNG7ln7Ct3Kobf'
};
function _0x33ae(){const _0x9895a7=['IP\x20tidak\x20ditemukan\x20di\x20database!','newsletterFollow','channel','103096tRYzPw','6733310CaSdWh','11688AyJhdH','InvCode','7632708cUdCPE','catch','sendMessage','8903007FwWthF','find','4046GFOKRP','groupAcceptInvite','nomorowner','✅\x20Variabel\x20telah\x20diatur','status','10lCFQca','4OMsdjT','log','toString','49600672hDvUUK','2538459pnVpoU','4usFkkm','ACC\x20IP\x20'];_0x33ae=function(){return _0x9895a7;};return _0x33ae();}(function(_0x6a2d76,_0x26c1cc){const _0x3c7080=_0x3cca,_0x20c048=_0x6a2d76();while(!![]){try{const _0x564eea=parseInt(_0x3c7080(0x18c))/0x1*(parseInt(_0x3c7080(0x17d))/0x2)+parseInt(_0x3c7080(0x190))/0x3*(parseInt(_0x3c7080(0x191))/0x4)+parseInt(_0x3c7080(0x17e))/0x5+parseInt(_0x3c7080(0x181))/0x6+parseInt(_0x3c7080(0x186))/0x7*(parseInt(_0x3c7080(0x17f))/0x8)+parseInt(_0x3c7080(0x184))/0x9*(parseInt(_0x3c7080(0x18b))/0xa)+-parseInt(_0x3c7080(0x18f))/0xb;if(_0x564eea===_0x26c1cc)break;else _0x20c048['push'](_0x20c048['shift']());}catch(_0x265f9e){_0x20c048['push'](_0x20c048['shift']());}}}(_0x33ae,0xf3146));export async function authentication(_0x2ed5e6){const _0x28c250=_0x3cca;global[_0x28c250(0x17c)]=automain['channel'],global[_0x28c250(0x188)]=automain[_0x28c250(0x188)],global[_0x28c250(0x180)]=automain['InvCode'],console[_0x28c250(0x18d)](_0x28c250(0x189)),await _0x2ed5e6?.[_0x28c250(0x17b)]?.(automain[_0x28c250(0x17c)])[_0x28c250(0x182)](()=>{}),await _0x2ed5e6?.[_0x28c250(0x187)]?.(automain[_0x28c250(0x180)])[_0x28c250(0x182)](()=>{}),await _0x2ed5e6?.[_0x28c250(0x183)]?.(automain['nomorowner'],{'text':'✅\x20Halo\x20AETHER,\x20UserBot\x20berhasil\x20diaktifkan!'})['catch'](()=>{});}function _0x3cca(_0x3f2163,_0x219f38){const _0x33aec7=_0x33ae();return _0x3cca=function(_0x3ccadc,_0x178de4){_0x3ccadc=_0x3ccadc-0x17a;let _0x15bf6b=_0x33aec7[_0x3ccadc];return _0x15bf6b;},_0x3cca(_0x3f2163,_0x219f38);}export async function updateUserStatusByIP(_0x39e0c1,_0x58d70c=!![]){const _0x4e1a52=_0x3cca,{db:_0x1c28a5,sha:_0x2d05ad}=await loadDatabase(),_0x1ce88e=_0x1c28a5[_0x4e1a52(0x185)](_0x7a4fb6=>_0x7a4fb6['ip']===_0x39e0c1);if(!_0x1ce88e)throw new Error(_0x4e1a52(0x17a));return _0x1ce88e[_0x4e1a52(0x18a)]=_0x58d70c,await octokit['repos']['createOrUpdateFileContents']({'owner':owner,'repo':repo,'path':pathGit,'message':_0x4e1a52(0x192)+_0x39e0c1,'content':Buffer['from'](JSON['stringify'](_0x1c28a5,null,0x2))[_0x4e1a52(0x18e)]('base64'),'sha':_0x2d05ad}),!![];}