Skip to content

Instantly share code, notes, and snippets.

@christianroman
Created May 30, 2013 16:02
Show Gist options
  • Save christianroman/5679049 to your computer and use it in GitHub Desktop.
Save christianroman/5679049 to your computer and use it in GitHub Desktop.
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
@neodouglas
Copy link

how i can solve that?
007444
002952
002963
004058
004967
005589

@AlexanderMortimer
Copy link

it is not working for my captcha @jtanori
1

@DiMiTriFrog
Copy link

it is not working for my captcha @jtanori
1

Any solutions nowadays?

@NotTrueFalse
Copy link

2jB4
6mKp
ByLt
HZj0
kumd
mVVZ
NJJ6
NW3K
tEvz
x1CP

Hi,
I want solve a Captcha similar yours.
Did you solve it?
i will appreciate if you help me .

@AlexanderMortimer
Copy link

AlexanderMortimer commented Jan 27, 2024 via email

@NotTrueFalse
Copy link

I was joking, I'm actually making a model to solve them, don't worry

@AlexanderMortimer
Copy link

AlexanderMortimer commented Jan 27, 2024 via email

@NotTrueFalse
Copy link

NotTrueFalse commented Jan 28, 2024

Sounds good. Please let me now whener it completed

https://github.com/NotTrueFalse/Captcha_solving/

@ytrezq
Copy link

ytrezq commented Feb 1, 2024

It's done, but it work only with the type of captcha I posted here, If you want me to make a model for your type of captcha, I need a dataset with at least 10k captcha. If you don't have it, send me an image, I'll find how to gen a lot of captcha, make a model then tell you how to use it. contact info : enderty on discord

@NotTrueFalse hey : those kind of captchas are automatically generated by https://captcha.com/java-captcha.html. You could get millions of such annotated captchas.

@ytrezq
Copy link

ytrezq commented Feb 1, 2024

@NotTrueFalse my intent wasn t generating the dataset myself.

@NotTrueFalse
Copy link

You want me to do all the step to create the model? At this point I could just create a website and make a cheap api for people

@ytrezq
Copy link

ytrezq commented Feb 1, 2024

@NotTrueFalse I lack the knowledge to train an ai and I m bad at advanced databases scenarios.

@nasrullahaminy
Copy link

download
how do i pass this captcha?
seriously need your help please

@Hammad554
Copy link

Bro I need a script for captcha solving I will pay you my
Email=[email protected]
My Watsapp = 03431958962

@CodeBySumant
Copy link

can someone help me build a code in python Selenium
image
https://sdms.udiseplus.gov.in/p0/v1/login?state-id=110

@CodeBySumant
Copy link

I will El El lun, 13 oct 2025 a las 19:29, Sumant Shekhar @.***> escribió:
really thanks man . :)
by the way r we using image rendering or cookies ?

@alerin00
Copy link

alerin00 commented Oct 13, 2025 via email

@CodeBySumant
Copy link

:( can you code Preety Please :)

import sys
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import ElementNotInteractableException
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
import time
import random

options = Options()
options.add_experimental_option("detach", True)

driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
driver.get("https://sdms.udiseplus.gov.in/p0/v1/login?state-id=110")
driver.maximize_window()

input_element = driver.find_element(By.CLASS_NAME, "form-control")
input_element.send_keys("username")

input_element = driver.find_element(By.ID, "password-field")
input_element.send_keys("passowrd")

captchas Bypaser

not worikng :(

#write own 15 sec wait
time.sleep(15)

try:
login_button = WebDriverWait(driver, 15).until(
EC.presence_of_element_located((By.ID, "submit-btn"))
)
login_button.click()
except Exception as e:
print(f"Error clicking login button: {e}")
time.sleep(25)

student_count = 1

@alerin00
Copy link

alerin00 commented Oct 13, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment