packet

Routing traffic from a specific application

霸气de小男生 提交于 2020-01-04 02:56:04
问题 Is there a way I can route traffic from an application to a diferent ip, let's say for instance route Firefox's traffic to localhost, for instance? I'm using windows. 回答1: There is a wide variety of proxifer, firewall and port forwarding software that allows you to redirect traffic by IP address, protocol, internal port, and external port through a range of different packages for windows. However, the only one I have found that allows you to specify rules (other than block) at the application

What are the reasons for UDP packets to be dropped by the network stack

半腔热情 提交于 2020-01-03 02:59:32
问题 I see UDP packets arriving on my Linux box (via tcpdump) with destination port set to 25555. However: nc -l -u 25555 shows no traffic. I've already checked: iptables is off destination MAC address matches the incoming interface destination IP address matches the incoming interface IP checksum is OK UDP checksum is OK Also, all the packets are being dropped, thus it's not a problem with overlowing rx buffers. Any ideas what else may cause the pakcets to be dropped? 回答1: You have another

What are the reasons for UDP packets to be dropped by the network stack

蓝咒 提交于 2020-01-03 02:59:14
问题 I see UDP packets arriving on my Linux box (via tcpdump) with destination port set to 25555. However: nc -l -u 25555 shows no traffic. I've already checked: iptables is off destination MAC address matches the incoming interface destination IP address matches the incoming interface IP checksum is OK UDP checksum is OK Also, all the packets are being dropped, thus it's not a problem with overlowing rx buffers. Any ideas what else may cause the pakcets to be dropped? 回答1: You have another

Packet modification with netfilter queue?

早过忘川 提交于 2020-01-02 07:59:07
问题 I'm currently trying to use codes with libnetfilter_queue in userspace to modify packets that were queued in the NFQUEUE target in iptables. However I have little idea as to how to go about doing it. I have set it to copy the packet with NFQNL_COPY_PACKET, if I were to modify the copied packet would it be automatically send back to the kernal by the function nfq_set_verdict()? Additionally, I have previously worked with extracting packets from a pcap file, however I noticed that the data that

Sniffing and displaying TCP packets in UTF-8

柔情痞子 提交于 2020-01-01 03:17:07
问题 I am trying to use tcpdump to display the content of tcp packets flowing on my network. I have something like: tcpdump -i wlan0 -l -A The -A option displays the content as ASCII text, but my text seems to be UTF-8. Is there a way to display UTF-8 properly using tcpdump? Do you know any other tools which could help? Many thanks 回答1: Make sure your terminal supports outputting UTF-8 and pipe the output to something which replaces non printable characters: tcpdump -lnpi lo tcp port 80 -s 16000

How does NetworkStream work in two directions?

一笑奈何 提交于 2019-12-31 02:55:10
问题 I've read an example of a Tcp Echo Server and some things are unclear to me. TcpClient client = null; NetworkStream netStream = null; try { client = listener.AcceptTcpClient(); netStream = client.GetStream(); int totalBytesEchoed = 0; while ((bytesRcvd = netStream.Read(rcvBuffer, 0, rcvBuffer.Length)) > 0) { netStream.Write(rcvBuffer, 0, bytesRcvd); totalBytesEchoed += bytesRcvd; } netStream.Close(); client.Close(); } catch { netStream.Close(); } When the server receives a packet (the while

Data loss TCP IP C#

末鹿安然 提交于 2019-12-30 11:03:06
问题 Here's my code: private void OnReceive(IAsyncResult result) { NetStateObject state = (NetStateObject)result.AsyncState; Socket client = state.Socket; int size = client.EndReceive(result); byte[] data = state.Buffer; object data = null; using (MemoryStream stream = new MemoryStream(data)) { BinaryFormatter formatter = new BinaryFormatter(); data = formatter.Deserialize(stream); } //todo: something with data client.BeginReceive( state.Buffer, 0, NetStateObject.BUFFER_SIZE, SocketFlags.None,

Processing packets with unknown IPv6 extension headers

时间秒杀一切 提交于 2019-12-30 06:24:34
问题 Question Should one discard a packet with an unknown IPv6 extension header? Details I could not find an answer to this question by examining the RFC. The book IPv6 Essentials states on page 22: If a node is required the next header but cannot identify the value in the Next Header field, it is required to discard the packet and send an ICMPv6 Parameter Problem message back to the source of the packet. I read this as: a IPv6 packet with a custom extension header cannot will be dropped unless

sending packets to a client given the remote_endpoint object and the socket?

别来无恙 提交于 2019-12-25 04:14:06
问题 Is there a way to send a packet to a client knowing the remote_endpoint object where endpoint.address and endpoint.port are used? EDIT : I added the async_write free function but I still don't know how to specify the ip-address or the port for the socket_ to send data_ to (the client). The changes are lines 44-49 to the boost async server example. #include <cstdlib> #include <iostream> #include <boost/bind.hpp> #include <boost/asio.hpp> using boost::asio::ip::tcp; class session { public:

How to add jcap.jar and its Javadoc into Netbeans

天涯浪子 提交于 2019-12-25 03:59:11
问题 i want to add jpcap.jar the path is this: C:\WINDOWS\Sun\Java\lib\ext how to do this? import java.lang.ClassLoader; is it needed? or: System.loadLibrary('what must be in here?'); or: System.load(???); suppose this code: public void receivePacket(Packet packet) { System.out.println(packet); if (packet instanceof IPPacket) { IPPacket ipp = (IPPacket)packet; InetAddress dest = ipp.dst_ip; InetAddress src = ipp.src_ip; System.out.print(src); System.out.print(dest); } in the main i have this: s