Scripting and security

Operating Systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Ejercicios de PowerShell: detectar que una aplicación tiene tráfico de red (filtro por puerto)

Ofertas y promociones en Videojuegos
PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$filterUDP = ''
$filterTCP = ''
ps | where ProcessName -eq 'chrome' | %{
    Get-NetUDPEndpoint | where OwningProcess -EQ $_.Id | select LocalPort | % {
        $filterUDP = $filterUDP+'(udp.port == '+$_.LocalPort+') or'
    }
    
    Get-NetTCPConnection | where OwningProcess -EQ $_.Id | select LocalPort | % {
        $filterTCP = $filterTCP+'(tcp.port == '+$_.LocalPort+') or'
    }
    
    
}
$filterUDP = $filterUDP.substring(0, $filterUDP.Length-3)
$filterTCP = $filterTCP.substring(0, $filterTCP.Length-3)
 
$filter = $filterUDP+' or '+$filterTCP
 
net use \\192.168.104.129\Prueba-share-samba /user:root 1234
 
.\tshark.exe -i 'ethernet 2' -Y $filter > \\192.168.104.129\Prueba-share-samba\test.txt

CATEGORÍAS

PowerShell

ETIQUETAS

Chrome, Ejercicios de PowerShell, Get-NetTCPConnection, Get-NetUDPEndpoint, Jesús Niño, Jesús Niño Camazón, Length, ps, Substring, TCP, UDP, User

MÁS

  • Técnico Superior en Desarrollo de Aplicaciones Web
  • Técnico Superior en Desarrollo de Aplicaciones Multiplataforma
  • Ejercicios de PowerShell: realizar operaciones en un equipo remoto
  • forkstat
  • Integración de sistemas operativos en red libres y propietarios (Sistemas operativos en red)
  • Administración de software de base (Implantación de sistemas operativos)
685913324 666401490 602966036 619646566 643489823 687576447 630909594 640027691 676796312 665588315 689279161 638445614 623619211 676712586 617852083 697369503 629823970 647820688 621800023 635724431 600869652 655406152 660756635 632039961 631926250 679922967 674284993 642972521 650008944 632348094 625000133 675499963 628122695 650709980 607387158 649699051 630911649 691793524 677857146 620005267 688189900 648928234 661978593 629051302 620772268 637275317 667819694 612599798 669309620 657824113 636412016 602439004 652096993 604039328 620067211 620057544 626835195 652756444 609356382 605406143 689730237 608319486 642951015 694377350 661527976 659571854 694218943 695678988 602461350 667174249