指定目标TCP端口的traceroute命令tcptraceroute mailserver 25等价traceroute -T mailserver -p 25

指定目标TCP端口的traceroute命令tcptraceroute mailserver 25等价traceroute -T mailserver -p 25tcptraceroute(1)-LinuxmanpageNametcptraceroute-AtracerouteimplementationusingTCPpacketsSynopsistcptraceroute[-nNFSAE][-iinterface][-ffirstttl][-llength][-qnumberofqueries][-ttos][-mmaxttl][-psourceport]…

大家好,又见面了,我是你们的朋友全栈君。

tcptraceroute(1) – Linux man page

Name

tcptraceroute – A traceroute implementation using TCP packets

Synopsis

 

tcptraceroute [-nNFSAE] [ -i interface ] [ -f first ttl ]
[ -l length ] [ -q number of queries ] [ -t tos ]
[ -m max ttl ] [ -p source port ] [ -s source address ]
[ -w wait time ] host [ destination port ] [ length ]

Description

tcptraceroute is a traceroute implementation using TCP packets.

The more traditional traceroute(8) sends out either UDP or ICMP ECHO packets with a TTL of one, and increments the TTL until the destination has been reached. By printing the gateways that generate ICMP time exceeded messages along the way, it is able to determine the path packets are taking to reach the destination.

The problem is that with the widespread use of firewalls on the modern Internet, many of the packets that traceroute(8) sends out end up being filtered, making it impossible to completely trace the path to the destination. However, in many cases, these firewalls will permit inbound TCP packets to specific ports that hosts sitting behind the firewall are listening for connections on. By sending out TCP SYN packets instead of UDP or ICMP ECHO packets, tcptraceroute is able to bypass the most common firewall filters.

It is worth noting that tcptraceroute never completely establishes a TCP connection with the destination host. If the host is not listening for incoming connections, it will respond with an RST indicating that the port is closed. If the host instead responds with a SYN|ACK, the port is known to be open, and an RST is sent by the kernel tcptraceroute is running on to tear down the connection without completing three-way handshake. This is the same half-open scanning technique that nmap(1) uses when passed the -sS flag.

Options

-n

Display numeric output, rather than doing a reverse DNS lookup for each hop. By default, reverse lookups are never attempted on RFC1918 address space, regardless of the -n flag.

-N

Perform a reverse DNS lookup for each hop, including RFC1918 addresses.

-f

Set the initial TTL used in the first outgoing packet. The default is 1.

-m

Set the maximum TTL used in outgoing packets. The default is 30.

-p

Use the specified local TCP port in outgoing packets. The default is to obtain a free port from the kernel using bind(2). Unlike with traditional traceroute(8), this number will not increase with each hop.

-s

Set the source address for outgoing packets. See also the -i flag.

-i

Use the specified interface for outgoing packets.

-q

Set the number of probes to be sent to each hop. The default is 3.

-w

Set the timeout, in seconds, to wait for a response for each probe. The default is 3.

-S

Set the TCP SYN flag in outgoing packets. This is the default, if neither -S or -A is specified.

-A

Set the TCP ACK flag in outgoing packets. By doing so, it is possible to trace through stateless firewalls which permit outgoing TCP connections.

-E

Send ECN SYN packets, as described in RFC2481.

-t

Set the IP TOS (type of service) to be used in outgoing packets. The default is not to set any TOS.

-F

Set the IP “don’t fragment” bit in outgoing packets.

-l

Set the total packet length to be used in outgoing packets. If the length is greater than the minimum size required to assemble the necessary probe packet headers, this value is automatically increased.

-d

Enable debugging, which may or may not be useful.

–dnat

Enable DNAT detection, and display messages when DNAT transitions are observed. DNAT detection is based on the fact that some NAT devices, such as some Linux 2.4 kernels, do not correctly rewrite the IP address of the IP packets quoted in ICMP time-exceeded messages tcptraceroute solicits, revealing the destination IP address an outbound probe packet was NATed to. NAT devices which correctly rewrite the IP address quoted by ICMP messages, such as some Linux 2.6 kernels, will not be detected. For some target hosts, it may be necessary to use –dnat in conjunction with –track-port. See the examples.txt file for examples.

–no-dnat

Enable DNAT detection for the purposes of correctly identifying ICMP time-exceeded messages that match up with outbound probe packets, but do not display messages when a DNAT transition is observed. This is the default behavior.

