Skip to content

Instantly share code, notes, and snippets.

@SarvagyaVaish
Last active April 9, 2017 19:46
Show Gist options
  • Save SarvagyaVaish/c0597d54127cc29f3c712011ca593f77 to your computer and use it in GitHub Desktop.
Save SarvagyaVaish/c0597d54127cc29f3c712011ca593f77 to your computer and use it in GitHub Desktop.
# Configuration #1
# Block all traffic FROM e1, e2, w1, w2
# Test #1:
# - run TCP server on e1
# [python test-tcp-server.py 10.0.0.1 1080]
# - run TCP client on e2 (e2 -> e1) - disallowed
# [python test-tcp-client.py 10.0.0.1 1080]
# - run TCP client on e3 (e3 -> e1) - disallowed
# [python test-tcp-client.py 10.0.0.1 1080]
# Test #2:
# - run UDP server on w1
# [python test-udp-server.py 10.0.0.5 1080]
# - run UDP client on w2 (w2 -> w1) - disallowed
# [python test-udp-client.py 10.0.0.5 1080]
# - run UDP client on w3 (w3 -> w1) - disallowed
# [python test-udp-client.py 10.0.0.5 1080]
# 1, 00:00:00:00:00:01, *, *, *, *, *, *
# 2, 00:00:00:00:00:02, *, *, *, *, *, *
# 3, 00:00:00:00:00:05, *, *, *, *, *, *
# 4, 00:00:00:00:00:06, *, *, *, *, *, *
# Configuration #2
# Block all traffic TO e1, e2, w1, w2
# Test #1:
# - run TCP server on e1
# [python test-tcp-server.py 10.0.0.1 1080]
# - run TCP client on e2 (e2 -> e1) - disallowed
# [python test-tcp-client.py 10.0.0.1 1080]
# - run TCP client on e3 (e3 -> e1) - disallowed
# [python test-tcp-client.py 10.0.0.1 1080]
# Test #2:
# - run UDP server on w1
# [python test-udp-server.py 10.0.0.5 1080]
# - run UDP client on w2 (w2 -> w1) - disallowed
# [python test-udp-client.py 10.0.0.5 1080]
# - run UDP client on w3 (w3 -> w1) - disallowed
# [python test-udp-client.py 10.0.0.5 1080]
# 1, *, 00:00:00:00:00:01, *, *, *, *, *
# 2, *, 00:00:00:00:00:02, *, *, *, *, *
# 3, *, 00:00:00:00:00:05, *, *, *, *, *
# 4, *, 00:00:00:00:00:06, *, *, *, *, *
# Configuration #3
# Block all traffic FROM port 1080
# Test #1:
# - run TCP server on e1 on port 1080
# [python test-tcp-server.py 10.0.0.1 1080]
# - run TCP server on e2 on port 1234
# [python test-tcp-server.py 10.0.0.2 1234]
# - run TCP client on e3 (e3 -> e1) - disallowed
# [python test-tcp-client.py 10.0.0.1 1080]
# - run TCP client on e3 (e3 -> e2) - allowed
# [python test-tcp-client.py 10.0.0.2 1234]
# Test #2:
# - run UDP server on w1 on port 1080
# [python test-udp-server.py 10.0.0.5 1080]
# - run UDP server on w2 on port 1234
# [python test-udp-server.py 10.0.0.6 1234]
# - run UDP client on w3 (w3 -> w1) - server receives, hangs on sending
# [python test-udp-client.py 10.0.0.5 1080]
# - run UDP client on w3 (w3 -> w2) - allowed
# [python test-udp-client.py 10.0.0.6 1234]
# 1, *, *, *, *, 1080, *, *
# Configuration #4
# Block all traffic TO port 1080
# Test #1:
# - run TCP server on e1 on port 1080
# [python test-tcp-server.py 10.0.0.1 1080]
# - run TCP server on e2 on port 1234
# [python test-tcp-server.py 10.0.0.2 1234]
# - run TCP client on e3 (e3 -> e1) - disallowed
# [python test-tcp-client.py 10.0.0.1 1080]
# - run TCP client on e3 (e3 -> e2) - allowed
# [python test-tcp-client.py 10.0.0.2 1234]
# Test #2:
# - run UDP server on w1 on port 1080
# [python test-udp-server.py 10.0.0.5 1080]
# - run UDP server on w2 on port 1234
# [python test-udp-server.py 10.0.0.6 1234]
# - run UDP client on w3 (w3 -> w1) - disallowed
# [python test-udp-client.py 10.0.0.5 1080]
# - run UDP client on w3 (w3 -> w2) - allowed
# [python test-udp-client.py 10.0.0.6 1234]
# 1, *, *, *, *, *, 1080, *
# Configuration #5
# Block all TCP traffic
# Test #1:
# - run TCP server on e1
# [python test-tcp-server.py 10.0.0.1 1080]
# - run TCP client on e2 (e2 -> e1) - disallowed
# [python test-tcp-client.py 10.0.0.1 1080]
# Test #2:
# - run UDP server on w1
# [python test-udp-server.py 10.0.0.5 1080]
# - run UDP client on w2 (w2 -> w1) - allowed
# [python test-udp-client.py 10.0.0.5 1080]
# 1, *, *, *, *, *, *, T
# Configuration #6
# Block all UDP traffic
# Test #1:
# - run TCP server on e1
# [python test-tcp-server.py 10.0.0.1 1080]
# - run TCP client on e2 (e2 -> e1) - allowed
# [python test-tcp-client.py 10.0.0.1 1080]
# Test #2:
# - run UDP server on w1
# [python test-udp-server.py 10.0.0.5 1080]
# - run UDP client on w2 (w2 -> w1) - disallowed
# [python test-udp-client.py 10.0.0.5 1080]
# 1, *, *, *, *, *, *, U
# Configuration #7
# Block ALL traffic
# Test #1:
# - run TCP server on e1
# [python test-tcp-server.py 10.0.0.1 1080]
# - run TCP client on e2 (e2 -> e1) - disallowed
# [python test-tcp-client.py 10.0.0.1 1080]
# Test #2:
# - run UDP server on w1
# [python test-udp-server.py 10.0.0.5 1080]
# - run UDP client on w2 (w2 -> w1) - disallowed
# [python test-udp-client.py 10.0.0.5 1080]
# 1, *, *, *, *, *, *, B
# Configuration #8
# Block NOTHING
# Test #1:
# - run TCP server on e1
# [python test-tcp-server.py 10.0.0.1 1080]
# - run TCP client on e2 (e2 -> e1) - allowed
# [python test-tcp-client.py 10.0.0.1 1080]
# Test #2:
# - run UDP server on w1
# [python test-udp-server.py 10.0.0.5 1080]
# - run UDP client on w2 (w2 -> w1) - allowed
# [python test-udp-client.py 10.0.0.5 1080]
# 1, *, *, *, *, *, *, *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment