By calling your instance instance [ captor.loopPacket(-1,handler)] using this handler:
public class TelnetReceiver implements PacketReceiver
{
public void receivePacket(Packet p)
{
if (p instanceof TCPPacket) {
TCPPacket tcp = (TCPPacket) p;
if(tcp.dst_port == 23 || tcp.src_port == 23)) {
}
}
}
}
source
share