packet-mangling

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

Forcing packet loss

邮差的信 提交于 2020-01-02 05:46:14
问题 For testing purposes, to determine how a protocol implementation behaves in the presence of packet loss, I would like to force packet loss on one of my network devices. Specifically, I would like to be able to tune the packet loss anywhere between 0% and 100%. I have a little experience with iptables and it seems to me I should be able to achieve it using that, but I haven't been able to. Achieving 100% packet loss is not a problem though ;). Any ideas on how to do this? 回答1: Look into

Python port forwarding/multiplexing server

こ雲淡風輕ζ 提交于 2019-12-03 12:47:25
问题 I would like to make server that listen on UDP port 162 (SNMP trap) and then forwards this traffic to multiple clients. Also important is that the source port & address stays same (address spoofing). I guess that best tool for this would be Twisted or Scapy or maybe vanilla sockets, only I can't find anything in the documentation for Twisted about source address spoofing/forging. Any solution for this? Edit:added bounty, mybe any solution with iptables? 回答1: I am not comfortable with twisted

Packet mangling utilities besides iptables? [closed]

做~自己de王妃 提交于 2019-12-03 07:20:28
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm looking for a linux utility that can alter the payloads of network packets based on a set of rules. Ideally, I'd use iptables and the netfilter kernel module, but they don't support generic payload mangling: iptables will alter various header fields (addresses, ports, TOS, etc), and it can match arbitrary

Python port forwarding/multiplexing server

做~自己de王妃 提交于 2019-12-03 03:16:35
I would like to make server that listen on UDP port 162 (SNMP trap) and then forwards this traffic to multiple clients. Also important is that the source port & address stays same (address spoofing). I guess that best tool for this would be Twisted or Scapy or maybe vanilla sockets, only I can't find anything in the documentation for Twisted about source address spoofing/forging. Any solution for this? Edit:added bounty, mybe any solution with iptables? I am not comfortable with twisted or scapy, but it's quite straightforward to do this with vanilla python sockets. An extra advantage of that

Packet mangling utilities besides iptables? [closed]

故事扮演 提交于 2019-12-02 20:49:57
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. I'm looking for a linux utility that can alter the payloads of network packets based on a set of rules. Ideally, I'd use iptables and the netfilter kernel module, but they don't support generic payload mangling: iptables will alter various header fields (addresses, ports, TOS, etc), and it can match arbitrary bytes within a packet, but it apparently is unable to alter arbitrary data within the packet. A kernel module