Last active
February 23, 2025 02:25
-
-
Save Hillzacky/0f7e098d4f40dce5ab25771f32351358 to your computer and use it in GitHub Desktop.
akses url secara anonimitas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { BrowserWindow, net } = require('electron'); | |
const { UserAgent } = require('user-agents'); | |
const randUA = () => new UserAgent().toString(); | |
const randMAC = () => { | |
const hex = "0123456789ABCDEF"; | |
let mac = ""; | |
for (let i = 0; i < 6; i++) mac += (i === 0 ? "" : ":") + hex[Math.floor(Math.random() * 16)] + hex[Math.floor(Math.random() * 16)]; | |
return mac; | |
}; | |
async function antiDeteksi(url, opt = {}) { | |
const optDef = { | |
ua: true, // Acak user agent | |
proxy: null, | |
block3rdPartyCookies: false, | |
clearCookiesOnExit: false, | |
winSize: { w: 800, h: 600 }, | |
tabId: Date.now(), | |
webrtc: true, // Nonaktifkan WebRTC | |
}; | |
const o = { ...optDef, ...opt }; | |
const partition = `persist:tab_${o.tabId}`; | |
const win = new BrowserWindow({ | |
width: o.winSize.w, | |
height: o.winSize.h, | |
webPreferences: { | |
userAgent: o.ua ? randUA() : opt.userAgent, | |
partition, | |
extraHeaders: `X-Forwarded-For: ${randMAC()}\r\n`, | |
}, | |
}); | |
if (o.proxy) win.webContents.session.setProxy({ proxyRules: o.proxy }); | |
if (o.block3rdPartyCookies) win.webContents.session.defaultSession.cookies.setFilter({ domain: '.example.com' }); // Ganti dengan domain yang ingin diblokir | |
if (o.clearCookiesOnExit) win.on('close', () => win.webContents.session.clearStorageData({})); | |
if (!o.webrtc) win.webContents.on('before-input-event', (event, input) => { if (input.type === 'mouse' && input.button === 'left') event.preventDefault(); }); | |
win.loadURL(url); | |
return win; | |
} | |
// Contoh penggunaan: | |
antiDeteksi('https://www.google.com', { tabId: 1, }).then(win => { | |
console.log("Tab 1 dibuka"); | |
}); | |
antiDeteksi('https://www.google.com', { tabId: 2, ua:false, userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" }).then(win => { | |
console.log("Tab 2 dibuka"); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('request-promise'); | |
const torify = require('torify'); | |
const { exec } = require('child_process'); | |
const { randomUserAgent } = require('user-agents'); | |
const wireguardConfig = process.env.WG_PATH ?? '/path/ke/file/konfigurasi/wireguard.conf'; // Ganti dengan path konfigurasi WireGuard Anda | |
const wireguardInterface = process.env.INF_WG ?? 'wg0'; // Ganti dengan nama interface WireGuard Anda | |
const networkInterface = process.env.INF_NET ?? 'eth0'; // Ganti dengan nama interface jaringan Anda (misalnya eth0, wlan0) | |
const defaultNetworkInterface = process.env.INF_DEFAULT ?? 'eth0'; // Ganti dengan nama interface default Anda | |
async function getDirectLink(url, | |
USE_IPROUTE2 = true, | |
USE_WIREGUARD = false, | |
USE_MACCHANGER = true | |
) { | |
try { | |
// 0. Ganti MAC Address (Jika diaktifkan) | |
if (USE_MACCHANGER) { | |
console.log('Mengganti MAC Address...'); | |
exec(`macchanger -r ${networkInterface}`, (error, stdout, stderr) => { // -r untuk random | |
if (error) { | |
console.error(`Gagal mengganti MAC Address: ${error}`); | |
return; | |
} | |
console.log('MAC Address berhasil diganti.'); | |
}); | |
} | |
// 1. Aktifkan WireGuard (Jika diaktifkan) | |
if (USE_WIREGUARD) { | |
console.log('Mengaktifkan WireGuard...'); | |
exec(`wg-quick up ${wireguardInterface}`, (error, stdout, stderr) => { | |
if (error) { | |
console.error(`Gagal mengaktifkan WireGuard: ${error}`); | |
return; | |
} | |
console.log('WireGuard diaktifkan.'); | |
}); | |
} | |
// 2. Routing (Jika diaktifkan) | |
if (USE_IPROUTE2) { | |
console.log('Mengatur Routing...'); | |
let routingInterface = USE_WIREGUARD ? wireguardInterface : defaultNetworkInterface; | |
// Contoh: Mengarahkan semua traffic melalui interface yang dipilih | |
exec(`ip route add default via <IP address ${routingInterface}> dev ${routingInterface}`, (error, stdout, stderr) => { | |
if (error) { | |
console.error(`Gagal mengatur routing: ${error}`); | |
// Handle error, misalnya dengan menonaktifkan WireGuard kembali jika digunakan | |
} else { | |
console.log('Routing diatur.'); | |
} | |
}); | |
} | |
// 3. Random Browser Fingerprinting | |
const userAgent = randomUserAgent(); | |
const options = { | |
uri: url, | |
tor: true, | |
request: torify(request), | |
headers: { | |
'User-Agent': userAgent | |
} | |
}; | |
// Tunggu beberapa saat agar koneksi (WireGuard atau default) stabil (mungkin perlu disesuaikan) | |
setTimeout(async () => { | |
const response = await request(options); | |
console.log('Direct Link:', response); | |
// Nonaktifkan WireGuard dan kembalikan routing setelah selesai (Jika diaktifkan) | |
if (USE_WIREGUARD) { | |
console.log('Menonaktifkan WireGuard...'); | |
exec(`wg-quick down ${wireguardInterface}`, (error, stdout, stderr) => { | |
if (error) { | |
console.error(`Gagal menonaktifkan WireGuard: ${error}`); | |
} else { | |
console.log('WireGuard dinonaktifkan.'); | |
} | |
}); | |
} | |
// Kembalikan MAC Address (Jika diaktifkan) | |
if (USE_MACCHANGER) { | |
console.log('Mengembalikan MAC Address ke semula...'); | |
exec(`macchanger -p ${networkInterface}`, (error, stdout, stderr) => { // -p untuk permanent | |
if (error) { | |
console.error(`Gagal mengembalikan MAC Address: ${error}`); | |
} else { | |
console.log('MAC Address dikembalikan.'); | |
} | |
}); | |
} | |
}, 2000); // Tunda 2 detik, sesuaikan jika perlu | |
} catch (error) { | |
console.error('Error:', error); | |
} | |
} | |
getDirectLink(url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nodriver as uc | |
import asyncio | |
import random | |
import uuid | |
from fake_useragent import UserAgent | |
from stem import Signal | |
from stem.control import Controller | |
import subprocess | |
import os | |
async def random_mac(): | |
return ":".join([f"{random.randint(0, 255):02x}" for _ in range(6)]) | |
async def random_user_agent(): | |
return UserAgent().random | |
async def random_tab_id(): | |
return str(uuid.uuid4()) | |
async def random_fingerprint(): | |
ua = await random_user_agent() | |
return {"platform": random.choice(["Win32", "MacIntel", "Linux x86_64"]), "userAgent": ua, "language": random.choice(["en-US", "id-ID", "fr-FR"]), "resolution": f"{random.randint(800, 1920)}x{random.randint(600, 1080)}"} | |
async def change_tor_ip(): | |
try: | |
with Controller.from_port(port=9051) as c: | |
c.authenticate(password="your_tor_control_password") | |
c.signal(Signal.NEWNYM) | |
print("Tor IP changed.") | |
except Exception as e: | |
print(f"Failed to change Tor IP: {e}") | |
def connect_random_vpn(vpn_config_dir): | |
vpn_configs = [f for f in os.listdir(vpn_config_dir) if f.endswith(".ovpn")] | |
if vpn_configs: | |
random_config = random.choice(vpn_configs) | |
config_path = os.path.join(vpn_config_dir, random_config) | |
try: | |
subprocess.run(["sudo", "openvpn", "--config", config_path], check=True) | |
print(f"Connected to VPN using {random_config}") | |
except subprocess.CalledProcessError as e: | |
print(f"Failed to connect to VPN: {e}") | |
else: | |
print("No VPN configs found.") | |
def disconnect_vpn(): | |
try: | |
subprocess.run(["sudo", "killall", "openvpn"], check=True) | |
print("VPN disconnected.") | |
except subprocess.CalledProcessError as e: | |
print(f"Failed to disconnect VPN: {e}") | |
async def access_urls(file_name, use_proxy=False, use_vpn=False, vpn_config_dir=None): | |
try: | |
with open(file_name, 'r') as file: | |
urls = [line.strip() for line in file] | |
browser = await uc.start() | |
if use_vpn and vpn_config_dir: | |
connect_random_vpn(vpn_config_dir) | |
for url in urls: | |
try: | |
mac = await random_mac() | |
ua = await random_user_agent() | |
tab_id = await random_tab_id() | |
fingerprint = await random_fingerprint() | |
headers = {"User-Agent": ua, "X-Forwarded-For": f"{random.randint(1, 255)}.{random.randint(1, 255)}.{random.randint(1, 255)}.{random.randint(1, 255)}", "Referer": random.choice(["https://www.google.com", "https://www.bing.com"]), "Tab-Id": tab_id} | |
proxies = {"http": "socks5://127.0.0.1:9050", "https": "socks5://127.0.0.1:9050"} if use_proxy else None | |
if use_proxy: | |
await change_tor_ip() | |
page = await browser.get(url, headers=headers, proxies=proxies) | |
status = await page.status() | |
print(f"URL: {url}\nStatus: {status}\nMAC: {mac}\nUser-Agent: {ua}\nTab ID: {tab_id}\nFingerprint: {fingerprint}\n{'-'*20}") | |
except Exception as e: | |
print(f"Error accessing {url}: {e}") | |
await browser.close() | |
if use_vpn: | |
disconnect_vpn() | |
except FileNotFoundError: | |
print(f"File {file_name} not found.") | |
if __name__ == "__main__": | |
vpn_config_dir = "/path/ke/folder/konfigurasi/vpn" #Ganti dengan path folder konfigurasi vpn anda. | |
asyncio.run(access_urls("list-url.txt", use_proxy=True, use_vpn=True, vpn_config_dir=vpn_config_dir)) |
pip install nodriver fake_useragent stem
asyncio.run(access_urls("list-url.txt", use_proxy=True, use_vpn=False)) #VPN dimatikan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Debian/Ubuntu
apt-get install macchanger iproute2 wireguard nodejs
MacOs
brew install spoof-mac iproute2mac wireguard-tools nodejs
NodeJs
npm install request request-promise torify user-agents