Skip to content

Commit

Permalink
Update cloudflare_bypass.py
Browse files Browse the repository at this point in the history
  • Loading branch information
0xYumeko authored Oct 22, 2024
1 parent 3de5716 commit cd4956c
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions cloudflare_bypass.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,53 @@

import time
from DrissionPage import ChromiumPage, ChromiumOptions


from colorama import Fore, Style

# Header design with stars and improved spacing
def print_logo():
logo = f"""
{Fore.RED}******************************************************************************{Style.RESET_ALL}
{Fore.GREEN}██╗ ██╗███████╗██╗ ██╗ ████████╗ █████╗ ██╗ ██╗███████╗██████╗ ██╗ ██╗{Style.RESET_ALL}
{Fore.GREEN}██║ ██║██╔════╝██║ ██║ ╚══██╔══╝██╔══██╗██║ ██║██╔════╝██╔══██╗ ╚██╗██╔╝{Style.RESET_ALL}
{Fore.GREEN}███████║█████╗ ██║ ██║ ██║ ███████║███████║█████╗ ██████╔╝ ╚███╔╝ {Style.RESET_ALL}
{Fore.GREEN}██╔══██║██╔══╝ ██║ ██║ ██║ ██╔══██║██╔══██║██╔══╝ ██╔══██╗ ██╔██╗ {Style.RESET_ALL}
{Fore.GREEN}██║ ██║███████╗███████╗███████╗ ██║ ██║ ██║██║ ██║███████╗██║ ██║ ██╔╝ ██╗{Style.RESET_ALL}
{Fore.RED}╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝{Style.RESET_ALL}
{Fore.RED}******************************************************************************{Style.RESET_ALL}
"""
print(logo)

# Function to print status messages with proper formatting
def print_status(message, status_type='info'):
if status_type == 'info':
print(f"{Fore.BLUE}[INFO] {Style.RESET_ALL}{message}")
elif status_type == 'success':
print(f"{Fore.GREEN}[SUCCESS] {Style.RESET_ALL}{message}")
elif status_type == 'warning':
print(f"{Fore.YELLOW}[WARNING] {Style.RESET_ALL}{message}")
elif status_type == 'error':
print(f"{Fore.RED}[ERROR] {Style.RESET_ALL}{message}")

# CAPTCHA bypass cycle with organized steps and status updates
def pass_cycle(_driver: ChromiumPage):

try:
if _driver('xpath://div/iframe').s_ele(".ctp-checkbox-label") is not None:
print_status("CAPTCHA found, attempting to bypass...", "warning")
_driver('xpath://div/iframe').ele(".ctp-checkbox-label", timeout=0.1).click()
print_status("CAPTCHA bypassed successfully!", "success")
except:
print_status("Failed to bypass CAPTCHA.", "error")
pass


if __name__ == '__main__':
print_logo() # Display the enhanced logo

browser_path = "/usr/bin/google-chrome"

# Set Chromium options
options = ChromiumOptions()
options.set_paths(browser_path=browser_path)
options.set_paths(browser_path=browser_path) # Setting the browser path

arguments = [
"-no-first-run",
Expand All @@ -37,25 +67,30 @@ def pass_cycle(_driver: ChromiumPage):
"-disable-gpu"
]

# Apply Chromium arguments for better performance
for argument in arguments:
options.set_argument(argument)

driver = ChromiumPage(addr_driver_opts=options)
# Initialize the ChromiumPage
driver = ChromiumPage(options=options)

print_status("Launching the browser and opening the website...", "info")
driver.get('https://nowsecure.nl')

# Loop to check for the CAPTCHA and bypass if detected
while True:
pass_cycle(driver)
try:
ele = driver.s_ele('xpath://h3')
if ele.text == "nowSecure.nl":
print_status("Website loaded successfully!", "success")
break
except:
time.sleep(.1)

time.sleep(5)

driver.quit()
print("Done")
print_status("Process completed successfully! Goodbye!", "success")



Expand Down

0 comments on commit cd4956c

Please sign in to comment.