Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some stuff we could add #594

Open
s-b-repo opened this issue Oct 29, 2024 · 0 comments
Open

some stuff we could add #594

s-b-repo opened this issue Oct 29, 2024 · 0 comments

Comments

@s-b-repo
Copy link

javascript

// Override User Agent to spoof as a different browser
Object.defineProperty(navigator, "userAgent", {
value: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
writable: false,
});

// Override platform
Object.defineProperty(navigator, "platform", {
value: "Win32",
writable: false,
});

// Spoofing browser language settings
Object.defineProperty(navigator, "language", {
value: "en-US",
writable: false,
});
Object.defineProperty(navigator, "languages", {
value: ["en-US", "en"],
writable: false,
});

// Spoof WebGL Renderer and Vendor (requires WebGL context manipulation)
const spoofWebGL = (context) => {
const getParameter = context.getParameter;
context.getParameter = function (param) {
// Spoof as Intel GPU (common for Chrome on Windows)
if (param === context.RENDERER) {
return "Intel(R) UHD Graphics 630";
}
if (param === context.VENDOR) {
return "Intel Inc.";
}
return getParameter.call(context, param);
};
};

// Apply WebGL spoofing
const canvas = document.createElement("canvas");
const gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
if (gl) spoofWebGL(gl);

This code hides or alters some easily accessible indicators, like userAgent, platform, and WebGL rendering properties. However, some of these properties are only modifiable in secure (browser extension or user-script) contexts because most browsers don’t allow altering these fields directly in a regular webpage context.

For robust spoofing, consider using a browser extension like Chameleon or CanvasBlocker for Firefox, which can manage these and additional indicators with broader success.
You said:
can you create 20 more

.

  1. Device Memory

Spoofs the amount of device memory reported by the browser.

javascript

Object.defineProperty(navigator, "deviceMemory", {
value: 8, // Spoof as 8 GB RAM
writable: false,
});

  1. Hardware Concurrency

Changes the number of logical processors or CPU cores.

javascript

Object.defineProperty(navigator, "hardwareConcurrency", {
value: 4, // Spoof as 4 cores
writable: false,
});

  1. Max Touch Points

Simulates touch capabilities or lack thereof.

javascript

Object.defineProperty(navigator, "maxTouchPoints", {
value: 0, // Spoof as a non-touch device
writable: false,
});

  1. Product

Hides or modifies the browser’s engine product name.

javascript

Object.defineProperty(navigator, "product", {
value: "Gecko", // Common for Firefox
writable: false,
});

  1. Product Sub

Alters the product sub-version for the browser engine.

javascript

Object.defineProperty(navigator, "productSub", {
value: "20100101", // Chrome commonly reports this
writable: false,
});

  1. Vendor

Modifies the vendor name of the browser.

javascript

Object.defineProperty(navigator, "vendor", {
value: "Google Inc.", // Spoof as Chrome
writable: false,
});

  1. Vendor Sub

Changes the vendor sub-string version (rarely used but can be spoofed).

javascript

Object.defineProperty(navigator, "vendorSub", {
value: "", // Set to an empty string to mimic most browsers
writable: false,
});

  1. Screen Width

Spoofs the screen width.

javascript

Object.defineProperty(screen, "width", {
value: 1920, // Spoof as 1080p screen width
writable: false,
});

  1. Screen Height

Spoofs the screen height.

javascript

Object.defineProperty(screen, "height", {
value: 1080, // Spoof as 1080p screen height
writable: false,
});

  1. Screen Color Depth

Changes the color depth of the screen.

javascript

Object.defineProperty(screen, "colorDepth", {
value: 24, // Spoof as 24-bit color depth
writable: false,
});

  1. Screen Pixel Depth

Modifies the pixel depth reported by the screen.

javascript

Object.defineProperty(screen, "pixelDepth", {
value: 24,
writable: false,
});

  1. Browser Online Status

Makes the browser appear offline or online.

javascript

Object.defineProperty(navigator, "onLine", {
value: false, // Make browser appear offline
writable: false,
});

  1. Do Not Track

Alters the Do Not Track header.

javascript

Object.defineProperty(navigator, "doNotTrack", {
value: "1", // Indicate Do Not Track enabled
writable: false,
});

  1. Clipboard Access

Prevents or simulates clipboard access availability.

javascript

navigator.clipboard = undefined; // Makes clipboard access unavailable

  1. Bluetooth Availability

Spoofs the Bluetooth API availability.

javascript

navigator.bluetooth = undefined; // Disables Bluetooth API

  1. Geolocation Availability

Hides the geolocation API from scripts.

javascript

navigator.geolocation = undefined; // Makes geolocation API inaccessible

  1. Battery API

Spoofs battery information.

javascript

navigator.getBattery = async () => ({
charging: true,
chargingTime: 0,
dischargingTime: Infinity,
level: 1, // 100% battery level
});

  1. Web Audio

Alters the Web Audio context properties.

javascript

const AudioContext = window.AudioContext || window.webkitAudioContext;
if (AudioContext) {
const originalCreateAnalyser = AudioContext.prototype.createAnalyser;
AudioContext.prototype.createAnalyser = function() {
const analyser = originalCreateAnalyser.call(this);
analyser.frequencyBinCount = 128; // Modifies the frequency bin count
return analyser;
};
}

  1. Local Storage

Limits or disables access to local storage.

javascript

Object.defineProperty(window, "localStorage", {
value: null, // Disables localStorage
});

  1. WebRTC IP Leak Protection

Overrides WebRTC to prevent IP leakage.

javascript

const originalRTCPeerConnection = window.RTCPeerConnection;
window.RTCPeerConnection = function(...args) {
const pc = new originalRTCPeerConnection(...args);
pc.createDataChannel = () => {}; // Disable data channels to block IP leak
return pc;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant