Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
global _username,_domain,_classes, prevId
init()
print(Fore.WHITE + Style.BRIGHT + printBanner() , end='')
with open(baseWritePath + prevId, 'r') as f:
first = json.load(f)
nextId = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
first['NextId'] = nextId
with open(baseWritePath + prevId, 'w') as f:
json.dump(first, f)
prevId = nextId
content = waitAndReadFile(baseReadPath + prevId)
print("[+] Connection successfully established!")
time.sleep(3)
StrOrPathSeq,
T,
)
from .version import __version__
__all__ = ("Style", "printf", "prompt", "prompt_bool")
colorama.init()
class Style:
OK: IntSeq = [colorama.Fore.GREEN, colorama.Style.BRIGHT]
WARNING: IntSeq = [colorama.Fore.YELLOW, colorama.Style.BRIGHT]
IGNORE: IntSeq = [colorama.Fore.CYAN]
DANGER: IntSeq = [colorama.Fore.RED, colorama.Style.BRIGHT]
RESET: IntSeq = [colorama.Fore.RESET, colorama.Style.RESET_ALL]
INDENT = " " * 2
HLINE = "-" * 42
NO_VALUE: object = object()
def printf(
action: str,
msg: Any = "",
style: Optional[IntSeq] = None,
indent: int = 10,
quiet: Union[bool, StrictBool] = False,
) -> Optional[str]:
if quiet:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import socket
from pyperclip import copy
from urllib.parse import quote_plus
from colorama import Fore,Back,Style
from argparse import ArgumentParser, RawTextHelpFormatter, ArgumentTypeError
# console colors
F, S, BT = Fore.RESET, Style.RESET_ALL, Style.BRIGHT
FG, FR, FC, BR = Fore.GREEN, Fore.RED, Fore.CYAN, Back.RED
# shell types
SHELL = {
'sh' : '/bin/sh',
'zsh' : '/bin/zsh',
'ksh' : '/bin/ksh',
'tcsh' : '/bin/tcsh',
'bash' : '/bin/bash',
'dash' : '/bin/dash'}
def console():
"""argument parser"""
parser = ArgumentParser(description="{}shellback.py:{} reverse shell generator".format(BT+FG,S),formatter_class=RawTextHelpFormatter)
def print_warning_message(**kwargs):
""" Receiver to print a warning message in yellow text
"""
text = kwargs.get('text')
if get_verbosity():
print(Style.BRIGHT + Fore.YELLOW + text)
def print_version_info():
version = "{} v{} by {} -> (Github: {})".format(Constants.PROJECT_NAME,
Constants.VERSION,
Constants.AUTHOR_FULL_NAME,
Constants.AUTHOR_GITHUB)
line = "-" * (len(version))
print(Fore.RED + Style.BRIGHT + line)
print(version)
print(line + "\n" + Style.RESET_ALL)
def print(message):
if sys.stdout.isatty():
message = Fore.GREEN + message + Style.RESET_ALL
_print(message)
def style_message(msg):
if should_enable_styling():
try:
msg = colorama.Style.BRIGHT + msg + colorama.Style.RESET_ALL
except KeyError:
pass
return msg
def bright(text): return "%s%s%s" % (colorama.Style.BRIGHT, text, colorama.Style.RESET_ALL)
def dim(text): return "%s%s%s" % (colorama.Style.DIM, text, colorama.Style.RESET_ALL)
def inLine(self, string):
self.lastInLine = True
if len(string) > self.terminal_size:
string = "\r" + string[:self.terminal_size - 8] + "..." + Style.RESET_ALL + "\r"
string = ("\r" + string + Style.RESET_ALL) + "\r"
sys.stdout.write(string)
sys.stdout.flush()
import os
import socket
import threading
import re
import pickle
import time
from BlockChain import TraderChain
from colorama import Fore, Style
from communication import Connection
# Variaveis globais, apenas para a concatenação da string e colorir a mesma (Biblioteca Colorama)
styleCommunication = Fore.MAGENTA + Style.BRIGHT
styleClient = Fore.GREEN + Style.BRIGHT
styleChain = Fore.YELLOW + Style.BRIGHT
class Trader(Connection):
'''
Classe do usuario comum.
'''
def __init__(self, my_address, clients):
'''
Construtor da classe do usuario comum.
:param my_address: ip.
:param listClients: lista de clientes.
'''
super().__init__(my_address, clients)
self.blockChain = TraderChain('blocks/{}'.format(self.my_port))
# self.blockChain = TraderChain(str(self.my_port))