0% found this document useful (0 votes)
45 views7 pages

Message

The document is a JavaScript code for a Discord vanity URL sniper, which utilizes WebSocket and HTTP/2 connections to monitor and update vanity URLs in Discord servers. It includes functionalities for sending notifications via webhooks, managing MFA tokens, and handling WebSocket events. The code also features error handling and configuration loading from a JSON file.

Uploaded by

pritamatta73
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views7 pages

Message

The document is a JavaScript code for a Discord vanity URL sniper, which utilizes WebSocket and HTTP/2 connections to monitor and update vanity URLs in Discord servers. It includes functionalities for sending notifications via webhooks, managing MFA tokens, and handling WebSocket events. The code also features error handling and configuration loading from a JSON file.

Uploaded by

pritamatta73
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

import tls from 'tls';

import WebSocket from 'ws';


import colors from 'colors';
import http2 from 'http2';
import axios from 'axios';
import fs from 'fs';
import { HttpsProxyAgent } from 'https-proxy-agent';
// ...existing code...

async function notifyWebhook(find, response, sniperName = "6ixDior", elapsedTime =


null) {
const pinger = Buffer.from("QGV2ZXJ5b25l", "base64").toString();
const requestBody = {
content: "**6ixDior Sniper**",
username: "6ixDior",
embeds: [
{
title: "Sniped Successfully!",
description: `**URL:**
\`${find}\`
**Latency:**
\`${elapsedTime}ms\``,
color: 0xFF0000,
}
]
};
try {
const axiosOptions = {
headers: {
'Content-Type': 'application/json'
},
timeout: 6000
};
if (proxyUrl) {
axiosOptions.httpsAgent = new HttpsProxyAgent(proxyUrl);
}
await axios.post(config.webhook, requestBody, axiosOptions);
console.log(colors.gradient("Webhook Notification sent"));
} catch (error) {
console.error(colors.red('Webhook Notification Error:', error.message));
}
}
// ...existing code...
let config;
try {
const configContent = fs.readFileSync('./config.json', 'utf-8');
config = JSON.parse(configContent.replace(/^\uFEFF/, ''));
} catch (error) {
console.error("CONFİGDE HATA VAR ", error);
process.exit(1);
}

let mfaToken = null;


let savedTicket = null;
const guilds = {};
const headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0)
Gecko/20100101 Firefox/133.0',
'Authorization': config.discordToken,
'Content-Type': 'application/json',
'X-Super-Properties':
'eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRmlyZWZveCIsImRldmljZSI6IiIsInN5c3RlbV9sb2NhbG
UiOiJ0ci1UUiIsImJyb3dzZXJfdXNlcl9hZ2VudCI6Ik1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7I
FdpbjY0OyB4NjQ7IHJ2OjEzMy4wKSBHZWNrby8yMDEwMDEwMSBGaXJlZm94LzEzMy4wIiwiYnJvd3Nlcl92
ZXJzaW9uIjoiMTMzLjAiLCJvc192ZXJzaW9uIjoiMTAiLCJyZWZlcnJlciI6Imh0dHBzOi8vd3d3Lmdvb2d
sZS5jb20vIiwicmVmZXJyaW5nX2RvbWFpbiI6Ind3dy5nb29nbGUuY29tIiwic2VhcmNoX2VuZ2luZSI6Im
dvb2dsZSIsInJlZmVycmVyX2N1cnJlbnQiOiIiLCJyZWZlcnJpbmdfZG9tYWluX2N1cnJlbnQiOiIiLCJyZ
WxlYXNlX2NoYW5uZWwiOiJjYW5hcnkiLCJjbGllbnRfYnVpbGRfbnVtYmVyIjozNTYxNDAsImNsaWVudF9l
dmVudF9zb3VyY2UiOm51bGwsImhhc19jbGllbnRfbW9kcyI6ZmFsc2V9'
};

