#import modulos #modulos.mi_print("Hola") from modulos import * import time import sys from asciistuff import Banner mi_print("Hoola de nuevo") otro_print("otro print usado") print(sumar(10, 5)) print(restar(7, 3)) for i in range(10, 0, -1): print(i, "...") time.sleep(0.25) print(Banner("ICO")) print(sys.platform) print(Banner("ICO"))
#import modulos #modulos.mi_print("Hola") from modulos import * import time import sys from asciistuff import Banner mi_print ("Hola de nuevo") otro_print("otro print usado") print(sumar(4 ,5)) print(restar( 10 , 7)) for i in range (10,0,-1): print( i ,"...") time.sleep(0.25) print(Banner("BooooooM!!!!")) print(sys.platform) print(
#import modulos #modulos.mi_print("Hola!!!") from modulos import * import time import sys from asciistuff import Banner mi_print("Hola de nuevo") otro_print("Otro print usado") print(sumar(4, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "...") # time.sleep(1) print(Banner("Booom")) print(sys.platform)
#import Modulos #Modulos.mi_print("Hola") from Modulos import * import time import sys from asciistuff import Banner mi_print("Hola de nuevo") otro_print("Otro print usado") print(sumar(3, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "...") time.sleep(0.1) #Pausa "tantos" segundos print(Banner("FELIZ ANO NUEVO")) #print(sys.platform) print(Banner("ICO FES ARAGON"))
from asciistuff import Banner from colorutils import Color c = Color((255, 255, 255)) for i in range(10, 0, -1): print(i, "...") print(Banner("Universidad Nacional Autonoma de Mexico!!")) """ from asciistuff import Banner from colorutils import Color c = Color ((255,255,255)) print(Banner("Universidad Nacional Autonoma de Mexico") """
#import Modulos #Modulos.mi_print("Hola") from Modulos import * import time import sys from asciistuff import Banner mi_print("Hola de nuevo") otro_print("otro print usado") print(sumar(4, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "...") time.sleep(0) #pausa el tiempo en segundos print(Banner("BOOOM!!!")) #print(sys.platform) print(Banner("ICO FES ARAGON"))
#import modulos #modulos.mi_print("Hola") from modulos import * import time import sys from asciistuff import Banner mi_print("Hola De Nuevo") otro_print("Otro print usado") print (sumar(4 , 5)) print (restar(10 , 7)) for i in range (10,0,-1): print( i, "..." ) time.sleep(1) print("BOOOOOOM!!!!!") print(Banner("\33[33mUniversidad Nacional Autonoma De Mexico")) print(Banner("\33[34mFES Aragon")) print(Banner("\33[32mRosas Mora Luis Gerardo"))
#import modulos #modulos. mi_print("hola") from modulos import * import time import sys from asciistuff import Banner mi_print("hola de nuevo") otro_print("otro print usado") print(sumar(4, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "...") time.sleep(0.25) print(Banner("BOOOM¡¡¡")) print(sys.platform)
#import modulos #modulos.mi_print("Hola") from modulos import * import time import sys from asciistuff import Banner mi_print("Hola de nuevo") otro_print("Otro print usado") print(sumar(4, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "...") time.sleep(000000000000000.1) print(Banner("WOOOW!!!")) print(sys.platform)
#import modulos #modulos.mi_print("Hola") from modulos import mi_print, otro_print, sumar, restar import time import sys from asciistuff import Banner mi_print("Hola de nuevo") otro_print("Hola k ase") print(sumar(4, 5)) print(restar(5, 4)) #from modulos import * (te importa todas las funciones) for i in range(2, 0, -1): print(i, "...") time.sleep(.2) print(Banner("QUESO")) print(sys.platform)
import Modulos Modulos.mi_print("Hola") from Modulos import mi_print, otro_print, sumar, restar #Administracion de codigos #from modulos import * para importar todos en lugar de uno por uno import time import sys from asciistuff import Banner mi_print("Hola de nuevo") otro_print("otro print usado") print(sumar(4, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "...") time.sleep(.25) print(sys.platform) print(Banner("BOOM"))
import time import sys from asciistuff import Banner from colour import Banner time.sleep(0.25) print(Banner(golden("Universidad Autónoma de México"))) print(Banner(blue("FES Aragón"))) print(Banner(green("Ledesma Briones Antonio Yamir"))) print (sys.platform)
#importa todos #import modulos #modulos.mi_print("Hola") #Sola la señalada from modulos import * import time import sys from asciistuff import Banner mi_print("Hola de nuevo") otro_print("Otro print usado") print(sumar(4, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "...") time.sleep(0.25) print(Banner("BOOOOM CHAKALAKA!!")) print(sys.platform)
def initialize(sudo=False, multi_level_debug=False, add_banner=False, add_config=False, add_demo=False, add_interact=False, add_progress=False, add_step=False, add_time=False, add_version=False, add_wizard=False, exit_at_interrupt=True, ext_logging=False, noargs_action=None, post_actions=True, report_func=None): """ Initialization function ; sets up the arguments for the parser and creates a logger to be inserted in the input dictionary of global variables from the calling script. :param sudo: if True, require sudo credentials and re-run script with sudo :param multi_level_debug: allow to use -v, -vv, -vvv (adjust logging level) instead of just -v (only debug on/off) :param relative_time: use relative time for log messages :param add_banner: add an ASCII banner when starting the tool :param add_config: add an option to input an INI configuration file :param add_demo: add an option to re-run the process using a random entry from the __examples__ (only works if this variable is populated) :param add_interact: add an interaction option :param add_progress: add a progress management option :param add_step: add an execution stepping option :param add_time: add an execution timing option :param add_version: add a version option :param add_wizard: add an option to run a wizard, asking for each input argument :param exit_at_interrupt: enable exit at interrupt :param ext_logging: extended logging options :param noargs_action: action to be performed when no argument is input :param post_actions: enable post-actions at interrupt :param report_func: report generation function """ global parser, parser_calls # get caller's frame frame = currentframe().f_back # walk the stack until a frame containing a known object is found glob = {} while frame: if isinstance(frame.f_globals.get('parser'), ProxyArgumentParser): glob = frame.f_globals # search for dunders for d in DUNDERS: f = frame while f and (d not in f.f_globals.keys() or \ f.f_globals[d] is None): f = f.f_back try: glob[d] = f.f_globals[d] except (AttributeError, KeyError): pass break frame = frame.f_back add = { 'config': add_config, 'demo': add_demo, 'interact': add_interact, 'progress': add_progress, 'step': add_step, 'time': add_time, 'version': add_version, 'wizard': add_wizard, 'help': True } p = ArgumentParser(glob) # 1) handle action when no input argument is given add['demo'] = add['demo'] and p.examples noarg = len(sys.argv) == 1 if noarg and noargs_action: if noargs_action not in add.keys(): raise ValueError( gt("Bad action when no args (should be one of: " "{})").format('|'.join(add.keys()))) add[noargs_action] = True # ensure this action is enabled, even if it # is not given the passed arguments # 2) populate the real parser and add information arguments __parsers = {parser: p} # proxy parser to real parser recursive conversion function def __proxy_to_real_parser(value): """ This recursively converts ProxyArgumentParser instances to real parsers. Use case: defining subparsers with a parent >>> [...] >>> parser.add_argument(...) # argument common to all subparsers >>> subparsers = parser.add_subparsers() >>> subparsers.add_parser(..., parents=[parent]) ^ this is an instance of ProxyArgumentParser and must be converted to an actual parser instance :param value: a value coming from args or kwargs aimed to a real parser """ if isinstance(value, ProxyArgumentParser): return __parsers[value] elif isinstance(value, (list, tuple)): return [__proxy_to_real_parser(_) for _ in value] return value # now iterate over the registered calls for proxy_parser, method, args, kwargs, proxy_subparser in parser_calls: real_parser = __parsers[proxy_parser] args = (__proxy_to_real_parser(v) for v in args) kwargs = {k: __proxy_to_real_parser(v) for k, v in kwargs.items()} real_subparser = getattr(real_parser, method)(*args, **kwargs) if real_subparser is not None: __parsers[proxy_subparser] = real_subparser # this allows to ensure that another call to initialize(...) will have a # clean list of calls and an empty _config attribute parser_calls = [] ArgumentParser.reset() # config handling feature, for reading/writing an INI config file with the # input arguments, e.g. for future reuse if add['config']: c = p.add_argument_group(gt("config arguments")) opt = c.add_argument("-r", "--read-config", action='config', help=gt("read args from a config file"), note=gt("this overrides other arguments")) c.add_argument("-w", "--write-config", metavar="INI", help=gt("write args to a config file")) if noarg and noargs_action == "config": sys.argv[1:] = [opt, "config.ini"] i = p.add_argument_group(gt("extra arguments")) # demonstration feature, for executing an example amongst these defined in # __examples__, useful for observing what the tool does if add['demo']: opt = i.add_argument("--demo", action='demo', prefix="play", help=gt("demonstrate a random example")) if noarg and noargs_action == "demo": sys.argv[1:] = [opt] # help feature, for displaying classical or extended help about the tool if add['help']: if glob.get('__details__'): opt = i.add_argument( "-h", dest="help", default=0, action="count", help=gt("show extended help message and exit"), note=gt("-hhh is the highest help detail level")) else: opt = i.add_argument("-h", "--help", action='help', prefix="show", help=gt("show this help message and exit")) if noarg and noargs_action == "help": sys.argv[1:] = [opt] # interaction mode feature, for interacting with the tool during its # execution, useful for debugging when it is complex if add['interact']: j = p.add_argument_group(gt("interaction arguments")) opt = j.add_argument("--interact", action="store_true", suffix="mode", help=gt("interaction mode")) if opt: j.add_argument("--host", default="127.0.0.1", type=ip_address, prefix="remote", help=gt("remote interacting host")) j.add_argument("--port", default=12345, type=port_number, prefix="remote", help=gt("remote interacting port")) if noarg and noargs_action == "interact": sys.argv[1:] = [opt] # progress mode feature, for displaying a progress bar during the execution if add['progress']: opt = i.add_argument("-p", "--progress", action="store_true", suffix="mode", help=gt("progress mode")) if noarg and noargs_action == "progress": sys.argv[1:] = [opt] # stepping mode feature, for stepping within the tool during its execution, # especially useful for debugging when it is complex if add['step']: opt = i.add_argument("--step", action="store_true", last=True, suffix="mode", help=gt("stepping mode")) if noarg and noargs_action == "step": sys.argv[1:] = [opt] # timing mode feature, for measuring time along the execution of the tool if add['time']: b = p.add_argument_group(gt("timing arguments")) opt = b.add_argument("--stats", action='store_true', last=True, prefix="time", help=gt("display execution time stats at exit")) b.add_argument("--timings", action='store_true', last=True, suffix="mode", help=gt("display time stats during execution")) if noarg and noargs_action == "time": sys.argv[1:] = [opt] # version feature, for displaying the version from __version__ if add['version']: version = glob['__version__'] if '__version__' in glob else None if version is not None: opt = i.add_argument("--version", action='version', prefix="show", version=version, help=gt("show program's " "version number and exit")) if noarg and noargs_action == "version": sys.argv[1:] = [opt] # verbosity feature, for displaying debugging messages, with the # possibility to handle multi-level verbosity if multi_level_debug: i.add_argument("-v", dest="verbose", default=0, action="count", suffix="mode", cancel=True, last=True, help=gt("verbose level"), note=gt("-vvv is the highest verbosity level")) else: i.add_argument("-v", "--verbose", action="store_true", last=True, suffix="mode", help=gt("verbose mode")) # wizard feature, for asking argument values to the user if add['wizard']: opt = i.add_argument("-w", "--wizard", action='wizard', prefix="start", help=gt("start a wizard")) if noarg and noargs_action == "wizard": sys.argv[1:] = [opt] # reporting feature, for making a reporting with the results of the tool # at the end of its execution if report_func is not None and PYTHON3: if not isfunction(report_func): report_func = None glob['logger'].error(gt("Bad report generation function")) else: # lazily import report features # -> reason: they rely on pandas and weasyprint, which take time to # be imported ; so, when report features are not used # in a script, report classes won't be loaded all_list = __import__("tinyscript.report", fromlist=['__all__']).__all__ report = __import__("tinyscript.report", fromlist=all_list) for f in all_list: glob[f] = globals()[f] = getattr(report, f) # now populate the parser with report-related arguments r = p.add_argument_group(gt("report arguments")) output_func = list( filter(lambda x: not x[0].startswith('_'), getmembers(Report, predicate=isfunction))) choices = list(map(lambda x: x[0], output_func)) if r.add_argument("--output", choices=choices, default="pdf", last=True, prefix="report", help=gt("report output format")): r.add_argument("--title", last=True, prefix="report", help=gt("report title")) r.add_argument("--css", last=True, prefix="report", help=gt("report stylesheet file")) r.add_argument("--theme", default="default", last=True, prefix="report", help=gt("report stylesheet theme"), note=gt("--css overrides this setting")) r.add_argument("--filename", last=True, prefix="report", help=gt("report filename")) elif report_func is not None and not PYTHON3: report_func = None # disable reporting in the at_exit handler glob['logger'].warning(gt("Report generation is only for Python 3")) # extended logging features if ext_logging: i.add_argument("-f", "--logfile", last=True, help=gt("destination log file")) i.add_argument("-r", "--relative", action="store_true", last=True, suffix="time", help=gt("display relative time")) if LINUX: i.add_argument("-s", "--syslog", action="store_true", last=True, suffix="mode", help=gt("log to /var/log/syslog")) glob['args'], glob['parser'] = p.parse_args(), p # 3) if sudo required, restart the script if sudo: # FIXME: when prompting for sudo and restarting the script, some imports # fail (e.g. with DroneSploit ; import error with # FrameworkConsole) # if not root, restart the script in another process and jump to this if os.geteuid() != 0: os.execvp("sudo", ["sudo", sys.executable] + sys.argv) # 4) configure logging and get the main logger configure_logger(glob, multi_level_debug, glob['args']._collisions.get("relative"), glob['args']._collisions.get("logfile"), glob['args']._collisions.get("syslog")) # 5) append modes items set_interact_items(glob) set_progress_items(glob) set_step_items(glob) set_time_items(glob) # 6) display a banner if relevant bf = glob.get('BANNER_FONT', BANNER_FONT) if add_banner or isinstance(bf, string_types): f = AsciiFile() bs = BANNER_STYLE bs = bs if isinstance(bs, dict) else {} f['title', bs] = Banner(p.scriptname, font=bf) print(f) # 7) finally, bind the global exit handler _hooks._exit = exit_at_interrupt def __at_exit(): # first, dump the config if required if add['config']: _save_config(glob) # now, close the current progress bar (if any) if add['progress']: glob['progress_manager'].stop() # then handle the state do_post_actions = True if _hooks.state == "INTERRUPTED": glob.get('at_interrupt', lambda: None)() do_post_actions = post_actions elif _hooks.state == "TERMINATED": glob.get('at_terminate', lambda: None)() do_post_actions = False # finally handle post-actions if do_post_actions: if report_func is not None: # generate the report only when exiting gracefully, just before # the user-defined function at_graceful_exit a = glob['args'] try: r = Report(*report_func(), title=a.title, filename=a.filename, css=a.css, logger=glob['logger']) getattr(r, a.output)(False) except AttributeError: pass t = glob['time_manager'] if add['time'] and t._stats: t.stats() glob.get('at_graceful_exit', lambda: None)() glob.get('at_exit', lambda: None)() from logging import shutdown shutdown() if not AT_EXIT_SET: atexit.register(__at_exit) globals()['AT_EXIT_SET'] = False
#banner de color en una terminal from asciistuff import Banner import os os.system("cls") print("\u001b[33m") print(Banner("Universidad")) print(Banner("Autonoma")) print(Banner("de Mexico")) print("\u001b[34m") print(Banner("FES Aragon")) print("\u001b[32m") print(Banner("Quintana Escamilla")) print(Banner("Roberto Carlos"))
#import modulos #modulos.mi_print("Hola") from modulos import mi_print, otro_print, sumar, restar mi_print("Hola de nuevo") otro_print("Otro print usado") print(sumar(4, 5)) print(restar(10, 7)) from modulos import * mi_print("Hola de nuevo") otro_print("Otro print usado") print(sumar(4, 5)) print(restar(10, 7)) from asciistuff import Banner import time import sys for i in range(10, 0, -1): print(i, "...") time.sleep(1) print(Banner("Boommmm!!!!")) print(sys.platform) print(Banner("ICO"))
#import modulo #modulo.mi_print("Hola") from modulo import * from asciistuff import Banner mi_print("hola de nuevo") otro_print("otro print usado") print(sumar(4, 5)) print(restar(10, 7)) import time import sys for i in range(10, 0, -1): print(i, " ... ") time.sleep(.5) print(Banner("BOOOOOM !!!!!")) print(sys.platform) print(Banner("ICO fes aragon")) for v in range(10, 50, 1): print(Banner("ICO fes aragon"))
#import Modulos #Modulos.mi_print("Hola") #from Modulos import * el asterisco simula todos los modulos from Modulos import mi_print, otro_print, sumar, restar import time import sys from asciistuff import Banner mi_print("Hola º0º") otro_print("otro print usado") print(sumar(4, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "...") time.sleep(.5) #Se pausa un tiempo asignado print(Banner("BOOOOOOM !!!")) print(sys.platform)
import modulos modulos.mi_print("Hola") #SOLO IMPORTA LAS FUNCIONES QUE NOS INTERESA USAR #(recomendable a menos que quieras importar todo) #Hace más eficiente la ejecución si solo importas lo que vas a ocupar from modulos import * #El * abarca todas la funciones del doc que importas import time import sys from asciistuff import Banner print("!------------------!") mi_print("Hola de nuevo") otro_print("Otro print usado") print(sumar(3, 5)) print(restar(10, 7)) print("!------------------!") for i in range(10, 0, -1): print(i, "...") time.sleep(0.125) print("BOOOM!") print(Banner("Booom!")) #Banner, un anuncio print("!------------------!") print(dir(sys.platform)) print("") print(sys.platform)
#import modulos #modulos.mi_print("Hola") from modulos import * import time import sys from asciistuff import Banner mi_print("Hola de nuevo") otro_print("otro print usado") print(sumar(4, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "...") time.sleep(.05) print(Banner("BOOOOOOOOOOOM!!!")) #print(sys.platform) print(Banner("ICO Fes Aragon"))
import modulos modulos.mi_print("hola") from modulos import * import time import sys from asciistuff import Banner mi_print("hola de nuevo") otro_print("otro print usado") print(sumar(4, 5)) print(restar(10, 7)) for i in range(10, 0, -1): print(i, "....") time.sleep(.1) print(Banner("boooooom entu cara perra")) print(sys.platform)
import Modulos Modulos.mi_print("Hola") print("-----------------------") #from modulos import * (Pone el nombre de todos los paquetes) from Modulos import mi_print, otro_print, sumar , restar import time #Pausa el tiempo en el que tarda en ejecutarce import sys from asciistuff import Banner mi_print("Hola de nuevo") print("-----------------------") otro_print("Otro print usado") print("-----------------------") print(sumar(4,5)) print(restar(10,7)) print("-----------------------") for i in range (10,0,-1): print(i , "...") time.sleep(1) print("BOOOOM PERRRAS!!!!!") print("BOOM es lo que buscas?") print(Banner("CORRE PERRA CORRE!!!!")) print("-----------------------") #print(dir(sys)) print(sys.platform) #http://patorjk.com/software/taag/#p=testall&f=Ribbit3&t=Type%20Something%20 genera banners #Nombre de escuela en dorado, fes en azul y mi nombre en verde instalar pip y buscar color text
try: import requests from bs4 import BeautifulSoup import threading import os import sys import time from colorama import Fore, Style from user_agent import * from asciistuff import Banner except Exception as e: print(e) os.system("clear") print(Fore.BLUE + Style.BRIGHT + str(Banner("XSS FREAK"))) wlcm_msg = (Fore.RED + Style.BRIGHT + ">> [+] Give Me A Target To Destroy\n") for char in wlcm_msg: time.sleep(0.06) sys.stdout.write(char) sys.stdout.flush() links = [] special_links = [] special_links_2 = [] independent_links = [] directories = [] vulnerable_inputs = [] forms = []