Derpitron / Discord-OTP-Forcer

Selenium based discord OTP forcer
GNU Affero General Public License v3.0
43 stars 12 forks source link

[Bug]: Does not go through with closing and reopening a chrome window for Login #57

Closed Beezlebub3rd closed 1 year ago

Beezlebub3rd commented 1 year ago

Description

ran like, 36 codes, then proceeded to come with a TypeError.

Minimal Reproduction

ran setup, input the info for basic login and program mode config. ran start, then it just happened.

Error

Traceback (most recent call last): File "Documents\Discord-OTP-Forcer-main\main.py", line 67, in userFacing(loadcfg()) File "Documents\Discord-OTP-Forcer-main\main.py", line 63, in userFacing loginBootstrap(driver, cfg) File "Documents\Discord-OTP-Forcer-main\src\backend.py", line 100, in loginBootstrap codeEntry(driver, loginFields, cfg) File "Documents\Discord-OTP-Forcer-main\src\backend.py", line 180, in codeEntry finalStatDisplay('invalidSessionTicket', statistics) File "Documents\Discord-OTP-Forcer-main\src\backend.py", line 220, in finalStatDisplay f"Running {color('reset program mode')}!\n"\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: color() missing 1 required positional argument: 'color'

[Note I did delete some of the file pathing that was in the original text log, if it's really important I can re-enter it.]

Operating System Version

Windows 10, 22H2, 19045.3031

Python Version

3.11

Program Version

334496b

Any other information or context?

No response

Derpitron commented 1 year ago

There seem to be multiple bugs in this issue, the way I see it.

  1. password reset mode being triggered upon login mode failure
  2. Incorrect login-to-reset mode changing functionality

I will try to fix both of these.

Derpitron commented 1 year ago

This should be fixed in b0bf96de3e8446e68197a4d36c68d776f247e0c2. Let me know if the problem persists

Beezlebub3rd commented 1 year ago

We got farther in, it at least displayed the invalid session ticket message and the useful stats before giving me this log


  File "Documents\Discord-OTP-Forcer-main\main.py", line 67, in <module>
    userFacing(loadcfg())
  File "Documents\Discord-OTP-Forcer-main\main.py", line 63, in userFacing
    loginBootstrap(driver, cfg)
  File "Documents\Discord-OTP-Forcer-main\src\backend.py", line 104, in loginBootstrap
    codeEntry(driver, loginFields, cfg)
  File "Documents\Discord-OTP-Forcer-main\src\backend.py", line 196, in codeEntry
    loginTest = driver.find_element(by=By.CLASS_NAME, value='app-2CXKsg')
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1251, in find_element
    return self.execute(Command.FIND_ELEMENT, {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 430, in execute
    self.error_handler.check_response(response)
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id
Stacktrace:
Backtrace:
        GetHandleVerifier [0x0051A813+48355]
        (No symbol) [0x004AC4B1]
        (No symbol) [0x003B5220]
        (No symbol) [0x003D7F12]
        (No symbol) [0x003D93DD]
        GetHandleVerifier [0x0077AABD+2539405]
        GetHandleVerifier [0x007BA78F+2800735]
        GetHandleVerifier [0x007B456C+2775612]
        GetHandleVerifier [0x005A51E0+616112]
        (No symbol) [0x004B5F8C]
        (No symbol) [0x004B2328]
        (No symbol) [0x004B240B]
        (No symbol) [0x004A4FF7]
        BaseThreadInitThunk [0x776600C9+25]
        RtlGetAppContainerNamedObjectPath [0x77A27B4E+286]
        RtlGetAppContainerNamedObjectPath [0x77A27B1E+238]```
LuXeZs commented 1 year ago

Sorry for the late reply, Does this error show up after the browser is closed and the useful info is printed?

Beezlebub3rd commented 1 year ago

Yes it does show up after the browser is closed and the useful info is printed

LuXeZs commented 1 year ago

Okay that error only shows because it can't find the browser as the script is ended and you'll need to start it again.

I'll look into implement a fix for this now.

Beezlebub3rd commented 1 year ago

I do believe the same bug is now caused by a different issue?

Traceback (most recent call last):
  File "Documents\Discord-OTP-Forcer-main\main.py", line 67, in <module>
    userFacing(loadcfg())
  File "Documents\Discord-OTP-Forcer-main\main.py", line 63, in userFacing
    loginBootstrap(driver, cfg)
  File "Documents\Discord-OTP-Forcer-main\src\backend.py", line 99, in loginBootstrap
    loginFields['TOTP'] = driver.find_element(by=By.XPATH, value="//input[@placeholder='6-digit authentication code/8-digit backup code']") #or driver.find_element(by=By.XPATH, value="//*[@aria-label='Enter Discord Auth/Backup Code']")
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1251, in find_element
    return self.execute(Command.FIND_ELEMENT, {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 430, in execute
    self.error_handler.check_response(response)
  File "Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id
Stacktrace:
Backtrace:
        GetHandleVerifier [0x0116A813+48355]
        (No symbol) [0x010FC4B1]
        (No symbol) [0x01005220]
        (No symbol) [0x01027F12]
        (No symbol) [0x010293DD]
        GetHandleVerifier [0x013CAABD+2539405]
        GetHandleVerifier [0x0140A78F+2800735]
        GetHandleVerifier [0x0140456C+2775612]
        GetHandleVerifier [0x011F51E0+616112]
        (No symbol) [0x01105F8C]
        (No symbol) [0x01102328]
        (No symbol) [0x0110240B]
        (No symbol) [0x010F4FF7]
        BaseThreadInitThunk [0x750D00C9+25]
        RtlGetAppContainerNamedObjectPath [0x77087B4E+286]
        RtlGetAppContainerNamedObjectPath [0x77087B1E+238]
Beezlebub3rd commented 1 year ago

I realize that you are still looking into it and that the commit you made probably isn't finished. I apologize for the inconvenience

LuXeZs commented 1 year ago

Think I found the issue, Could you please download the newest version and see if it has fixed your issue?

Beezlebub3rd commented 1 year ago

It has not. New error text though? `Traceback (most recent call last): File "Documents\Discord-OTP-Forcer-main\src\backend.py", line 99, in loginBootstrap loginFields['TOTP'] = driver.find_element(by=By.XPATH, value="//input[@placeholder='6-digit authentication code/8-digit backup code']") #or driver.find_element(by=By.XPATH, value="//*[@aria-label='Enter Discord Auth/Backup Code']") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1251, in find_element return self.execute(Command.FIND_ELEMENT, { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 430, in execute self.error_handler.check_response(response) File "Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id Stacktrace: Backtrace: GetHandleVerifier [0x0116A813+48355] (No symbol) [0x010FC4B1] (No symbol) [0x01005220] (No symbol) [0x01027F12] (No symbol) [0x010293DD] GetHandleVerifier [0x013CAABD+2539405] GetHandleVerifier [0x0140A78F+2800735] GetHandleVerifier [0x0140456C+2775612] GetHandleVerifier [0x011F51E0+616112] (No symbol) [0x01105F8C] (No symbol) [0x01102328] (No symbol) [0x0110240B] (No symbol) [0x010F4FF7] BaseThreadInitThunk [0x750D00C9+25] RtlGetAppContainerNamedObjectPath [0x77087B4E+286] RtlGetAppContainerNamedObjectPath [0x77087B1E+238]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "Documents\Discord-OTP-Forcer-main\main.py", line 67, in userFacing(loadcfg()) File "Documents\Discord-OTP-Forcer-main\main.py", line 63, in userFacing loginBootstrap(driver, cfg) File "Documents\Discord-OTP-Forcer-main\src\backend.py", line 107, in loginBootstrap except InvalidSessionIdException: # If the browser window is closed stop looking for TOTP login field ^^^^^^^^^^^^^^^^^^^^^^^^^ NameError: name 'InvalidSessionIdException' is not defined`

Derpitron commented 1 year ago

bff8a8fb15e2eda714bbc6ad0f060e863b9d817e attempts to fix this. Not a complete fix yet

Beezlebub3rd commented 1 year ago

I do believe it's functioning perfectly now? Debug