@@ -0,0 +1,1624 @@
+package Capture;%0A%0Aimport org.apache.log4j.Logger;%0Aimport org.jnetpcap.Pcap;%0Aimport org.jnetpcap.packet.PcapPacket;%0Aimport org.jnetpcap.packet.PcapPacketHandler;%0Aimport org.jnetpcap.protocol.network.Ip4;%0Aimport org.jnetpcap.protocol.tcpip.Http;%0Aimport org.jnetpcap.protocol.tcpip.Http.Request;%0Aimport org.jnetpcap.protocol.tcpip.Tcp;%0A%0Apublic class PacketInspector implements PcapPacketHandler%3CObject%3E %7B%0A%09public Logger exceptionLog = Logger.getLogger(%22debugLogger%22);%0A%09static Logger matchLog = Logger.getLogger(%22maliciousMatchLogger%22);%0A%09Pcap pcap;%0A%0A%09String ipInfoMatch;%0A%09String sourceIP;%0A%09String destinationIP;%0A%0A%09@Override%0A%09public void nextPacket(PcapPacket packet, Object string) %7B%0A%09%09PcapPacket p = packet;%0A%09%09Tcp tcp = new Tcp();%0A%09%09Ip4 ip4 = new Ip4();%0A%09%09Http http = new Http();%0A%0A%09%09if (p.hasHeader(ip4) && p.hasHeader(tcp)) %7B%0A%09%09%09byte%5B%5D sIP = new byte%5B4%5D;%0A%09%09%09byte%5B%5D dIP = new byte%5B4%5D;%0A%09%09%09sIP = packet.getHeader(ip4).source();%0A%09%09%09dIP = packet.getHeader(ip4).destination();%0A%0A%09%09%09sourceIP = org.jnetpcap.packet.format.FormatUtils.ip(sIP);%0A%09%09%09destinationIP = org.jnetpcap.packet.format.FormatUtils.ip(dIP);%0A%0A%09%09%09ipInfoMatch = sourceIP + %22 %5Ct%22 + destinationIP + %22%5Ct%22 + Check.isIPMalicious(sourceIP);%0A%09%09%09matchLog.info(ipInfoMatch);%0A%09%09%09System.out.println(ipInfoMatch);%0A%0A%09%09%09if (p.hasHeader(tcp) && p.hasHeader(http) && !http.isResponse()) %7B%0A%09%09%09%09String url = %22http://%22 + http.fieldValue(Request.Host) + http.fieldValue(Request.RequestUrl);%0A%09%09%09%09String urlMatchInfo = url + %22%5Ct%22 + Check.isUrlMalicious(url);%0A%0A%09%09%09%09matchLog.info(ipInfoMatch + %22%5Ct%22 + urlMatchInfo);%0A%0A%09%09%09%09System.out.println(ipInfoMatch + %22%5Ct%22 + urlMatchInfo);%0A%09%09%09%7D%0A%0A%09%09%7D%0A%0A%09%7D%0A%0A%7D%0A

Create PacketInspector.java