
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
cloak-stealth
Advanced tools
Cloak Stealth is a powerful browser automation library that allows you to manage browser profiles, control proxy settings, and perform various browser-related tasks with advanced fingerprinting protection.
If you're using ES modules, you can import the package like this:
import CloakStealth from 'cloak-stealth';
// Use the package
const cloak = new CloakStealth();
// ... rest of your code
If you're using CommonJS, you can require the package like this:
const CloakStealth = require('cloak-stealth');
// Use the package
const cloak = new CloakStealth();
// ... rest of your code
import { CloakAPIManager, CloakAPIOptions, ProfileCreationOptions, ProxyConfig, BrowserConnection } from 'cloak-stealth';
const options: CloakAPIOptions = {
apiKey: "lsk_8eb27803a3ada31587b0f125328b25f7eb4f47xxxxxxxx",
currentDir: '/path/to/working/directory',
browsersDir: '/path/to/browser/profiles',
extensions: ['/path/to/extensions', '/path/to/extensions'],
windowOptions: { cols: 1280, rows: 720 },
clearCacheAndHistory: true,
turnstile: false,
advancedStealthMode: false,
proxyConfig: {
type: 'rotate',
proxies: ['ip1:port1:user1:pass1', 'ip2:port2:user2:pass2'],
proxyMode: 'http'
}
};
const manager = new CloakAPIManager(options);
const profileOptions: ProfileCreationOptions = {
name: 'MyProfile',
os: 'win',
audioContext: {
mode: "noise",
},
canvas: {
mode: "off",
},
webGL: {
mode: "off",
},
webGLMetadata: {
mode: "noise",
},
navigator: {
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
resolution: '1920x1080',
language: 'en-US',
platform: 'Win32',
hardwareConcurrency: 8,
deviceMemory: 8
},
googleServicesEnabled: true,
lockEnabled: false
};
const profileId = await manager.create(profileOptions);
console.log('Created profile:', profileId);
const profileIds = await manager.quickCreateMultipleProfiles(5, 'BatchProfile', 1000, {
os: 'lin',
navigator: {
resolution: '1366x768'
}
});
console.log('Created profiles:', profileIds);
const exists = await manager.profileExists('profile-id');
console.log('Profile exists:', exists);
const allProfiles = await manager.getAllProfiles(1,10);
console.log('All profiles:', allProfiles);
// Delete a single profile
const result = await manager.delete('profile-id');
console.log('Deletion result:', result);
// Delete specific profiles
const specificResults = await manager.deleteAllProfiles(['profile-id-1', 'profile-id-2', 'profile-id-3']);
console.log('Specific deletion results:', specificResults);
// Delete all profiles
const results = await manager.deleteAllProfiles();
console.log('Deletion results:', results);
const connection = await manager.start({ profileId: 'your-profile-id' });
if (connection) {
const { browser, page } = connection;
await page.goto('https://example.com');
// Perform other actions...
await manager.closeProfile(connection);
}
const automationFunction = async (connection: BrowserConnection, index: number) => {
const { page } = connection;
await page.goto('https://example.com');
// Perform actions...
const title = await page.title();
console.log(`Page ${index} title:`, title);
};
await manager.runAllProfiles(automationFunction, {
threads: 5,
startIndex: 0,
endIndex: 10,
delay: 1000,
autoClose: true
});
await manager.changeProfileProxy('profile-id', {
mode: 'http',
host: 'proxy.example.com',
port: 8080,
username: 'user',
password: 'pass'
});
const rotateConfig: ProxyConfig = {
type: 'rotate',
proxies: ['ip1:port1:user1:pass1', 'ip2:port2:user2:pass2'],
proxyMode: 'http'
};
// Use this config when creating the CloakAPIManager instance
const batchConfig: ProxyConfig = {
type: 'batch',
proxies: ['ip1:port1:user1:pass1', 'ip2:port2:user2:pass2'],
batchSize: 5,
proxyMode: 'http'
};
// Use this config when creating the CloakAPIManager instance
await manager.changeProfileResolution('profile-id', { width: 1920, height: 1080 });
await manager.changeProfileUserAgent('profile-id', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36');
const success = await manager.setProfileTimezone('profile-id', 'America/New_York');
console.log('Timezone set:', success);
// Get all bookmarks
const bookmarks = await manager.getBookmarks('profile-id');
console.log('Bookmarks:', bookmarks);
// Add a bookmark
await manager.addBookmark('profile-id', {
title: 'Example',
url: 'https://example.com'
});
// Remove a bookmark
await manager.removeBookmark('profile-id', 'bookmark-id');
// Exit a specific browser
await manager.closeBrowser(browserConnection);
// Exit all browsers
await manager.exitAllBrowsers();
// Exit the CloakAPIManager instance
await manager.exit();
// Exit all CloakAPIManager instances
await exitAll();
const customAutomation = async (connection: BrowserConnection) => {
const { page } = connection;
try {
await page.goto('https://example.com');
const element = await page.waitForSelector('#specific-element', { timeout: 5000 });
if (element) {
await element.click();
// Perform more actions...
}
} catch (error) {
console.error('Automation error:', error);
}
};
await manager.start({
profileId: 'your-profile-id',
skipCheckBrowser: true
}, customAutomation);
const rotateProxyAutomation = async (connection: BrowserConnection, index: number) => {
const { page } = connection;
let retries = 3;
while (retries > 0) {
try {
await page.goto('https://example.com');
// If successful, break the loop
break;
} catch (error) {
console.error(`Error on attempt ${4 - retries}:`, error);
retries--;
if (retries > 0) {
// Rotate to next proxy
await manager.assignProxyToProfile(connection.profileId, index + 1);
}
}
}
};
await manager.runAllProfiles(rotateProxyAutomation, { threads: 3 });
Proxy Connection Issues: Ensure your proxy settings are correct and the proxies are active. Try using a different proxy or temporarily disabling proxy to isolate the issue.
Fingerprinting Detection: If websites are detecting your automated activity, try adjusting the noise settings for canvas, WebGL, and audio context. You may also need to randomize your user agent and other navigator properties more frequently.
Performance Issues: If you're running many profiles concurrently, try reducing the number of threads or increasing the delay between actions to reduce resource usage.
Bypass Turnstile: Automatically check and bypass Turnstile by ensuring the turnstile option is set to true. If issues persist, consider implementing additional strategies or using specialized services designed for this purpose.
Contributions are welcome! Please feel free to submit a Pull Request.
FAQs
A high-level API to control Orbita browser over Cloak API
We found that cloak-stealth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.