Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
socks-scraper
Advanced tools
Library for Node.js for proxy collection and validation
npm i socks-scraper
/**
* like { address, host, port, latency }
* @typedef {Object} SocksScraper.IDefaultProxy
* @property {string} address
* @property {string} host
* @property {number} port
* @property {number} latency
*/
const SocksScraper = require('socks-scraper');
// Initialize the scraper with a list of raw sites
const socksScraper = new SocksScraper([
"https://raw.githubusercontent.com/casals-ar/proxy-list/main/socks5",
"https://raw.githubusercontent.com/casals-ar/proxy-list/main/socks4",
"https://shieldcommunity.net/sockets.txt",
"https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/socks4.txt",
"https://raw.githubusercontent.com/ShiftyTR/Proxy-List/master/socks4.txt"
])
// Add one more site to the list of sites on which free proxies are placed
socksScraper.addSites(["https://raw.githubusercontent.com/monosans/proxy-list/main/proxies/socks4.txt"])
// Timeout for checking the proxy in ms
const timeout = 6000
// Get a list of proxies from all sites, check if they work and return the best ones
const wsp4 = await socksScraper.getWorkedSocksProxies(4, timeout)
// Sort the list by latency and take the fastest proxy
const bestWSP4 = SocksScraper.filterByLatency(wsp4)[0]
console.log(`The best socks4 proxy is ${bestWSP4.host}:${bestWSP4.port} with latency ${bestWSP4.latency}ms`)
const wsp5 = await socksScraper.getWorkedSocksProxies(5, timeout)
const bestWSP5 = SocksScraper.filterByLatency(wsp5)[0]
console.log(`The best socks5 proxy is ${bestWSP5.host}:${bestWSP5.port} with latency ${bestWSP5.latency}ms`)
// Check my socks5 proxy to see if it works at all
const mySocks5Proxy = await socksScraper.checkSocksProxy(5, '3.122.84.99:3128', 4000)
const isAlive = Boolean(mySocks5Proxy)
console.log(`My socks5 proxy is ${isAlive ? 'alive' : 'dead'}`)
console.log(mySocks5Proxy)
My socks5 proxy is alive!
{
address: '3.122.84.99:3128',
host: '3.122.84.99',
port: 3128,
latency: 32
}
FAQs
Uses your references to obtain and verify proxies
The npm package socks-scraper receives a total of 2 weekly downloads. As such, socks-scraper popularity was classified as not popular.
We found that socks-scraper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.