–no-dnat-strict

Do not perform any DNAT detection whatsoever. No attempt will be made match up ICMP time-exceeded messages with outbound probe packets, and when tracerouting through a NAT device which does not rewrite the IP addresses of the IP packets quoted in ICMP time-exceeded messages, some hops along the path may appear to be unresponsive. This option should not be needed in the vast majority of cases, but may be utilized if it is suspected that the DNAT detection code is misidentifying ICMP time-exceeded messages.

Examples

Please see the examples.txt file included in the tcptraceroute distribution for a few real world examples.

To trace the path to a web server listening for connections on port 80:

tcptraceroute webserver

To trace the path to a mail server listening for connections on port 25:

tcptraceroute mailserver 25

Bugs

No error checking is performed on the source address specified by the -s flag, and it is therefore possible for tcptraceroute to send out TCP SYN packets for which it has no chance of seeing a response to.

Author

Michael C. Toren <mct@toren.net>

Availability

For updates, please see:

http://michael.toren.net/code/tcptraceroute/

See Also

traceroute(8)ping(8)nmap(1)

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/151488.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 超好听的英文名男孩_男生好听小众的英文名

    超好听的英文名男孩_男生好听小众的英文名TroyKentBrandonLandonCordBarneyBlaineVanVictorJulesDylanColeIggy/EgbertJackDoug/DouglasRyderTylerSethNemoDarrenFoleyBennettBrianPhil/PhilipEthanJusticeIvanElliottWilsonJoe/JosephZorbaLiamAdam

    2025年6月15日
    3
  • HTML如何实现页面跳转(html跳转到指定页面)

    1、html中使用meta中跳转,通过meta可以设置跳转时间和页面&lt;head&gt;&lt;!–只是刷新不跳转到其他页面–&gt;&lt;metahttp-equiv="refresh"content="5"&gt;&lt;!–定时转到其他页面–&gt;&lt;metahttp-equiv="refresh&quot

    2022年4月11日
    2.0K
  • IDEA打包maven项目同时带上依赖

    IDEA打包maven项目同时带上依赖我们在使用IDEA中maven的LifeCycle去打包时,打出的jar包只包含代码,在使用时会出现“找不到包或者无法加载“ClassNotFoundException”报错。这是因为我们的jar包没有maven项目中的其他依赖包,所以我们可以在打包时把依赖也打入到jar包中,步骤如下:1、选中项目,点击File,选择打开“ProjectStructure”2、然后选择左边的“Artifacts”,点击“加号”添加jar包,“Frommodul…

    2022年5月30日
    206
  • Vue全家桶介绍_vue全家桶有什么好处

    Vue全家桶介绍_vue全家桶有什么好处全家桶:顾名思义。对于一个完整的中大型单页面应用项目所必须的插件和框架。一、vue-clivue-cli也叫脚手架,官方定义为Vue.js开发的标准工具!相比script标签引入1)、功能丰富对Babel、TypeScript、ESLint、PostCSS、PWA、单元测试和End-to-end测试提供开箱即用的支持。2)、易于扩展它的插件系统可以让社区根据常见需求构建和共享可复用的解决方案。3)、无需EjectVueCLI完全是可配置的,无需eject。这样你的项目就可以长

    2025年6月16日
    2
  • group by 和 order by 的区别 + 理解过程

    group by 和 order by 的区别 + 理解过程orderby和groupby的区别order by 和 group by 的区别:1,order by 从英文里理解就是行的排序方式,默认的为升序。 order by 后面必须列出排序的字段名,可以是多个字段名。2,group by 从英文里理解就是分组。必须有“聚合函数”来配合才能使用,使用时至少需要一个分组标志字段。注意:聚合函数是—sum()、count()、…

    2022年5月9日
    40
  • SpringBoot 项目部署到服务器上(Jar包)

    SpringBoot 项目部署到服务器上(Jar包)1.部署方式Springboot和普通web应用程序不一样,其本质上是一个Java应用程序,那么又如何部署呢?通常来说,Springboot部署会采用两种方式:全部打包成一个jar,或者打包成一个war。现在讲一下打包成jar部署。2.打包成jar第一种方法(idea)1.clean2.package第二种方法(命令行):…

    2022年6月18日
    25

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号