如何从Windows中的java中捕获的数据包中提取IP地址?

时间:2016-04-04 09:05:14

标签: java networking winpcap jpcap

我正在进行网络监控。我希望监控数据并从管理员PC检查客户端PC的网络使用情况。  我已经想到我可以通过捕获浏览器的数据包来实现这一点,如下所示。 (这是FB请求的数据包)

  

New packet1459690210:290428 / 192.168.0.138->/31.13.79.220 protocol(6)priority(0)hop(128)offset(0)ident(2687)TCP 49281> 443 seq(1708554008)win(258)ack 938747547 P

但是,如何从捕获的数据包中提取目的地的ipaddress。

我希望将数据存储在数据库中,并在图像中显示如下。

我也希望以MB为单位使用数据。 非常感谢您的帮助。

enter image description here

1 个答案:

答案 0 :(得分:0)

(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\d*

This is what I got. This regex retrieves the ip addresses.

I still have to figure out how to get the used MBs. If any one can help, I shall be greatful

相关问题