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.
This package integrates with Selenium or Playwright to solve any Temu captcha in one line of code.
This project is the SadCaptcha Temu Captcha Solver API client. The purpose is to make integrating SadCaptcha into your Selenium, Playwright, or Async Playwright app as simple as one line of code. Instructions for integrating with Selenium, Playwright, and Async Playwright are described below in their respective sections.
The end goal of this tool is to solve every single Temu captcha. Currently we are able to solve the arced slide, puzzle slide, and shapes challenge:
The Arced Slide challenge is the one where there is a puzzle piece that travels in an unpredictable trajectory, and there are two possible locations where the solution may be. The puzzle slide is unique in that the pieces relocate after you drag the slider. The shapes challenge shows a picture of various objects and has an associated text challenge.
PATH
playwright install
stealth
plugin for whichever browser automation framework you are using.
This project can be installed with pip
. Just run the following command:
pip install temu-captcha-solver
Import the package, set up the SeleniumSolver
class, and call it whenever you need.
This turns the entire captcha detection, solution, retry, and verification process into a single line of code.
It is the recommended method if you are using Playwright.
from temu_captcha_solver import SeleniumSolver
from selenium_stealth import stealth
import undetected_chromedriver as uc
driver = uc.Chrome(headless=False) # Use default undetected_chromedriver configuration!
api_key = "YOUR_API_KEY_HERE"
sadcaptcha = SeleniumSolver(driver, api_key)
# Selenium code that causes a Temu captcha...
sadcaptcha.solve_captcha_if_present(retries=5)
It is crucial that you use undetected_chromedriver
with the default configuration, instead of the standard Selenium chromedriver.
Failure to use the undetected_chromedriver
will result in "Verification failed" when attempting to solve the captcha.
Import the package, set up the PlaywrightSolver
class, and call it whenever you need.
This turns the entire captcha detection, solution, retry, and verification process into a single line of code.
It is the recommended method if you are using playwright.
from temu_captcha_solver import PlaywrightSolver
from playwright.sync_api import Page, sync_playwright
from playwright_stealth import stealth_sync, StealthConfig
api_key = "YOUR_API_KEY_HERE"
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
config = StealthConfig(navigator_languages=False, navigator_vendor=False, navigator_user_agent=False)
stealth_sync(page, config) # Use correct playwright_stealth configuration!
# Playwright code that causes a Temu captcha...
sadcaptcha = PlaywrightSolver(page, api_key)
sadcaptcha.solve_captcha_if_present(retries=5)
It is crucial that users of the Playwright client also use playwright-stealth
with the configuration specified above.
Failure to use the playwright-stealth
plugin will result in "Verification failed" when attempting to solve the captcha.
Import the package, set up the AsyncPlaywrightSolver
class, and call it whenever you need.
This turns the entire captcha detection, solution, retry, and verification process into a single line of code.
It is the recommended method if you are using async playwright.
import asyncio
from temu_captcha_solver import AsyncPlaywrightSolver
from playwright.async_api import Page, async_playwright
from playwright_stealth import stealth_async, StealthConfig
api_key = "YOUR_API_KEY_HERE"
async def main()
async with async_playwright() as p:
browser = await p.chromium.launch(headless=False)
page = await browser.new_page()
config = StealthConfig(navigator_languages=False, navigator_vendor=False, navigator_user_agent=False)
await stealth_async(page, config) # Use correct playwright_stealth configuration!
# Playwright code that causes a Temu captcha...
sadcaptcha = AsyncPlaywrightSolver(page, api_key)
await sadcaptcha.solve_captcha_if_present(retries=5)
asyncio.run(main())
It is crucial that users of the Playwright client also use playwright-stealth
with the stealth configuration specified above.
Failure to use the playwright-stealth
plugin will result in "Verification failed" when attempting to solve the captcha.
SadCaptcha supports using proxies and custom headers such as user agent. This is useful to avoid detection. To implement this feature, pass your proxy URL and headers dictionary as a keyword argument to the constructor of the solver.
api_key = "YOUR_API_KEY_HERE"
proxy = "http://username:password@123.0.1.2:80"
headers = {"User-Agent": "Chrome"}
# With Selenium Solver
driver = uc.Chrome(headless=False) # Use default undetected_chromedriver configuration!
api_key = "YOUR_API_KEY_HERE"
sadcaptcha = SeleniumSolver(driver, api_key, proxy=proxy, headers=headers)
# With Playwright Solver
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
stealth_sync(page) # Use default playwright_stealth configuration!
sadcaptcha = PlaywrightSolver(page, api_key, proxy=proxy, headers=headers)
sadcaptcha.solve_captcha_if_present(retries=5)
# With Async PlaywrightSolver
async def main()
async with async_playwright() as p:
browser = await p.chromium.launch(headless=False)
page = await browser.new_page()
await stealth_async(page) # Use default playwright_stealth configuration!
sadcaptcha = AsyncPlaywrightSolver(page, api_key, headers=headers, proxy=proxy)
await sadcaptcha.solve_captcha_if_present(retries=5)
FAQs
This package integrates with Selenium or Playwright to solve any Temu captcha in one line of code.
We found that temu-captcha-solver 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.
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.