Python colorama.Style.BRIGHT Examples

The following are 30 code examples of colorama.Style.BRIGHT(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module colorama.Style , or try the search function .
Example #1
Source File: Comments.py    From URS with MIT License 8 votes vote down vote up
def list_submissions(reddit, post_list, parser):
        print("\nChecking if post(s) exist...")
        posts, not_posts = Validation.Validation.existence(s_t[2], post_list, parser, reddit, s_t)
        
        if not_posts:
            print(Fore.YELLOW + Style.BRIGHT + 
                "\nThe following posts were not found and will be skipped:")
            print(Fore.YELLOW + Style.BRIGHT + "-" * 55)
            print(*not_posts, sep = "\n")

        if not posts:
            print(Fore.RED + Style.BRIGHT + "\nNo submissions to scrape!")
            print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
            quit()

        return posts 
Example #2
Source File: cloudfail.py    From CloudFail with MIT License 6 votes vote down vote up
def crimeflare(target):
    print_out(Fore.CYAN + "Scanning crimeflare database...")

    with open("data/ipout", "r") as ins:
        crimeFoundArray = []
        for line in ins:
            lineExploded = line.split(" ")
            if lineExploded[1] == args.target:
                crimeFoundArray.append(lineExploded[2])
            else:
                continue
    if (len(crimeFoundArray) != 0):
        for foundIp in crimeFoundArray:
            print_out(Style.BRIGHT + Fore.WHITE + "[FOUND:IP] " + Fore.GREEN + "" + foundIp.strip())
    else:
        print_out("Did not find anything.") 
Example #3
Source File: binarly_query.py    From binarly-query with MIT License 6 votes vote down vote up
def process_search(options):
    search_query = []
    search_query.extend([hex_pattern(val.replace(' ', '')) for val in options.hex])
    search_query.extend([ascii_pattern(val) for lst in options.a for val in lst])
    search_query.extend([wide_pattern(val) for lst in options.w for val in lst])

    result = BINOBJ.search(
        search_query, limit=options.limit, exact=options.exact, test=options.test)
    if 'error' in result:
        print(Style.BRIGHT + Fore.RED + result['error']['message'])
        return

    if 'stats' in result:
        show_stats_new(result['stats'], options.limit)

    if len(result['results']) == 0:
        return

#    if len(result['results']) >= options.limit:
#        print("Showing top {0} results:".format(options.limit))
#    else:
#        print("Results:")

    show_results(result['results'], pretty_print=options.pretty_print) 
Example #4
Source File: Subreddit.py    From URS with MIT License 6 votes vote down vote up
def list_subreddits(parser, reddit, s_t, sub_list):
        print("\nChecking if Subreddit(s) exist...")
        subs, not_subs = Validation.Validation().existence(s_t[0], sub_list, parser, reddit, s_t)
        
        if not_subs:
            print(Fore.YELLOW + Style.BRIGHT + 
                "\nThe following Subreddits were not found and will be skipped:")
            print(Fore.YELLOW + Style.BRIGHT + "-" * 60)
            print(*not_subs, sep = "\n")

        if not subs:
            print(Fore.RED + Style.BRIGHT + "\nNo Subreddits to scrape!")
            print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
            quit()

        return subs 
Example #5
Source File: Logger.py    From URS with MIT License 6 votes vote down vote up
def master_timer(function):
        def wrapper(*args):
            logging.info("INITIALIZING URS.")
            logging.info("")

            start = time.time()
            
            try:
                function(*args)
            except KeyboardInterrupt:
                print(Style.BRIGHT + Fore.RED + "\n\nURS ABORTED BY USER.\n")
                logging.warning("")
                logging.warning("URS ABORTED BY USER.\n")
                quit()

            logging.info("URS COMPLETED SCRAPES IN %.2f SECONDS.\n" % \
                (time.time() - start))

        return wrapper 
Example #6
Source File: output.py    From h2t with MIT License 6 votes vote down vote up
def print_line(message, level=1, category = None, title = None, status=False):
    sts = get_status(category, status)

    if sts == 'applied':
        color = Fore.GREEN
        pre = '[+] '
    elif sts == 'touse':
        color = Fore.YELLOW
        pre = '[+] '
    elif sts == 'toremove':
        color = Fore.RED
        pre = '[-] '
    else:
        color = ''
        pre = ''

    if title:
        print(' '*4*level + Style.BRIGHT + title + ': ' + Style.RESET_ALL + message)
    else:
        print(' '*4*level + color + Style.BRIGHT + pre + Fore.RESET + message) 
Example #7
Source File: Redditor.py    From URS with MIT License 6 votes vote down vote up
def list_redditors(parser, reddit, user_list):
        print("\nChecking if Redditor(s) exist...")
        users, not_users = Validation.Validation.existence(s_t[1], user_list, parser, reddit, s_t)
        
        if not_users:
            print(Fore.YELLOW + Style.BRIGHT + 
                "\nThe following Redditors were not found and will be skipped:")
            print(Fore.YELLOW + Style.BRIGHT + "-" * 59)
            print(*not_users, sep = "\n")

        if not users:
            print(Fore.RED + Style.BRIGHT + "\nNo Redditors to scrape!")
            print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
            quit()

        return users 
Example #8
Source File: colloide.py    From colloide with GNU General Public License v3.0 6 votes vote down vote up
def check_names(infile):    #Checking the path to the wordlist
	if os.path.exists(infile):
		if status_method:
			banner()    #calls the banner function
			checkasciiwolf()      #calls the sexy ASCII wolf wallpaper
			scan_start()
			statusfindAdmin() #calls the function that basically does the job
			print(Fore.RED + Style.BRIGHT + "\n[+] Rock bottom;\n" + Style.RESET_ALL)
		elif error_method:
			banner()
			checkasciiwolf()
			scan_start()
			findAdmin()
			print(Fore.RED + Style.BRIGHT + "\n[+] Rock bottom;\n" + Style.RESET_ALL)
	else: #in case wordlist cant be found
		banner()
		opts()
		print(Fore.RED + Style.BRIGHT + "[-] Invalid path to the wordlist. File could not be found.\n" + Style.RESET_ALL)
# THIS IS THE STATUS CODE METHOD 
Example #9
Source File: Basic.py    From URS with MIT License 6 votes vote down vote up
def run(args, parser, reddit):
        Titles.Titles.b_title()
        
        while True:
            while True:                
                master = RunBasic._create_settings(parser, reddit)

                confirm = RunBasic._print_confirm(args, master)
                if confirm == options[0]:
                    break
                else:
                    print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
                    parser.exit()
            
            Subreddit.GetSortWrite().gsw(args, reddit, master)
            
            repeat = ConfirmInput.another()
            if repeat == options[1]:
                print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
                break 
Example #10
Source File: Basic.py    From URS with MIT License 6 votes vote down vote up
def confirm_subreddits(subs, parser):
        while True:
            try:
                confirm = input("\nConfirm selection? [Y/N] ").strip().lower()
                if confirm == options[0]:
                    subs = [sub for sub in subs]
                    return subs
                elif confirm not in options:
                    raise ValueError
                else:
                    print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
                    parser.exit()
            except ValueError:
                print("Not an option! Try again.")    

    ### Scrape again? 
Example #11
Source File: Basic.py    From URS with MIT License 6 votes vote down vote up
def get_settings(self, master, subs):
        for sub in subs:
            while True:
                try:
                    cat_i = int(input((Style.BRIGHT + """
Select a category to display for r/%s
-------------------
    0: Hot
    1: New
    2: Controversial
    3: Top
    4: Rising
    5: Search
-------------------
        """ + Style.RESET_ALL) % sub))

                    if cat_i == 5:
                        print("\nSelected search")
                        self._get_search(cat_i, master, sub)
                    else:
                        print("\nSelected category: %s" % self._categories[cat_i])
                        self._get_n_results(cat_i, master, sub)
                    break
                except (IndexError, ValueError):
                    print("Not an option! Try again.") 
Example #12
Source File: Basic.py    From URS with MIT License 6 votes vote down vote up
def get_subreddits(self, parser, reddit):
        subreddit_prompt = Style.BRIGHT + """
Enter Subreddit or a list of Subreddits (separated by a space) to scrape:

""" + Style.RESET_ALL

        while True:
            try:
                search_for = str(input(subreddit_prompt))
                if not search_for:
                    raise ValueError
                return PrintSubs().print_subreddits(parser, reddit, search_for)
            except ValueError:
                print("No Subreddits were specified! Try again.")

    ### Update Subreddit settings in master dictionary. 
Example #13
Source File: Basic.py    From URS with MIT License 6 votes vote down vote up
def print_subreddits(self, parser, reddit, search_for):
        print("\nChecking if Subreddit(s) exist...")
        subs, not_subs = self._find_subs(parser, reddit, search_for)

        if subs:
            print("\nThe following Subreddits were found and will be scraped:")
            print("-" * 56)
            print(*subs, sep = "\n")
        if not_subs:
            print("\nThe following Subreddits were not found and will be skipped:")
            print("-" * 60)
            print(*not_subs, sep = "\n")

        if not subs:
            print(Fore.RED + Style.BRIGHT + "\nNo Subreddits to scrape!")
            print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
            quit()

        return subs 
Example #14
Source File: cloudfail.py    From CloudFail with MIT License 6 votes vote down vote up
def update():
    print_out(Fore.CYAN + "Just checking for updates, please wait...")
    print_out(Fore.CYAN + "Updating CloudFlare subnet...")
    if(args.tor == False):
        headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'}
        r = requests.get("https://www.cloudflare.com/ips-v4", headers=headers, cookies={'__cfduid': "d7c6a0ce9257406ea38be0156aa1ea7a21490639772"}, stream=True)
        with open('data/cf-subnet.txt', 'wb') as fd:
            for chunk in r.iter_content(4000):
                fd.write(chunk)
    else:
        print_out(Fore.RED + Style.BRIGHT+"Unable to fetch CloudFlare subnet while TOR is active")
    print_out(Fore.CYAN + "Updating Crimeflare database...")
    r = requests.get("http://crimeflare.net:83/domains/ipout.zip", stream=True)
    with open('data/ipout.zip', 'wb') as fd:
        for chunk in r.iter_content(4000):
            fd.write(chunk)
    zip_ref = zipfile.ZipFile("data/ipout.zip", 'r')
    zip_ref.extractall("data/")
    zip_ref.close()
    os.remove("data/ipout.zip")


# END FUNCTIONS 
Example #15
Source File: colloide095.py    From colloide with GNU General Public License v3.0 5 votes vote down vote up
def check_names(infile):    #Checking the path to the wordlist
	if os.path.exists(infile):
		if status_method:
			banner()    #calls the banner function
			wolf()      #calls the sexy ASCII wolf wallpaper
			statusfindAdmin() #calls the function that basically does the job
		elif error_method:
			banner()  
			wolf()
			findAdmin() 
	else: #in case wordlist cant be found
		banner()
		opts()
		print(Fore.RED + Style.BRIGHT + "[-] Invalid path to the wordlist. File could not be found.\n" + Style.RESET_ALL)
# THIS IS THE STATUS CODE METHOD 
Example #16
Source File: spmain.py    From supercharge with MIT License 5 votes vote down vote up
def SendFData(csocket, data):
    csocket = int(csocket)
    sockfd = clients[csocket]
    
    try:
        sockfd.send(data.encode())
    except Exception as error:
        clients.remove(sockfd)
        print(Style.BRIGHT + "Error Occured : " + str(error)) 
Example #17
Source File: colloide095.py    From colloide with GNU General Public License v3.0 5 votes vote down vote up
def scan_start():
	print(Fore.RED + Style.BRIGHT + "[!] Report bugs: anivsante2@gmail.com \n" + Style.RESET_ALL) 
					#OR https://github.com/MichaelDim02/colloide.py/issues
	print(Fore.RED + Style.BRIGHT + "[!] Press Ctrl + C to terminate the process.\n" + Style.RESET_ALL) 
Example #18
Source File: colloide09.py    From colloide with GNU General Public License v3.0 5 votes vote down vote up
def check_names(infile):    #Checking the path to the wordlist
	if os.path.exists(infile):
		if status_method:
			banner()    #calls the banner function
			wolf()      #calls the sexy ASCII wolf wallpaper
			statusfindAdmin() #calls the function that basically does the job
		elif error_method:
			banner()  
			wolf()
			findAdmin() 
	else: #in case wordlist cant be found
		banner()
		opts()
		print(Fore.RED + Style.BRIGHT + "[-] Invalid path to the wordlist. File could not be found.\n" + Style.RESET_ALL)
# THIS IS THE STATUS CODE METHOD 
Example #19
Source File: binarly_query.py    From binarly-query with MIT License 5 votes vote down vote up
def process_classify(options):
    if os.path.exists(options.files[0]):
        filelist = options.files
        if os.path.isdir(options.files[0]):
            filelist = get_filelist(filelist[0])

        result = BINOBJ.classify_files(
            filelist, upload_missing=options.u, status_callback=my_callback)
    else:
        result = BINOBJ.classify_hashes(options.files)

    if 'error' in result or result['status'] != 'done':
        print(Style.BRIGHT + Fore.RED + "Request failed")
    else:
        print("Classification Results:")

    reqid = result.get('results', None)
    if reqid is None:
        # the request failed before any files could be analyzed
        print(Style.BRIGHT + Fore.RED +
              "Fail reason: {0} (error code={1})".format(
                  result['error']['message'], result['error']['code']))
        return

    classify_data = []
    for key, value in result['results'].iteritems():
        status = Style.RESET_ALL + Fore.GREEN + "OK" + Style.RESET_ALL
        if 'error' in value:
            status = Fore.RED + value['error']['message'] + Style.RESET_ALL
        row = {'SHA1': key, 'label': value.get('label', '.'), 'family': value.get('family', '.'), 'Status': status}

        classify_data.append(row)

    if options.pretty_print:
        show_results(classify_data, pretty_print=options.pretty_print)
    else:
        print("-" * 100)
        for row in classify_data:
            show_row(row)
    return 
Example #20
Source File: output.py    From h2t with MIT License 5 votes vote down vote up
def print_bright(message, end='\n'):
    print(Style.BRIGHT + message + Style.RESET_ALL, end=end) 
Example #21
Source File: cloudfail.py    From CloudFail with MIT License 5 votes vote down vote up
def init(target):
    if args.target:
        print_out(Fore.CYAN + "Fetching initial information from: " + args.target + "...")
    else:
        print_out(Fore.RED + "No target set, exiting")
        sys.exit(1)

    if not os.path.isfile("data/ipout"):
            print_out(Fore.CYAN + "No ipout file found, fetching data")
            update()
            print_out(Fore.CYAN + "ipout file created")

    try:
        ip = socket.gethostbyname(args.target)
    except socket.gaierror:
        print_out(Fore.RED + "Domain is not valid, exiting")
        sys.exit(0)

    print_out(Fore.CYAN + "Server IP: " + ip)
    print_out(Fore.CYAN + "Testing if " + args.target + " is on the Cloudflare network...")

    try:
        ifIpIsWithin = inCloudFlare(ip)

        if ifIpIsWithin:
            print_out(Style.BRIGHT + Fore.GREEN + args.target + " is part of the Cloudflare network!")
        else:
            print_out(Fore.RED + args.target + " is not part of the Cloudflare network, quitting...")
            sys.exit(0)
    except ValueError:
        print_out(Fore.RED + "IP address does not appear to be within Cloudflare range, shutting down..")
        sys.exit(0) 
Example #22
Source File: binarly_query.py    From binarly-query with MIT License 5 votes vote down vote up
def show_row(row):
    row = color_row(row)
    print(" ".join(["%s%s%s:%s" % (Style.NORMAL, x.capitalize(), Style.BRIGHT, y) for (x, y) in row.items()])) 
Example #23
Source File: output.py    From drydock with GNU General Public License v2.0 5 votes vote down vote up
def terminal_output(self):
    output = self.log
    tempdict = {}
    auditcats = {'host': '1.Host Configuration',
                 'dockerconf': '2.Docker Daemon Configuration',
                 'dockerfiles': '3.Docker daemon configuration files',
                 'container_imgs': '4.Container Images and Build File',
                 'container_runtime': '5.Container Runtime',
                 }

    print '''drydock v0.3 Audit Results\n==========================\n'''
    # Print results
    for cat, catdescr in auditcats.iteritems():
      cat_inst = self.audit_categories[cat]
      try:
        if output[cat]:
          audits = self.create_ordereddict(output[cat],cat)
          print(Style.BRIGHT + "\n" + catdescr + "\n" + \
                '-'*len(catdescr) + '\n'+ Style.RESET_ALL)
          for audit in audits.keys():
            results = output[cat][audit]
            descr = getattr(cat_inst,audit).__doc__
            print( descr + '\n' + '-'*len(descr) )
            self.print_results(results)
      except KeyError:
        logging.warn("No audit category %s" %auditcats[cat])
        continue

    # Print Overview info for the audit
    print(Style.BRIGHT + "Overview\n--------" +Style.RESET_ALL)
    print('Profile: ' + output['info']['profile'])
    print('Date: ' + output['info']['date'])
    success,total = output['info']['score'].split('/')
    success = float(success)
    total = float(total)
    if 0 <= success/total <= 0.5:
      print('Score: ' + Fore.RED + output['info']['score'] + Fore.RESET)
    elif 0.5 < success/total <= 0.8:
      print('Score: ' + Fore.YELLOW + output['info']['score'] + Fore.RESET)
    else:
      print('Score: ' + Fore.GREEN + output['info']['score'] + Fore.RESET) 
Example #24
Source File: colors.py    From netutils-linux with MIT License 5 votes vote down vote up
def __choose_color_scheme(self):
        if not self.enabled:
            Style.BRIGHT = Style.RESET_ALL = Fore.RED = Fore.RESET = self.GREY = self.YELLOW = ""
            return self.COLOR_NONE
        if self.topology.layout_kind == 'NUMA':
            return self.COLORS_NODE
        return self.COLORS_SOCKET 
Example #25
Source File: colors.py    From netutils-linux with MIT License 5 votes vote down vote up
def bright(string):
        return Color.wrap(string, Style.BRIGHT) 
Example #26
Source File: banner.py    From supercharge with MIT License 5 votes vote down vote up
def pbanner():
    return Style.BRIGHT + Fore.LIGHTGREEN_EX + banner + Style.RESET_ALL 
Example #27
Source File: spmain.py    From supercharge with MIT License 5 votes vote down vote up
def broadcast(data):
    try:
        ToSend = xor(data)
        for i in clients:
            i.send(ToSend.encode())
    except Exception as error:
        print(Style.BRIGHT + "Error Occured : " + str(error)) 
Example #28
Source File: colors.py    From netutils-linux with MIT License 5 votes vote down vote up
def wrap_header(string):
        return Color.wrap("# {0}\n".format(string), Style.BRIGHT) 
Example #29
Source File: spmain.py    From supercharge with MIT License 5 votes vote down vote up
def SendData(csocket, data):
    csocket = int(csocket)
    sockfd = clients[csocket]
    
    try:
        toSend = xor(data)
        sockfd.send(toSend.encode())
    except Exception as error:
        clients.remove(sockfd)
        print(Style.BRIGHT + "Error Occured : " + str(error)) 
Example #30
Source File: spmain.py    From supercharge with MIT License 5 votes vote down vote up
def SendBytes(csocket, data):
    """ Binary File Content is sent without Encryption """ 
    csocket = int(csocket)
    sockfd = clients[csocket]
    
    try:
        sockfd.send(data)
    except Exception as error:
        clients.remove(sockfd)
        print(Style.BRIGHT + "Error Occured : " + str(error))