@@ -1752,90 +1752,213 @@ Some UDP services are recognized (from the source or destination
17521752port number) and the higher level protocol information printed.
17531753In particular, Domain Name service requests (RFC 1034/1035) and Sun
17541754RPC calls (RFC 1050) to NFS.
1755- .SS TCP or UDP Name Server Requests
1755+ .SS
1756+ DNS requests
17561757.LP
1757- \fI (N.B.:The following description assumes familiarity with
1758- the Domain Service protocol described in RFC 1035.
1759- If you are not familiar
1760- with the protocol, the following description will appear to be written
1761- in Greek.) \fP
1758+ DNS requests are formatted as:
1759+ .RS
17621760.LP
1763- Name server requests are formatted as
1761+ .EX
1762+ src > dst: id op? flags qtype qclass name (len)
1763+ .EE
1764+ .RE
1765+ .PP
1766+ For example, let\(cq s break down this line:
17641767.RS
1765- .nf
1766- .sp .5
1767- \fI src > dst: id op? flags qtype qclass name (len) \fP
1768- .sp .5
1769- \f(CW h2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37) \fR
1770- .sp .5
1771- .fi
1768+ .LP
1769+ .EX
1770+ 192.0.2.1.1234 > 8.8.8.8.53: 492+ [1au] A? example.com. (36)
1771+ .EE
17721772.RE
1773- Host \fI h2opolo \fP asked the domain server on \fI helios \fP for an
1774- address record (qtype=A) associated with the name \fI ucbvax.berkeley.edu. \fP
1775- The query id was `3'.
1776- The `+' indicates the \fI recursion desired \fP flag
1777- was set.
1778- The query length was 37 bytes, excluding the TCP or UDP and
1779- IP protocol headers.
1780- The query operation was the normal one, \fI Query \fP ,
1781- so the op field was omitted.
1782- If the op had been anything else, it would
1783- have been printed between the `3' and the `+'.
1784- Similarly, the qclass was the normal one,
1785- .BR C_IN ,
1786- and omitted.
1787- Any other qclass would have been printed
1788- immediately after the `A'.
1789- .LP
1790- A few anomalies are checked and may result in extra fields enclosed in
1791- square brackets: If a query contains an answer, authority records or
1792- additional records section,
1793- .IR ancount ,
1794- .IR nscount ,
1795- or
1796- .I arcount
1797- are printed as `[\fI n \fP a]', `[\fI n \fP n]' or `[\fI n \fP au]' where \fI n \fP
1798- is the appropriate count.
1799- If any of the response bits are set (AA, RA or rcode) or any of the
1800- `must be zero' bits are set in bytes two and three, `[b2&3=\fI x \fP ]'
1801- is printed, where \fI x \fP is the hex value of header bytes two and three.
1802- .SS TCP or UDP Name Server Responses
1803- .LP
1804- Name server responses are formatted as
1773+ .PP
1774+ The most commonly used fields here are:
1775+ .IP " \(bu " 3
1776+ \fB Source IP and port \fR : \(ga 192.0.2.1.1234\(cq
1777+ .if n \
1778+ .sp -1
1779+ .if t \
1780+ .sp -0.25v
1781+ .IP " \(bu " 3
1782+ \fB Destination IP and port \fR : \(ga 8.8.8.8.53\(cq
1783+ .if n \
1784+ .sp -1
1785+ .if t \
1786+ .sp -0.25v
1787+ .IP " \(bu " 3
1788+ \fB DNS query type \fR : \(ga A\(cq . The query type is right before the \(ga ?\(cq
1789+ .if n \
1790+ .sp -1
1791+ .if t \
1792+ .sp -0.25v
1793+ .IP " \(bu " 3
1794+ \fB Domain name \fR being looked up: \(ga example.com.\(cq
1795+ .LP
1796+ All the other fields, in the order they appear:
1797+ .IP " \(bu " 3
1798+ \fB Query ID \fR : \(ga 492\(cq
1799+ .if n \
1800+ .sp -1
1801+ .if t \
1802+ .sp -0.25v
1803+ .IP " \(bu " 3
1804+ \fB Opcode \fR : The opcode was the normal one, \fI Query \fR , so it was omitted.
1805+ Any other opcode would have been printed between the \(ga 492\(cq and
1806+ the \(ga +\(cq , for example \(ga 492 update+\(cq
1807+ .if n \
1808+ .sp -1
1809+ .if t \
1810+ .sp -0.25v
1811+ .IP " \(bu " 3
1812+ \fB Flags \fR : \f(CR + \fR means the \(lq recursion desired\(rq flag was set
1813+ .if n \
1814+ .sp -1
1815+ .if t \
1816+ .sp -0.25v
1817+ .IP " \(bu " 3
1818+ \fB Records in the query \fR : \(ga [1au]\(cq means that the query contains 1 record in the \(lq additional\(rq section. In general:
18051819.RS
1806- .nf
1807- .sp .5
1808- \fI src > dst: id op rcode flags a/n/au type class data (len) \fP
1809- .sp .5
1810- \f(CW helios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273)
1811- helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97) \fR
1812- .sp .5
1813- .fi
1820+ .IP " \(bu " 3
1821+ \(ga [\fI n \fR a]\(cq means \(lq \fI n \fR answer records\(rq
1822+ .if n \
1823+ .sp -1
1824+ .if t \
1825+ .sp -0.25v
1826+ .IP " \(bu " 3
1827+ \(ga [\fI n \fR n]\(cq means \(lq \fI n \fR authority records\(rq
1828+ .if n \
1829+ .sp -1
1830+ .if t \
1831+ .sp -0.25v
1832+ .IP " \(bu " 3
1833+ \(ga [\fI n \fR au]\(cq means \(lq \fI n \fR additional records\(rq
18141834.RE
1815- In the first example, \fI helios \fP responds to query id 3 from \fI h2opolo \fP
1816- with 3 answer records, 3 name server records and 7 additional records.
1817- The first answer record is type A (address) and its data is internet
1818- address 128.32.137.3.
1819- The total size of the response was 273 bytes,
1820- excluding TCP or UDP and IP headers.
1821- The op (Query) and response code
1822- (NoError) were omitted, as was the class
1823- .RB ( C_IN )
1824- of the A record.
1825- .LP
1826- In the second example, \fI helios \fP responds to query 2 with a
1827- response code of nonexistent domain (NXDomain) with no answers,
1828- one name server and no authority records.
1829- The `*' indicates that
1830- the \fI authoritative answer \fP bit was set.
1831- Since there were no
1832- answers, no type, class or data were printed.
1833- .LP
1834- Other flag characters that might appear are `\- ' (recursion available,
1835- RA, \fI not \fP set) and `|' (truncated message, TC, set).
1836- If the
1837- `question' section doesn't contain exactly one entry, `[\fI n \fP q]'
1838- is printed.
1835+ .if n \
1836+ .sp -1
1837+ .if t \
1838+ .sp -0.25v
1839+ .IP " \(bu " 3
1840+ \fB Class \fR : The query class was the normal one, \fI C_IN \fR , so it was omitted.
1841+ Any other query class would have been printed immediately after the \(ga A\(cq
1842+ .if n \
1843+ .sp -1
1844+ .if t \
1845+ .sp -0.25v
1846+ .IP " \(bu " 3
1847+ \fB Other anomalies \fR : If any of the response bits are set (AA, RA, TC or response code)
1848+ or any of the \(lq must be zero\(rq bits are set in bytes two and three,
1849+ \(ga [b2&3=\fI x \fR ]\(cq is printed, where \fI x \fR is the hex value of header bytes
1850+ two and three.
1851+ .if n \
1852+ .sp -1
1853+ .if t \
1854+ .sp -0.25v
1855+ .IP " \(bu " 3
1856+ \fB Query length \fR : 36 bytes (excluding the TCP or UDP and IP protocol headers)
1857+ .SS
1858+ DNS Responses
1859+ .LP
1860+ DNS responses are formatted as
1861+ .RS
1862+ .LP
1863+ .EX
1864+ src > dst: id op rcode flags a/n/au type class data (len)
1865+ .EE
1866+ .RE
1867+ .PP
1868+ Here are 2 example responses we\(cq ll break down:
1869+ .RS
1870+ .LP
1871+ .EX
1872+ #1: IP 8.8.8.8.53 > 192.0.2.1.1234: 492 2/0/1 A 104.18.27.120, A 104.18.26.120 (72)
1873+ #2: IP 8.8.8.8.53 > 192.0.2.1.1234: 492 NXDomain 0/0/1 (46)
1874+ .EE
1875+ .RE
1876+ .PP
1877+ The most commonly used fields here are:
1878+ .IP " \(bu " 3
1879+ \fB Source IP and port \fR : \f(CR 192.0.2.1.1234 \fR
1880+ .if n \
1881+ .sp -1
1882+ .if t \
1883+ .sp -0.25v
1884+ .IP " \(bu " 3
1885+ \fB Destination IP and port \fR : \f(CR 8.8.8.8.53 \fR
1886+ .if n \
1887+ .sp -1
1888+ .if t \
1889+ .sp -0.25v
1890+ .IP " \(bu " 3
1891+ \fB The records \fR : In example 1, the server replied with two A records: \(ga A 104.18.27.120\(cq and \(ga A 104.18.26.120\(cq
1892+ .if n \
1893+ .sp -1
1894+ .if t \
1895+ .sp -0.25v
1896+ .IP " \(bu " 3
1897+ \fB DNS response code \fR : In example 2, the response code is \(lq NXDomain\(rq , which means the domain wasn\(cq t found
1898+ .LP
1899+ All the other fields, in the order they appear:
1900+ .IP " \(bu " 3
1901+ \fB Query ID \fR : 492
1902+ .br
1903+ .if n \
1904+ .sp -1
1905+ .if t \
1906+ .sp -0.25v
1907+ .IP " \(bu " 3
1908+ \fB Opcode \fR : Same as for DNS requests above. Omitted here.
1909+ .if n \
1910+ .sp -1
1911+ .if t \
1912+ .sp -0.25v
1913+ .IP " \(bu " 3
1914+ \fB Flags \fR : Flags are after the query ID and opcode (for example \f(CR 492 update| \fR ), and are encoded like this:
1915+ .RS
1916+ .IP " \(bu " 3
1917+ RA: \(oq -\(cq if RA is missing (\(lq Recursion Available\(rq )
1918+ .if n \
1919+ .sp -1
1920+ .if t \
1921+ .sp -0.25v
1922+ .IP " \(bu " 3
1923+ TC: \(oq |\(cq (\(lq Truncated\(rq )
1924+ .if n \
1925+ .sp -1
1926+ .if t \
1927+ .sp -0.25v
1928+ .IP " \(bu " 3
1929+ AA: \(oq *\(cq (\(lq Authoritative Answer\(rq )
1930+ .if n \
1931+ .sp -1
1932+ .if t \
1933+ .sp -0.25v
1934+ .IP " \(bu " 3
1935+ AD: \(oq $\(cq (\(lq Authenticated Data\(rq )
1936+ .RE
1937+ .if n \
1938+ .sp -1
1939+ .if t \
1940+ .sp -0.25v
1941+ .IP " \(bu " 3
1942+ \fB Question records \fR : If the \(ga question\(cq section doesn\(cq t contain
1943+ exactly one entry, \(ga [\fI n \fR q]\(cq is printed.
1944+ .if n \
1945+ .sp -1
1946+ .if t \
1947+ .sp -0.25v
1948+ .IP " \(bu " 3
1949+ \fB Total number of records \fR : \f(CR 2/0/1 \fR : This means 2 \fI answer records \fR , 0 \fI authority records \fR , and 1 \fI additional record \fR (from example 1)
1950+ .if n \
1951+ .sp -1
1952+ .if t \
1953+ .sp -0.25v
1954+ .IP " \(bu " 3
1955+ \fB Class \fR : Same as for DNS requests above. Omitted here.
1956+ .if n \
1957+ .sp -1
1958+ .if t \
1959+ .sp -0.25v
1960+ .IP " \(bu " 3
1961+ \fB Length \fR : Same as for DNS requests above.
18391962.SS SMB/CIFS Decoding
18401963.LP
18411964\fI tcpdump \fP now includes fairly extensive SMB/CIFS/NBT decoding for data
0 commit comments