有没有办法检测到我路由器中特定端口的请求?

发布于 2025-02-11 07:31:46 字数 153 浏览 2 评论 0原文

我打开了路由器的端口,该端口已链接到我设置的媒体服务器,并且可以从任何地方访问,所以我的目的是监视发送到此服务器的请求(本质上是发送到此端口)

是否有一种方法来嗅探这个端口(不使用Wireshark,我想嗅探此端口,并且仅此端口 - 即使是带有时间戳ANS IPS的CMD窗口)

I opened a port to my router which is linked to a media server I got set up and its accessible from anywhere, so my intention is to monitor the requests sent to this server (essentially, sent to this port)

Is there a way to sniff this port (not with wireshark, I want to sniff this port and this port only- even a cmd window with timestamps ans ips will do)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨落□心尘 2025-02-18 07:31:46

我假设您正在使用Linux。
尝试TSHARK工具。

Instalation

sudo apt-get update
sudo apt-get install tshark
sudo usermod -a -G wireshark your-user-name

Your-user-name用您的真实姓名替换为使用TSHARK。

使用过滤数据包和字段的示例

输出中

tshark -i eth0 -n -l -f "tcp dst port 80 and tcp[tcpflags] & (tcp-syn) != 0  and tcp[tcpflags] & (tcp-ack) = 0" 2>/dev/null | awk -F " " '{ print $3 " " $4; }'

:将端口80替换为要监视的TCP端口号,并用接口名称ETH0

OTPUT的示例:

00:30:53,317023498 10.1.1.111
00:31:01,108270223 10.1.1.111

第一个字段是一天中的当前时间,即00小时30分钟53秒。

第二个字段是连接到端口80的设备的IP地址。

启动新连接时仅捕获和分析数据包,即具有flags syn = 1和ack = 0的设备。

Windows

如果您使用的是Windows,则TSHARK的参数将保持不变,除了您需要使用其他方法而不是AWK过滤器来选择时间和IP地址字段。

I assume you're using Linux.
Try the Tshark tool.

Instalation

sudo apt-get update
sudo apt-get install tshark
sudo usermod -a -G wireshark your-user-name

Replace the your-user-name with your real name of user, which will use Tshark.

Example of use

Filtering packets and fields in the output:

tshark -i eth0 -n -l -f "tcp dst port 80 and tcp[tcpflags] & (tcp-syn) != 0  and tcp[tcpflags] & (tcp-ack) = 0" 2>/dev/null | awk -F " " '{ print $3 " " $4; }'

Replace port 80 with the TCP port number that you want to monitor and eth0 with your interface name.

Example of otput:

00:30:53,317023498 10.1.1.111
00:31:01,108270223 10.1.1.111

The first field is the current time of day, i.e. 00 hours 30 minutes 53 sec.

The second field is the IP address of the device that connects to port 80.

Only packets are captured and analyzed when a new connection is initiated, i.e. which have flags SYN=1 and ACK=0.

Windows

If you're using Windows, the parameters for Tshark will remain the same, except you need to use a different method instead of the awk filter to select the time and the IP address fields.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文