Linux /
LsofLinux.Lsof HistoryHide minor edits - Show changes to markup February 20, 2007, at 02:17 AM
by
Changed lines 1-2 from:
lsofto:
lsof: lists open filesChanged line 10 from:
to:
Show only TCP (works the same for UDP)Changed lines 12-82 from:
to:
lsof -iTCP =] -i :port shows all networking related to a given port
To show connections to a specific host, use @host
Show connections based on the host and the port using @host:port
Grepping for "LISTEN" shows what ports your system is waiting for connections on
Grepping for "ESTABLISHED" shows current active connections
Show what a given user has open using -u
See what files and network connections a command is using with -c
Pointing to a file shows what's interacting with that file
The -p switch lets you see what a given process ID has open, which is good for learning more about unknown processes
The -t option returns just a PID
Using-a allows you to combine search terms, so the query below says, "show me everything running as daniel connected to 1.1.1.1"
Using the -t and -c options together you can HUP processes
You can also use the -t with -u to kill everything a user has open
lsof +L1 shows you all open files that have a link count less than 1, often indicative of a cracker trying to hide something
February 20, 2007, at 02:12 AM
by
Added lines 1-13:
lsofKaynak: http://dmiessler.com/study/lsof/Show all connections with -i
|