Skip to content
iptables xor module
C Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
include
kernel
userspace
LICENSE
README.md

README.md

iptables xor module

The XOR target enables the user to encrypt TCP and UDP traffic using a very simple xor encryption.
Xor is its own inverse. That is, to undo xor, the same algorithm is applied, so the same action can be used for encoding and decoding.
warning: This is not a real encryption.

Install

  1. first install kernel-devel, iptables-devel and etc.
  2. To compile the userpace so,
cd userspace;make libxt_XOR.so
cp libxt_XOR.so /lib64/xtables/
  1. To compile the kernel module,
cd kernel;make
insmod xt_XOR.ko

Usage

XOR takes one mandatory parameter.
--key key-value where key-value is a byte used to xor with packet payloads.

Example

To use this target between hosts 1.2.3.4 and 1.2.3.5.

(on host A, 1.2.3.4)

iptables −t mangle −A OUTPUT -d 1.2.3.5 -p tcp --dport 1234 −j XOR −−key 0x61
iptables −t mangle −A INPUT -s 1.2.3.5 -p tcp --sport 1234 −j XOR −−key 0x61

(on host B, 1.2.3.5)

iptables −t mangle −A OUTPUT −d 1.2.3.4 -p tcp --sport 1234 −j XOR −−key 0x61
iptables −t mangle −A INPUT −s 1.2.3.4 -p tcp --dport 1234 −j XOR −−key 0x61

Notice

  • Support kernel version >= 2.6.32.
  • Tested on Centos6.5(2.6.32-431.23.3.el6.x86_64), centos7.2(3.10.0-327.22.2.el7.x86_64) and kernel 4.1.0.

License

This project is under the MIT license. See the LICENSE file for the full license text.

You can’t perform that action at this time.