ignitetnt
Version:
IGNITE OS — Advanced proxy-enabled gaming platform with comprehensive filter bypass system
280 lines (242 loc) • 7.38 kB
JavaScript
// URL obfuscation and encoding utilities
// Multiple encoding methods to bypass network filters
class ProxyEncoder {
constructor() {
// Multiple encoding keys for rotation
this.encodingKeys = [
'IgniteOS2024',
'UnblockGames',
'ProxySystem',
'GameAccess'
];
this.currentKeyIndex = 0;
}
// XOR encoding with key rotation
xorEncode(text, key = null) {
if (!key) {
key = this.encodingKeys[this.currentKeyIndex];
this.currentKeyIndex = (this.currentKeyIndex + 1) % this.encodingKeys.length;
}
let result = '';
for (let i = 0; i < text.length; i++) {
result += String.fromCharCode(
text.charCodeAt(i) ^ key.charCodeAt(i % key.length)
);
}
return btoa(result).replace(/[+/=]/g, c =>
({ '+': '-', '/': '_', '=': '' }[c])
);
}
// XOR decode
xorDecode(encoded, key = null) {
try {
// Restore base64 padding and characters
let b64 = encoded.replace(/-/g, '+').replace(/_/g, '/');
while (b64.length % 4) b64 += '=';
const decoded = atob(b64);
// Try all keys if none specified
const keysToTry = key ? [key] : this.encodingKeys;
for (const testKey of keysToTry) {
let result = '';
for (let i = 0; i < decoded.length; i++) {
result += String.fromCharCode(
decoded.charCodeAt(i) ^ testKey.charCodeAt(i % testKey.length)
);
}
// Check if result looks like a valid URL
if (result.startsWith('http')) {
return result;
}
}
throw new Error('Unable to decode URL');
} catch (e) {
console.error('Decode error:', e);
return null;
}
}
// Simple base64 with character substitution
simpleEncode(url) {
return btoa(url)
.replace(/A/g, 'X')
.replace(/B/g, 'Y')
.replace(/C/g, 'Z')
.replace(/[+/=]/g, c => ({ '+': '-', '/': '_', '=': '' }[c]));
}
simpleDecode(encoded) {
try {
let decoded = encoded
.replace(/X/g, 'A')
.replace(/Y/g, 'B')
.replace(/Z/g, 'C')
.replace(/-/g, '+')
.replace(/_/g, '/');
while (decoded.length % 4) decoded += '=';
return atob(decoded);
} catch (e) {
return null;
}
}
// ROT13 variant for additional obfuscation
rot13Encode(text) {
return text.replace(/[a-zA-Z]/g, char => {
const start = char <= 'Z' ? 65 : 97;
return String.fromCharCode(((char.charCodeAt(0) - start + 13) % 26) + start);
});
}
rot13Decode(text) {
return this.rot13Encode(text); // ROT13 is self-inverse
}
// URL path disguising
disguiseUrl(url) {
const encoded = this.xorEncode(url);
const disguisedPaths = [
'api/v1/content',
'assets/data/load',
'cdn/resources/get',
'static/files/fetch',
'media/stream/play',
'docs/public/view',
'libs/vendor/import'
];
const randomPath = disguisedPaths[Math.floor(Math.random() * disguisedPaths.length)];
return `/${randomPath}?id=${encoded}&cache=${Date.now()}`;
}
// Extract URL from disguised path
extractUrl(disguisedPath) {
const url = new URL(disguisedPath, window.location.origin);
const id = url.searchParams.get('id');
return id ? this.xorDecode(id) : null;
}
// Multiple encoding layers
multiEncode(url) {
// Layer 1: ROT13
let encoded = this.rot13Encode(url);
// Layer 2: XOR
encoded = this.xorEncode(encoded);
// Layer 3: Simple substitution
encoded = this.simpleEncode(encoded);
return encoded;
}
multiDecode(encoded) {
try {
// Reverse Layer 3: Simple substitution
let decoded = this.simpleDecode(encoded);
if (!decoded) return null;
// Reverse Layer 2: XOR
decoded = this.xorDecode(decoded);
if (!decoded) return null;
// Reverse Layer 1: ROT13
decoded = this.rot13Decode(decoded);
return decoded;
} catch (e) {
return null;
}
}
// Domain substitution map
getDomainSubstitutes() {
return {
'gms.parcoil.com': [
'content.gameserver.net',
'media.cdn-games.org',
'assets.playzone.io',
'files.gamehost.dev'
],
'drive.google.com': [
'docs.googleapis.com',
'storage.cloud.google.com',
'content.googleusercontent.com'
]
};
}
// Get random domain substitute
getRandomDomain(originalDomain) {
const substitutes = this.getDomainSubstitutes();
if (substitutes[originalDomain]) {
const options = substitutes[originalDomain];
return options[Math.floor(Math.random() * options.length)];
}
return originalDomain;
}
// Create multiple encoded versions of URL
createEncodedVariants(url) {
return {
simple: this.simpleEncode(url),
xor: this.xorEncode(url),
multi: this.multiEncode(url),
disguised: this.disguiseUrl(url),
rot13: btoa(this.rot13Encode(url)).replace(/[+/=]/g, c =>
({ '+': '-', '/': '_', '=': '' }[c])
)
};
}
// Decode any variant
decodeVariant(encoded, method = 'auto') {
if (method === 'auto') {
// Try all methods
const methods = ['simple', 'xor', 'multi', 'rot13', 'disguised'];
for (const m of methods) {
const result = this.decodeVariant(encoded, m);
if (result && result.startsWith('http')) {
return result;
}
}
return null;
}
switch (method) {
case 'simple':
return this.simpleDecode(encoded);
case 'xor':
return this.xorDecode(encoded);
case 'multi':
return this.multiDecode(encoded);
case 'rot13':
try {
let b64 = encoded.replace(/-/g, '+').replace(/_/g, '/');
while (b64.length % 4) b64 += '=';
return this.rot13Decode(atob(b64));
} catch (e) {
return null;
}
case 'disguised':
return this.extractUrl(encoded);
default:
return null;
}
}
}
// URL pattern randomization
class URLRandomizer {
constructor() {
this.patterns = [
'search?q={encoded}',
'api/v1/data?token={encoded}',
'cdn/assets?file={encoded}',
'media/stream?id={encoded}',
'docs/view?doc={encoded}',
'static/load?resource={encoded}'
];
}
randomizeUrl(baseUrl, encodedData) {
const pattern = this.patterns[Math.floor(Math.random() * this.patterns.length)];
const randomParams = this.generateRandomParams();
return `${baseUrl}/${pattern.replace('{encoded}', encodedData)}&${randomParams}`;
}
generateRandomParams() {
const params = [];
const keys = ['cache', 'v', 'ref', 'src', 't', 'hash'];
const numParams = Math.floor(Math.random() * 3) + 1;
for (let i = 0; i < numParams; i++) {
const key = keys[Math.floor(Math.random() * keys.length)];
const value = Math.random().toString(36).substring(2, 8);
params.push(`${key}=${value}`);
}
return params.join('&');
}
}
// Export utilities
window.ProxyEncoder = ProxyEncoder;
window.URLRandomizer = URLRandomizer;
// Create global instances
window.proxyEncoder = new ProxyEncoder();
window.urlRandomizer = new URLRandomizer();
export { ProxyEncoder, URLRandomizer };