forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bindsnoop.8
144 lines (144 loc) · 2.22 KB
/
bindsnoop.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.TH bindsnoop 8 "12 February 2020" "" ""
.SH NAME
bindsnoop \- Trace bind() system calls.
.SH SYNOPSIS
.B bindsnoop.py [\fB-h\fP] [\fB-w\fP] [\fB-t\fP] [\fB-p\fP PID] [\fB-P\fP PORT] [\fB-E\fP] [\fB-U\fP] [\fB-u\fP UID] [\fB--count\fP] [\fB--cgroupmap MAP\fP]
.SH DESCRIPTION
bindsnoop reports socket options set before the bind call that would impact this system call behavior.
.PP
.SH REQUIREMENTS
CONFIG_BPF and bcc.
.SH
OPTIONS:
.RS
.TP
Show help message and exit:
.TP
.B
\fB-h\fP, \fB--help\fP
.TP
Include timestamp on output:
.TP
.B
\fB-t\fP, \fB--timestamp\fP
.TP
Wider columns (fit IPv6):
.TP
.B
\fB-w\fP, \fB--wide\fP
.TP
Trace this PID only:
.TP
.B
\fB-p\fP PID, \fB--pid\fP PID
.TP
Comma-separated list of ports to trace:
.TP
.B
\fB-P\fP PORT, \fB--port\fP PORT
.TP
Trace cgroups in this BPF map:
.TP
.B
\fB--cgroupmap\fP MAP
.TP
Include errors in the output:
.TP
.B
\fB-E\fP, \fB--errors\fP
.TP
Include UID on output:
.TP
.B
\fB-U\fP, \fB--print-uid\fP
.TP
Trace this UID only:
.TP
.B
\fB-u\fP UID, \fB--uid\fP UID
.TP
Count binds per src ip and port:
.TP
.B
\fB--count\fP
.RE
.PP
.SH
EXAMPLES:
.RS
.TP
Trace all IPv4 and IPv6 \fBbind\fP()s
.TP
.B
bindsnoop
.TP
Include timestamps
.TP
.B
bindsnoop \fB-t\fP
.TP
Trace PID 181
.TP
.B
bindsnoop \fB-p\fP 181
.TP
Trace port 80
.TP
.B
bindsnoop \fB-P\fP 80
.TP
Trace port 80 and 81
.TP
.B
bindsnoop \fB-P\fP 80,81
.TP
Include UID
.TP
.B
bindsnoop \fB-U\fP
.TP
Trace UID 1000
.TP
.B
bindsnoop \fB-u\fP 1000
.TP
Report bind errors
.TP
.B
bindsnoop \fB-E\fP
.TP
Count bind per src ip
.TP
.B
bindsnoop \fB--count\fP
.RE
.PP
Trace IPv4 and IPv6 bind system calls and report socket options that would impact bind call behavior:
.RS
.TP
SOL_IP IP_FREEBIND F\.\.\.\.
.TP
SOL_IP IP_TRANSPARENT \.T\.\.\.
.TP
SOL_IP IP_BIND_ADDRESS_NO_PORT \.\.N\.\.
.TP
SOL_SOCKET SO_REUSEADDR \.\.\.R.
.TP
SOL_SOCKET SO_REUSEPORT \.\.\.\.r
.PP
SO_BINDTODEVICE interface is reported as "IF" index
.SH SOURCE
This is from bcc.
.IP
https://github.com/iovisor/bcc
.PP
Also look in the bcc distribution for a companion _examples.txt file containing
example usage, output, and commentary for this tool.
.SH OS
Linux
.SH STABILITY
Unstable - in development.
.SH AUTHOR
Pavel Dubovitsky
.SH SEE ALSO
tcpaccept(8)