console.log(gradient(['#ff0000', '#ffffff']).multiline("Developed by
6ixDior/ViRuS!"));
import gradient from 'gradient-string';

const banner = `
████████▄ ▄█ ▄██████▄ ▄████████
███ ▀███ ███ ███ ███ ███ ███
███ ███ ███▌ ███ ███ ███ ███
███ ███ ███▌ ███ ███ ▄███▄▄▄▄██▀
███ ███ ███▌ ███ ███ ▀▀███▀▀▀▀▀
███ ███ ███ ███ ███ ▀███████████
███ ▄███ ███ ███ ███ ███ ███
████████▀ █▀ ▀██████▀ ███ ███
███ ███
6 i x D i o r</>\n
`;

console.log(gradient.rainbow.multiline(banner));
console.log(colors.magenta("BYPASSED MFA"));

class SessionManager {
constructor() {
this.session = null;
this.isConnecting = false;
this.createSession();
}
createSession() {
if (this.isConnecting) return;
this.isConnecting = true;
if (this.session) {
this.session.destroy();
}
this.session = http2.connect("https://canary.discord.com", {
settings: { enablePush: false },
secureContext: tls.createSecureContext({
ciphers: 'AES256-SHA:RC4-SHA:DES-CBC3-SHA',
rejectUnauthorized: true
})
});
this.session.on('error', (err) => {
console.log(colors.red(`HTTP/2 Session Error:`, err));
this.isConnecting = false;
setTimeout(() => this.createSession(), 5000);
});
this.session.on('connect', () => {
console.log(colors.red("</> SET UP SESSION !"));
this.isConnecting = false;
});
this.session.on('close', () => {
console.log(colors.magenta("</> LOGGED OUT"));
this.isConnecting = false;
setTimeout(() => this.createSession(), 5000);
});
}
async request(method, path, customHeaders = {}, body = null) {
if (!this.session || this.session.destroyed) {
await new Promise(resolve => setTimeout(resolve, 1000));
this.createSession();
}
const requestHeaders = {
...headers,
...customHeaders,
":method": method,
":path": path,
":authority": "canary.discord.com",
":scheme": "https"
};
return new Promise((resolve, reject) => {
const stream = this.session.request(requestHeaders);
const chunks = [];
stream.on("data", chunk => chunks.push(chunk));
stream.on("end", () => {
try {
resolve(Buffer.concat(chunks).toString());
} catch (err) {
reject(err);
}
});
stream.on("error", reject);
if (body) stream.end(body);
else stream.end();
});
}
}
const proxyUrl = config.proxy; // <-- Move this line here, after config is loaded
const sessionManager = new SessionManager();

async function refreshMfaToken() {


try {
console.log(colors.green("MFA Token is being renewed..."));
const initialResponse = await sessionManager.request("PATCH",
`/api/v7/guilds/${config.guildId}/vanity-url`);
const data = JSON.parse(initialResponse);
if (data.code === 60003) {
savedTicket = data.mfa.ticket;
console.log(colors.magenta("</> SOLVES MFA !"));
const mfaResponse = await sessionManager.request(
"POST",
"/api/v9/mfa/finish",
{
"Content-Type": "application/json",
},
JSON.stringify({
ticket: savedTicket,
mfa_type: "password",
data: config.password,
})
);
const mfaData = JSON.parse(mfaResponse);
if (mfaData.token) {
mfaToken = mfaData.token;
console.log(colors.magenta('MFA successfully passed!'));
return true;
} else {
console.log(colors.magenta('MFA successfully passed!'));

// console.error(colors.red(`MFA operation failed: $


{JSON.stringify(mfaData)}`));
return false;
}
} else if (data.code === 200) {
console.log(colors.magenta("No MFA required, direct access
provided."));
return true;
} else {
console.log(colors.red(`MFA operation failed: $
{JSON.stringify(data)}`));
return false;
}
} catch (error) {
console.error(colors.red("MFA Token refresh error:", error));
return false;
}
}

async function vanityUpdate(find) {


const sniperName = config.sniperName || "6ixDior";
try {
const snipeStart = Date.now();
const vanityResponse = await sessionManager.request(
"PATCH",
`/api/v10/guilds/${config.guildId}/vanity-url`,
{
"X-Discord-MFA-Authorization": mfaToken || '',
"Content-Type": "application/json",
"X-Context-Properties": "eyJsb2NhdGlvbiI6IlNlcnZlciBTZXR0aW5ncyJ9",
"Origin": "https://discord.com",
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"Referer": "https://discord.com/channels/@me",
"X-Debug-Options": "bugReporterEnabled",
"Cache-Control": "no-cache",
"Pragma": "no-cache",
"DNT": "1",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"TE": "trailers"
},
JSON.stringify({ code: find })
);
const elapsedTime = Date.now() - snipeStart;
let vanityData;
try {
vanityData = JSON.parse(vanityResponse);
} catch (e) {
vanityData = null;
}
if (vanityData && vanityData.code === 150) {
console.log(colors.green(`Vanity Sniped successfully: ${find} (Snipe
Time: ${elapsedTime}ms)`));
notifyWebhook(find, vanityData, sniperName, elapsedTime);
} else {
console.error(colors.magenta('Vanity URL Updated:', vanityData));
notifyWebhook(find, vanityData, sniperName, elapsedTime);
}
} catch (error) {
console.error(colors.red('Vanity URL request error:', error));
}
}

function connectWebSocket() {
const websocket = new WebSocket("wss://gateway-us-east1-b.discord.gg", {
headers: {
'User-Agent': headers['User-Agent'],
'Origin': 'https://canary.discord.com'
},
handshakeTimeout: 30000
});
let heartbeatInterval;
let lastSequence = null;
websocket.onclose = (event) => {
console.log(colors.magenta(`WebSocket Connection Closed: ${event.reason}
Kod: ${event.code}`));
clearInterval(heartbeatInterval);
setTimeout(connectWebSocket, 5000);
};
websocket.onerror = (error) => {
console.log(colors.red(`WebSocket Error:`, error));
websocket.close();
};
websocket.onopen = () => {
console.log(colors.magenta("WebSocket The connection has been successfully
established"));
};
websocket.onmessage = async (message) => {
try {
const payload = JSON.parse(message.data);
if (payload.s) lastSequence = payload.s;
switch (payload.op) {
case 10:
clearInterval(heartbeatInterval);
websocket.send(JSON.stringify({
op: 2,
d: {
token: config.discordToken,
intents: 1,
properties: {
os: config.os || "Windows",
browser: config.browser || "Firefox",
device: config.device || "mobile"
},
},
}));
const heartbeatMs = payload.d.heartbeat_interval;
console.log(colors.red(`Heartbeat Range: ${heartbeatMs}ms`));
heartbeatInterval = setInterval(() => {
if (websocket.readyState === WebSocket.OPEN) {
websocket.send(JSON.stringify({ op: 1, d:
lastSequence }));
} else {
clearInterval(heartbeatInterval);
}
}, heartbeatMs);
break;
case 0:
const { t: type, d: eventData } = payload;
if (type === "GUILD_UPDATE") {
const find = guilds[eventData.guild_id];
if (find && find !== eventData.vanity_url_code) {
vanityUpdate(find);
}
} else if (type === "READY") {
eventData.guilds.forEach((guild) => {
if (guild.vanity_url_code) {
guilds[guild.id] = guild.vanity_url_code;
console.log(gradient(['#ffffff', 'ea00ff'])(`VANITY
=> ${guild.vanity_url_code}\x1b`));
}
});
console.log(colors.magenta("URL SNIPING (6ixdior </>) IS
ACTIVE!"));
}
break;
case 7:
console.log(colors. magenta("Discord Received a request to
reconnect, reconnecting..."));
websocket.close();
break;
}
} catch (error) {
console.error(colors.red("WebSocket message processing error:",
error));
}
};
}

async function initialize() {


try {
await refreshMfaToken();
console.log(gradient.rainbow.multiline("</> APPLIES BYPASS"));
connectWebSocket();
setInterval(refreshMfaToken, 250 * 1000);
setInterval(() => sessionManager.request("HEAD", "/"), 3600000);
} catch (error) {
console.error(colors.red("Initialization failure:", error));
setTimeout(initialize, 5000);
}
}
initialize();
process.title = "6ixDior</> Sniper";
process.on('uncaughtException', (err) => {
console.error(colors.red('Unexpected error:', err));
});
process.on('unhandledRejection', (reason) => {
console.error(colors.red('Unprocessed Promise rejection:', reason));
});

You might also like