Derpitron / Discord-OTP-Forcer

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

[Bug]: unknown timeout exception that is caused after a handful of codes #100

Closed SMG54321 closed 5 months ago

SMG54321 commented 5 months ago

Description

now this happens instead of it breaking initially. after a while of trying codes. the program crashes while giving me a blank time out exception. might have something to do with configuration?

Minimal Reproduction

it seems to happen mildly at random, but it does work till it stops.

Error

not sure if you need everything, but too much infromation might be better than little

File "C:\Users\Jonathan\Desktop\Discord-OTP-Forcer-main\main.py", line 82, in <module>
    78                  bootstrap_login_page(driver, configuration)
    79
    80   if __name__ == '__main__':
    81          try:
--> 82                  userFacing(load_configuration())
    83          except UserCausedHalt:
    ..................................................
     __name__ = '__main__'
    ..................................................

File "C:\Users\Jonathan\Desktop\Discord-OTP-Forcer-main\main.py", line 78, in userFacing
    32   def userFacing(configuration: dict):
 (...)
    74
    75          # Start the simulated browser, and run it in an infinite loop.
    76          while True:
    77                  driver = bootstrap_browser(configuration)
--> 78                  bootstrap_login_page(driver, configuration)
    ..................................................
     configuration = {'email': '',
                      'password': '',
                      'programMode': 'reset',
                      'codeMode': 'normal',
                      'newPassword': 'N3P3T@33',
                      'resetToken': 'eyJpZCI6MTE3NjMxNDAzMjg5NTAzMzM0NCwiZW1haWwi
                      OiJjbG9wYXRyaWNrMEBnbWFpbC5jb20ifQ.ZZ8Dhw.IiXE_1yCVg_OX91-Xe
                      yVhP--0nM',
                      'authToken': '',
                      'sensitiveDebug': 'False',
                      'logCreation': 'False'}
     driver = <selenium.webdriver.chrome.webdriver.WebDriver (session="98b
               b8bed40677fb37311581ae0fb87ad")>
    ..................................................

File "C:\Users\Jonathan\Desktop\Discord-OTP-Forcer-main\src\backend.py", line 138, in bootstrap_login_page
    81   def bootstrap_login_page(
    82          driver: webdriver.chrome.webdriver.WebDriver,
    83          configuration: dict,
    84   ):
 (...)
    134                         # Auto-triggers the password reset flow
    135                         if ('Please reset your password to log in.' in driver.page_source):
    136                                 configuration['programMode'] = 'reset'
    137                                 code_entry(driver, login_fields, configuration)
--> 138                         code_entry(driver, login_fields, configuration)
    139                 except NoSuchElementException: # This try-except block constantly checks whether the hCaptcha has been completed, and if so, it will continue to the next phase.
    ..................................................
     driver = <selenium.webdriver.chrome.webdriver.WebDriver (session="98b
               b8bed40677fb37311581ae0fb87ad")>
     configuration = {'email': '',
                      'password': '',
                      'programMode': 'reset',
                      'codeMode': 'normal',
                      'newPassword': 'N3P3T@33',
                      'resetToken': 'eyJpZCI6MTE3NjMxNDAzMjg5NTAzMzM0NCwiZW1haWwi
                      OiJjbG9wYXRyaWNrMEBnbWFpbC5jb20ifQ.ZZ8Dhw.IiXE_1yCVg_OX91-Xe
                      yVhP--0nM',
                      'authToken': '',
                      'sensitiveDebug': 'False',
                      'logCreation': 'False'}
     driver.page_source = '<html lang="en-US" style="font-size: 100%; --saturation-fac
                           tor: 1; --devtools-sidebar-width: 0px;" class="full-motion a
                           pp-focused show-redesigned-icons theme-dark platform-web fon
                           t-size-16" data-rh="lang,style,class"><head>    <meta charse
                           t="utf-8">\n    <meta content="width=device-width,initial-sc
                           ale=1,maximum-scale=3" name="viewport">\n\n    <!-- section:
                           seometa -->\n    <meta property="og:type" content="website">
                           \n    <meta property="og:site_name" content="Discord">\n
                           <meta property="og:t...
     login_fields = {'password': <selenium.webdriver.remote.webelement.WebElemen
                     t (session="98bb8bed40677fb37311581ae0fb87ad", element="ECD3
                     284F93B0B57CBD5304CD052FECD6_element_2")>,
                     'TOTP': <selenium.webdriver.remote.webelement.WebElement (s
                     ession="98bb8bed40677fb37311581ae0fb87ad", element="ECD3284F
                     93B0B57CBD5304CD052FECD6_element_13")>}
    ..................................................

File "C:\Users\Jonathan\Desktop\Discord-OTP-Forcer-main\src\backend.py", line 214, in code_entry
    144  def code_entry(
    145              driver: webdriver.chrome.webdriver.WebDriver,
    146         login_fields: dict,
    147              configuration: dict
    148  ):
 (...)
    210                         login_fields['TOTP'].send_keys(totp_code)
    211                         login_fields['TOTP'].send_keys(Keys.RETURN)
    212                         session_statistics['attemptedCodeCount'] += 1
    213                         #driver.implicitly_wait(0.3)
--> 214                         WebDriverWait(driver, 5, 0.01).until(EC.element_to_be_clickable((By.XPATH, "//*[contains(text(), 'Confirm')]"))) # Wait for page to update so we can detect changes such as rate limited.
    215
    ..................................................
     driver = <selenium.webdriver.chrome.webdriver.WebDriver (session="98b
               b8bed40677fb37311581ae0fb87ad")>
     login_fields = {'password': <selenium.webdriver.remote.webelement.WebElemen
                     t (session="98bb8bed40677fb37311581ae0fb87ad", element="ECD3
                     284F93B0B57CBD5304CD052FECD6_element_2")>,
                     'TOTP': <selenium.webdriver.remote.webelement.WebElement (s
                     ession="98bb8bed40677fb37311581ae0fb87ad", element="ECD3284F
                     93B0B57CBD5304CD052FECD6_element_13")>}
     configuration = {'email': '',
                      'password': '',
                      'programMode': 'reset',
                      'codeMode': 'normal',
                      'newPassword': 'N3P3T@33',
                      'resetToken': 'eyJpZCI6MTE3NjMxNDAzMjg5NTAzMzM0NCwiZW1haWwi
                      OiJjbG9wYXRyaWNrMEBnbWFpbC5jb20ifQ.ZZ8Dhw.IiXE_1yCVg_OX91-Xe
                      yVhP--0nM',
                      'authToken': '',
                      'sensitiveDebug': 'False',
                      'logCreation': 'False'}
     totp_code = '881356'
     Keys.RETURN = '\ue006'
     session_statistics = {'attemptedCodeCount': 4862,
                           'ratelimitCount': 0,
                           'slowDownCount': 0,
                           'elapsedTime': 0.0,
                           'programMode': 'reset',
                           'codeMode': 'normal',
                           'email': '',
                           'password': '',
                           'newPassword': 'N3P3T@33',
                           'resetToken': 'eyJpZCI6MTE3NjMxNDAzMjg5NTAzMzM0NCwiZW1haWwi
                           OiJjbG9wYXRyaWNrMEBnbWFpbC5jb20ifQ.ZZ8Dhw.IiXE_1yCVg_OX91-Xe
                           yVhP--0nM',
                           'authToken': '',
                           'sensitiveDebug': 'False',
                           'logCreation': 'False'}
     EC.element_to_be_clickable = <function 'element_to_be_clickable' expected_conditions.py:3
                                   41>
     By.XPATH = 'xpath'
    ..................................................

File "C:\Users\Jonathan\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\support\wait.py", line 101, in until
    77   def until(self, method: Callable[[WebDriver], Union[Literal[False], T]], message: str = "") -> T:
 (...)
    97               stacktrace = getattr(exc, "stacktrace", None)
    98           time.sleep(self._poll)
    99           if time.monotonic() > end_time:
    100              break
--> 101      raise TimeoutException(message, screen, stacktrace)
    ..................................................
     self = <selenium.webdriver.support.wait.WebDriverWait (session="98b
             b8bed40677fb37311581ae0fb87ad")>
     method = <function 'element_to_be_clickable.<locals>._predicate' expe
               cted_conditions.py:352>
     T = ~T
     message = ''
     stacktrace = None
     self._poll = 0.01
     end_time = 93188.39
     screen = None
    ..................................................

---- (full traceback above) ----
File "C:\Users\Jonathan\Desktop\Discord-OTP-Forcer-main\main.py", line 82, in <module>
    userFacing(load_configuration())
File "C:\Users\Jonathan\Desktop\Discord-OTP-Forcer-main\main.py", line 78, in userFacing
    bootstrap_login_page(driver, configuration)
File "C:\Users\Jonathan\Desktop\Discord-OTP-Forcer-main\src\backend.py", line 138, in bootstrap_login_page
    code_entry(driver, login_fields, configuration)
File "C:\Users\Jonathan\Desktop\Discord-OTP-Forcer-main\src\backend.py", line 214, in code_entry
    WebDriverWait(driver, 5, 0.01).until(EC.element_to_be_clickable((By.XPATH, "//*[contains(text(), 'Confirm')]"))) # Wait for page to update so we can detect changes such as rate limited.
File "C:\Users\Jonathan\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\support\wait.py", line 101, in until
    raise TimeoutException(message, screen, stacktrace)

TimeoutException: Message:

Press any key to continue . . .

Operating System Version

Widows 10

Python Version

3.12

Program Version

latest

Any other information or context?

No response

Derpitron commented 5 months ago

This also seems to happen to me since the last week or so.

LuXeZs commented 5 months ago

Seems to be timing out on this. https://github.com/Derpitron/Discord-OTP-Forcer/blob/b61f495d2ec5f6435e4d0301051c7fd0893b9d2e/src/backend.py#L214

Will increase the timeout delay and hopefully that should fix this issue.

Derpitron commented 5 months ago

@LuXeZs Do you mind giving me your email ID so we can communicate more directly? Thanks

SMG54321 commented 5 months ago

i hope im not impatient, but is it fixed?

Derpitron commented 5 months ago

I've not observed it happening myself. I'm closing this issue for now, please test it yourself and update back here.