
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
humanoid-js
Advanced tools

A Node.js package to bypass WAF anti-bot JS challenges.
Humanoid is a Node.js package to solve and bypass CloudFlare (and hopefully in the future - other WAFs' as well) JavaScript anti-bot challenges.
While anti-bot pages are solvable via headless browsers, they are pretty heavy and are usually considered over the top for scraping.
Humanoid can solve these challenges using the Node.js runtime and present the protected HTML page.
The session cookies can also be delegated to other bots to continue scraping causing them to avoid the JS challenges altogether.
Random browser User-Agent
Auto-retry on failed challenges
Highly configurable - hack custom cookies, headers, etc
Clearing cookies and rotating User-Agent is supported
Supports decompression of Brotli content-encoding. Not supported by Node.js' request by default!
via npm:
npm install --save humanoid-js
Basic usage with promises:
const Humanoid = require("humanoid-js");
let humanoid = new Humanoid();
humanoid.get("https://www.cloudflare-protected.com")
.then(res => {
console.log(res.body) // <!DOCTYPE html><html lang="en">...
})
.catch(err => {
console.error(err)
})
Humanoid uses auto-bypass by default. You can override it on instance creation:
let humanoid = new Humanoid(autoBypass=false)
humanoid.get("https://canyoupwn.me")
.then(res => {
console.log(res.statusCode) // 503
console.log(res.isSessionChallenged) // true
humanoid.bypassJSChallenge(res)
.then(challengeResponse => {
// Note that challengeResponse.isChallengeSolved won't be set to true when doing manual bypassing.
console.log(challengeResponse.body) // <!DOCTYPE html><html lang="en">...
})
}
)
.catch(err => {
console.error(err)
})
async/await is also supported, and is the preferred way to go:
(async function() {
let humanoid = new Humanoid();
let response = await humanoid.sendRequest("www.cloudflare-protected.com")
console.log(response.body) // <!DOCTYPE html><html lang="en">...
}())
All anti-bot challenges are likely to change in the future. If this is the case, please open an issue explaining
the problem - try to include the target page if possible. I'll do my best to keep the code up to date with
new challenges.
Any and all contributions are welcome - and are highly appreciated.
FAQs
Node.js package to bypass WAF anti-bot JavaScript challenges
The npm package humanoid-js receives a total of 127 weekly downloads. As such, humanoid-js popularity was classified as not popular.
We found that humanoid-js demonstrated a not healthy version release cadence and project activity because the last version was released 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.