formatted lsof mockup

This commit is contained in:
Jeremy W. Chalfant 2015-12-23 15:45:41 -06:00 committed by Christoph Hartmann
parent 3211071b9f
commit b363e1d147
2 changed files with 65 additions and 0 deletions

View file

@ -137,6 +137,8 @@ class MockLoader
'/sbin/sysctl -q -n net.ipv4.conf.all.forwarding' => cmd.call('sbin_sysctl'),
# ports on windows
'Get-NetTCPConnection | Select-Object -Property State, Caption, Description, LocalAddress, LocalPort, RemoteAddress, RemotePort, DisplayName, Status | ConvertTo-Json' => cmd.call('get-net-tcpconnection'),
# lsof formatted list of ports (should quite cross platform)
'lsof -nP -i -FpctPn' => cmd.call('lsof-nP-i-FpctPn'),
# ports on mac
'lsof -nP -iTCP -iUDP -sTCP:LISTEN' => cmd.call('lsof-np-itcp'),
# ports on linux

View file

@ -0,0 +1,63 @@
p697
cUserEvent
tIPv4
PUDP
n*:*
p6835
cVBoxHeadl
tIPv4
PTCP
n127.0.0.1:2022
tIPv4
PUDP
n*:61197
p2022
cjava
tIPv6
PTCP
n192.168.1.66:51098->172.18.1.63:22
p8708
csshd
tIPv4
PTCP
n*:22
tIPv6
PTCP
n*:22
p13451
cssh
tIPv4
PTCP
n192.168.1.66:46951->192.168.1.80:22
p24137
cntpd
tIPv4
PUDP
n*:123
tIPv6
PUDP
n*:123
tIPv4
PUDP
n127.0.0.1:123
tIPv4
PUDP
n192.168.1.66:123
tIPv4
PUDP
n172.17.42.1:123
tIPv6
PUDP
n[2602:30a:c0d0:e070:8e70:5aff:fe66:6ebc]:123
tIPv6
PUDP
n[::1]:123
tIPv6
PUDP
n[fe80::8e70:5aff:fe66:6ebc]:123
tIPv6
PUDP
n[2602:30a:c0d0:e070:b1e3:fa7c:c1cd:e1dd]:123
tIPv4
PUDP
n9.48.126.170:123