lsof
lsof -u userone,root //用户userone,root打开的文件
lsof -c apach -c apach2 //apach 开头的进程名
lsof -p pid
lsof file1,file2
lsof +D dir//recurse dir
lsof 与grep组合
lsof -i
lsof -i tcp
lsof -i udp
lsof :25 || lsof :stmp || lsof udp:53
lsof -d 2 //fd
lsof -t -i //show pid
lsof -r 1//1s recurse
a--->与 默认--->或 ^--->非
nc
nc -t -nvv -w2 -z 10.1.1.2 100-1000 //scan tcp -n--->用 ip
nc -nvv ip port < ~/a.txt //scan & send file data
nc -l -p 80 //listen local 80
nc -l -p 80 -t -e ~/exe //listen tcp80 & exe
strace
test@debian:~/test$strace ./ssss
execve("./ssss", ["./ssss"], [/* 30 vars */]) = 0
brk(0) = 0xa6b000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f456a62d000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f456a62b000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=31718, ...}) = 0
mmap(NULL, 31718, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f456a623000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\342\1\0\0\0\0\0@"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1375536, ...}) = 0
mmap(NULL, 3482232, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f456a0c0000
mprotect(0x7f456a20a000, 2093056, PROT_NONE) = 0
mmap(0x7f456a409000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x149000) = 0x7f456a409000
mmap(0x7f456a40e000, 17016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f456a40e000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f456a622000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f456a621000
arch_prctl(ARCH_SET_FS, 0x7f456a6216e0) = 0
mprotect(0x7f456a409000, 12288, PROT_READ) = 0
munmap(0x7f456a623000, 31718) = 0
brk(0) = 0xa6b000
brk(0xa8c000) = 0xa8c000
open("/etc/shadow", O_RDONLY) = -1 EACCES (Permission denied)
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 13), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f456a62a000
write(1, "Error!\n"..., 7Error!
) = 7
exit_group(-1) = ?