/*进程信息*/
[DPTECH-Developer-Shell]ps aux | grep ifmd
root 1388 1.0 0.3 29436 2964 ? Ss 06:44 9:51 /usr/bin/ifmd
root 18285 0.0 0.0 2152 352 ttyS0 S+ 22:10 0:00 grep ifmd
[DPTECH-Developer-Shell]
/*查看文件描述符个数*/
[DPTECH-Developer-Shell]ls /proc/1623/fd | wc -l
64
[DPTECH-Developer-Shell]
/*利用debug里lsof脚本查看socket,获取类型及地址*/
[DPTECH-Developer-Shell]/root/lsof -p 1388
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
ifmd 1388 root cwd DIR 0,1 0 1 /
ifmd 1388 root rtd DIR 0,1 0 1 /
ifmd 1388 root txt REG 0,1 38964 7333 /usr/bin/ifmd
ifmd 1388 root mem REG 0,0 0 [heap] (stat: No such file or directory)
ifmd 1388 root mem REG 0,1 154995 9078 /lib/ld-2.13.so
ifmd 1388 root DEL REG 0,4 0 /SYSV0065b717
ifmd 1388 root mem REG 0,1 57506 7857 /usr/lib/libsyslogx.so
ifmd 1388 root mem REG 0,1 11492 7974 /usr/lib/libiftable.so
ifmd 1388 root mem REG 0,1 8197 8038 /usr/lib/libtrap_util.so
ifmd 1388 root mem REG 0,1 95969 8081 /usr/lib/libsystem.so
ifmd 1388 root 92u unix 0x8aeca900 396306 socket
ifmd 1388 root 93u unix 0x8adb81e0 410381 socket
ifmd 1388 root 94u unix 0x8aebb320 412533 socket
ifmd 1388 root 95u unix 0x8b655a60 414037 socket
ifmd 1388 root 96u unix 0x8aecab00 415543 socket
ifmd 1388 root 97u unix 0x8aebb720 422752 socket
ifmd 1388 root 98u unix 0x8b55a2a0 426780 socket
ifmd 1388 root 99u unix 0x8aede5a0 433525 socket
ifmd 1388 root 100u unix 0x8aed3360 434819 socket
ifmd 1388 root 101u unix 0x8aed3960 436222 socket
ifmd 1388 root 102u unix 0x8b652b40 440855 socket
ifmd 1388 root 103u unix 0x8aebb520 443242 socket
ifmd 1388 root 104u unix 0x8adbfac0 445717 socket
ifmd 1388 root 105u unix 0x8aebbd20 447222 socket
ifmd 1388 root 106u unix 0x8aed3760 454620 socket
ifmd 1388 root 107u unix 0x8aed3d60 456131 socket
ifmd 1388 root 108u unix 0x8aede1a0 457636 socket
ifmd 1388 root 109u unix 0x8adbf0c0 460666 socket
ifmd 1388 root 110u unix 0x8b652340 473425 socket
ifmd 1388 root 111u unix 0x8aebbb20 477271 socket
ifmd 1388 root 112u unix 0x8acdd660 479632 socket
ifmd 1388 root 113u unix 0x8adc3dc0 481997 socket
ifmd 1388 root 114u unix 0x8ada84e0 484292 socket
ifmd 1388 root 115u unix 0x8ad6b9e0 491267 socket
ifmd 1388 root 116u unix 0x8b652140 493012 socket
ifmd 1388 root 117u unix 0x8ad6bbe0 495163 socket
ifmd 1388 root 118u unix 0x8aededa0 496246 socket
ifmd 1388 root 119u unix 0x8ada8ce0 514104 socket
ifmd 1388 root 120u unix 0x8ad6b3e0 520797 socket
ifmd 1388 root 121u unix 0x8adc35c0 522303 socket
ifmd 1388 root 122u unix 0x8aebb920 525128 socket
ifmd 1388 root 123u unix 0x8aed3b60 526631 socket
ifmd 1388 root 124u unix 0x8b652d40 528136 socket
ifmd 1388 root 125u unix 0x8aecad00 531600 socket
/*KDB查看内容*/
[DPTECH-Developer-Shell]KDBD
Entering kdb (current=0x80529160, pid 0) on processor 0 due to Keyboard Entry
[0]kdb> net
0x8b6126c0
sizeof(struct unix_sock): 496
&sk: 8b6126c0
addr: 0x(null)
dentry: 0x(null)
mnt: 0x(null)
&readlock: 0x8b61287c
peer: 0x8babe280
other: 0x(null)
gc_tree: 0x(null)
inflight.counter: 0
&lock: 0x8b6128a0
&peer_wait: 0x8b6128a4
[0]kdb> net unix_sock 0x8babe280
sizeof(struct unix_sock): 496
&sk: 8babe280
addr: 0x8b85dc60
dentry: 0x8f414cf0
mnt: 0x8fc4f7a0
&readlock: 0x8babe43c
peer: 0x(null)
other: 0x(null)
gc_tree: 0x(null)
inflight.counter: 0
&lock: 0x8babe460
&peer_wait: 0x8babe464
[0]kdb> md 0x8b85dc60
0x8b85dc60 00000001 0000000e 00000100 00012f64 ............../d
0x8b85dc70 65762f73 79736c6f 67000000 00000000 ev/syslog.......-----------------------------------学习到socket文件
0x8b85dc80 0000000a 0000000b 00000100 00012f64 ............../d
0x8b85dc90 65762f6c 6f670000 00000000 00000000 ev/log..........
0x8b85dca0 8b85d460 8b85d320 00000000 8bb8a000 ...`... ........
0x8b85dcb0 00000001 ffffffff 00000000 ffffffff ................
0x8b85dcc0 00100100 00200200 00000000 8cb16000 ..... ........`.
0x8b85dcd0 00000000 00000000 00000000 ffffffff ................
[0]kdb>
/*GDB下看socket文件路径*/
[DPTECH-Developer-Shell]/root/rmi-gdb -p 1388
GNU gdb 6.7
Loaded symbols for /usr/lib/libddosfingerprint.so
0x157022f8 in select () from /lib/libc.so.6
(gdb) x/x &SysLogFile
0x1559c770 : 0x000003ff-----------------------正好是1023,日志socket通信文件;
(gdb) shell
[DPTECH-Developer-Shell]
阅读(1587) | 评论(0) | 转发(0) |