Skip to content

Instantly share code, notes, and snippets.

@Hillzacky
Last active February 23, 2025 02:25
Show Gist options
  • Save Hillzacky/0f7e098d4f40dce5ab25771f32351358 to your computer and use it in GitHub Desktop.
Save Hillzacky/0f7e098d4f40dce5ab25771f32351358 to your computer and use it in GitHub Desktop.
akses url secara anonimitas
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");
});
@Hillzacky
Copy link
Author

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

@Hillzacky
Copy link
Author

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