📄 40c3d47fe485001c137e8d39bfadea2c
字号:
import java.io.*;
import java.sql.*;
import jpcap.*;
public class Main
{
static long start;
public static void main(String[] args) throws java.io.IOException,SQLException
{
NetworkInterface[] devices =JpcapCaptor.getDeviceList();
for(int i=0;i<devices.length;++i)
System.out.println(devices[i].name);
JpcapCaptor jpcap = JpcapCaptor.openDevice(devices[1],65535,true, 20);
File FilePath=new File("E:");
File f1=new File(FilePath,"packet.txt");
FileOutputStream fout=new FileOutputStream(f1);
DataOutputStream dout=new DataOutputStream(fout);
start=System.currentTimeMillis();//记录抓包的开始时间
for(int k=0;k<3000;++k)
{
jpcap.loopPacket(1, new catchbao());//抓包
dout.writeBytes(catchbao.sting);//将数据包写入文件
}
Catchcount.Catchcount(String []args);//统计各种协议数据包数量
//ComLen.comlen();//统计各种长度数据包的数量;
Drawpicture frame=new Drawpicture();//画出数据包流量图
frame.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -