<reponame>juvenalculino/Pentest
#!/usr/bin/python
# -*- coding: utf-8 -*-

import urllib2
import os
import platform
from random import choice
import time
from pip._vendor.distlib.compat import raw_input

ver = '\033[1;31m'
verde = '\033[32m'
na = '\033[0m'
cyan = '\033[1;96m'
cores = ('\033[1;31m', '\033[1;32m', '\033[1;33m', '\033[1;34m', '\033[1;35m', '\033[1;36m')

so = platform.system()

if so == 'Windows':
    os.system("cls")
else:
    os.system("clear")

print('{}Créditos: / Facebook: https://www.facebook.com/jose.juvenal.00'.format(choice(cores)))
print('\t /  Github: https://github.com/juvenalculino{}'.format(na))
print('''{}
 ▄▄▄▄    ██▀███   █    ██ ▄▄▄█████▓▓█████ ▓█████▄  ██▓ ██▀███  
▓█████▄ ▓██ ▒ ██▒ ██  ▓██▒▓  ██▒ ▓▒▓█   ▀ ▒██▀ ██▌▓██▒▓██ ▒ ██▒
▒██▒ ▄██▓██ ░▄█ ▒▓██  ▒██░▒ ▓██░ ▒░▒███   ░██   █▌▒██▒▓██ ░▄█ ▒
▒██░█▀  ▒██▀▀█▄  ▓▓█  ░██░░ ▓██▓ ░ ▒▓█  ▄ ░▓█▄   ▌░██░▒██▀▀█▄  
░▓█  ▀█▓░██▓ ▒██▒▒▒█████▓   ▒██▒ ░ ░▒████▒░▒████▓ ░██░░██▓ ▒██▒
░▒▓███▀▒░ ▒▓ ░▒▓░░▒▓▒ ▒ ▒   ▒ ░░   ░░ ▒░ ░ ▒▒▓  ▒ ░▓  ░ ▒▓ ░▒▓░
▒░▒   ░   ░▒ ░ ▒░░░▒░ ░ ░     ░     ░ ░  ░ ░ ▒  ▒  ▒ ░  ░▒ ░ ▒░
 ░    ░   ░░   ░  ░░░ ░ ░   ░         ░    ░ ░  ░  ▒ ░  ░░   ░ 
 ░         ░        ░                 ░  ░   ░     ░     ░     
      ░                                    ░                   
{}{}By: <NAME>{}
'''.format(choice(cores), na, choice(cores), na))


def brute():
    wordlist = 'brutedir.txt'
    f = open(wordlist)
    lines = []

    for line in f.readlines():
        lines.append(str(line.replace("\n", "")))
    return lines


wordlist = brute()

site = raw_input("{}Insira o nome do site (exemplo: www.google.com){}\n\n{}~>>> {}".format(choice(cores), na,
                                                                                         choice(cores), na))
if len(site) <= 5:
    print('{}ERRO!!! Digite a url do site alvo.{}\n'.format(ver, na))
    exit()

barra = str('/')

for domain in wordlist:

    req = urllib2.Request('http://' + site + '/' + domain, headers={
        'User-Agent': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) '
                      'AppleWebKit/532.8 (KHTML, like Gecko)'
					  ' Chrome/4.0.302.2 Safari/532.8'})

    try:
        resp = urllib2.urlopen(req)

    except urllib2.HTTPError as e:
        if e.code == 404:
            print("\n{}[-]{} {}{}{}{} -> NOT FOUND{}".format(cyan, na, ver, site, barra, domain, na))
            # print(site + "/" + domain + " -> NOT FOUND")

    except urllib2.URLError as e:
        print("\n{}[-]{} {}{}{}{} -> NOT FOUND{}".format(cyan, na, ver, site, barra, domain, na))

    else:
        print("\n{}[+]{} {}{}{}{} -> OK{}".format(cyan, na, verde, site, barra, domain, na))
        save = open('dominios.txt', 'a')
        save.write(site + "/" + domain + "\n")

    time.sleep(0.8)
