Contenidos
Pasos necesarios para analizar imágenes con Wireshark:
- Enviar una imagen entre un cliente y un servidor
- Capturar el tráfico de red entre el cliente y el servidor
- Analizar y filtrar el tráfico capturado
Enviar una imagen entre un cliente y un servidor
Cliente que envía la imagen al servidor:
Enviar imagen mediante una función en PowerShell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
function send-msg($file) { $client = New-Object System.Net.Sockets.TcpClient "localhost", 8982 $stream = $client.GetStream() $writer = New-Object System.IO.StreamWriter $stream $bytes = [System.IO.File]::ReadAllBytes($file) #$writer.WriteLine($bytes) $writer.Write($bytes,0,$bytes.length) $writer.Dispose() $stream.Dispose() $client.Dispose() } #Enviar solo una imagen al servidor ls d:\power\video\captura\ | Select-Object -First 1 | %{send-msg($_.FullName)} |
Servidor que recibe la imagen que le envía el cliente:
Recibir la imagen mediante PowerShell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
$endpoint = new-object System.Net.IPEndPoint ([system.net.ipaddress]::any, 8982) $listener = new-object System.Net.Sockets.TcpListener $endpoint $listener.start() $contador=0 do { $client = $listener.AcceptTcpClient() $stream = $client.GetStream(); $reader = New-Object System.IO.StreamReader $stream $lines=$reader.ReadToEnd() $enc = [system.Text.Encoding]::Default $filebytes = $enc.GetBytes($lines) $contador=$contador+1 [System.IO.File]::WriteAllBytes('f:\power\video\capturas2\'+$contador+'.bmp', $filebytes) $reader.Dispose() $stream.Dispose() $client.Dispose() } while (1) |
Capturar el tráfico de red entre el cliente y el servidor

Analizar y filtrar el tráfico capturado
