
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
puppeteer-real-browser
Advanced tools
This package is designed to bypass puppeteer's bot-detecting captchas such as Cloudflare. It acts like a real browser and can be managed with puppeteer.
This package prevents Puppeteer from being detected as a bot in services like Cloudflare and allows you to pass captchas without any problems. It behaves like a real browser.
npm i puppeteer-real-browser
If it will run on linux you will also need to install xvfb.
sudo apt-get install xvfb
const start = async () => {
var { puppeteerRealBrowser } = await import('puppeteer-real-browser')
const { page, browser } = await puppeteerRealBrowser({})
}
import {puppeteerRealBrowser} from 'puppeteer-real-browser'
const { page, browser } = await puppeteerRealBrowser({})
This package has 2 types of use. The first one opens the browser and connects with puppeteer. In this usage you cannot install chrome plugin or set puppeteer launch settings. If you don't need these, the first use is the best and lightest. Use 2 runs chromium. Then it opens a new browser with puppeteer.launch and connects to chromium. In total you have 2 browsers open. But you can use the same commands as with puppeteer.launch. Use 2 consumes more resources.
import {puppeteerRealBrowser} from 'puppeteer-real-browser'
puppeteerRealBrowser({
headless: false, // (optional) The default is false. If true is sent, the browser opens incognito. If false is sent, the browser opens visible.
action:'default', // (optional) If default, it connects with puppeteer by opening the browser and returns you the page and browser. if socket is sent, it returns you the browser url to connect to.
executablePath:'default', // (optional) If you want to use a different browser instead of Chromium, you can pass the browser path with this variable.
// (optional) If you are using a proxy, you can send it as follows.
// proxy:{
// host:'<proxy-host>',
// port:'<proxy-port>',
// username:'<proxy-username>',
// password:'<proxy-password>'
// }
})
.then(async response => {
const {browser, page} = response
await page.goto('<url>')
})
.catch(error=>{
console.log(error.message)
})
This opens a hidden chromium. Puppeteer will return a socket url for you to connect to this chromium. With this url you can use puppeteer to open a new browser and use it. Example is given below. Both methods create the same quality browser. Method 2 consumes more resources but is manageable.
import {puppeteerRealBrowser} from 'puppeteer-real-browser'
import puppeteer from 'puppeteer-extra';
puppeteerRealBrowser({
headless: true, // (optional) The default is false. If true is sent, the browser opens incognito. If false is sent, the browser opens visible.
action:'socket', // (optional) If default, it connects with puppeteer by opening the browser and returns you the page and browser. if socket is sent, it returns you the browser url to connect to.
executablePath:'default', // (optional) If you want to use a different browser instead of Chromium, you can pass the browser path with this variable.
// (optional) If you are using a proxy, you can send it as follows.
// proxy:{
// host:'<proxy-host>',
// port:'<proxy-port>',
// username:'<proxy-username>',
// password:'<proxy-password>'
// }
})
.then(async response => {
const { browserWSEndpoint, userAgent, closeSession, chromePath } = response
const browser = await puppeteer.launch({
targetFilter: (target) => !!target.url(),
browserWSEndpoint: browserWSEndpoint,
headless:false,
executablePath: chromePath
// ... puppeteer args
});
const page = await browser.newPage()
await page.goto('<url>')
await closeSession()
await browser.close()
})
.catch(error=>{
console.log(error.message)
})
This library was created to understand how scanners like puppeteer are detected and to teach how to prevent detection. Its purpose is purely educational. Illegal use of the library is prohibited. The user is responsible for any problems that may arise. The repo owner accepts no responsibility.
FAQs
This package is designed to bypass puppeteer's bot-detecting captchas such as Cloudflare. It acts like a real browser and can be managed with puppeteer.
We found that puppeteer-real-browser 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.