bypass-tool
v1.1.0
Published
A module to monitor and scan for raw URLs from specified hosting services in Node.js applications.
Downloads
7
Maintainers
Readme
🚀 bypass-tool
🛡️ Introduction
bypass-tool is a Node.js module designed to help developers and security analysts monitor and detect potentially suspicious network activity involving fetching content from specific raw content hosting services (such as cdn.discordapp.com, pastebin.com, etc.).
The module provides two core functionalities: real-time network monitoring and static file scanning.
✨ Key Features
- Global Axios Hook: Intercepts every
axios.getcall to monitored hosts, including automatic Base64 decoding of potential encoded URLs. - Static File Scanner: Scans code files statically (without execution) for embedded URLs matching monitored hosts.
- Real-time Console Output: Displays the list of detected URLs in real-time using
chalkvisualization. - TypeScript Support: Includes complete type declaration file (
index.d.ts).
💻 Getting Started
Installation
Install the module along with its required dependency, axios, and the visual dependency, chalk:
npm install bypass-tool axios chalk
💡 Tutorial: Quick Start
This tutorial shows how to combine static scanning and real-time monitoring to check your application code for suspicious URLs.
Step 1: Create a Test File
Assume you have a file named my_app_script.js that might contain raw links:
// my_app_script.js
const axios = require('axios');
function init() {
// This URL will be found by the Static Scanner (getRawUrl)
const encodedPayload = 'aHR0cHM6Ly9kaXNjb3JkYXBwLmNvbS9hc3NldHMvdmVjdG9yL2ZpbGU=';
// This is an example of a real-time call
axios.get('[https://dl.dropboxusercontent.com/s/sample/data.json](https://dl.dropboxusercontent.com/s/sample/data.json)');
}
module.exports = { init };
Step 2: Use bypass-tool
In your main entry file (e.g., index.js or main.js):
// main.js
const bypass = require('bypass-tool');
const axios = require('axios');
const app = require('./my_app_script');
// 1. Static Scan: Check the script file before running it
console.log('--- Step 1: Running Static Scan on my_app_script.js ---');
bypass.getRawUrl('my_app_script.js');
console.log('--- Static Scan Complete ---');
// 2. Start Monitor: Hooks axios.get globally
bypass.startMonitor();
// 3. Run Application Logic (will trigger axios calls)
console.log('\n--- Step 2: Running Application & Monitoring Network ---');
app.init();
// 4. Stop and Review Results
setTimeout(() => {
bypass.stopMonitor();
// Total URLs detected will include the one from Static Scan and the one from real-time monitoring.
const detectedUrls = bypass.getDetectedUrls();
console.log('\nFINAL REPORT: Total URLs Detected:', detectedUrls.length);
console.log(detectedUrls);
}, 5000);
Expected Output Summary
* Console will show [SCAN COMPLETE] with URLs found in my_app_script.js.
* Console will repeatedly show the real-time table update (updateConsoleDisplay).
* The table will eventually contain both URLs, including the one decoded from Base64.
📚 API Reference
The bypass-tool module provides four main public methods:
| Method | Description |
|---|---|
| bypass.startMonitor() | Activates the Global Hook on axios.get and starts the real-time console display refresh. |
| bypass.stopMonitor() | Stops the console refresh and restores axios.get to its original function. |
| bypass.getRawUrl(filePath) | Performs a Static Scan on the specified file (e.g., 'config.json'). Found URLs are added to the detection list. |
| bypass.getDetectedUrls() | Returns an array (string[]) of all URLs that have been detected (static and real-time). |
🛠️ Development & Support
Developed by kairozxp.
For support or inquiries, please contact: t.me/kairozxp.