Skip to content

Instantly share code, notes, and snippets.

@sloria
Created May 15, 2014 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sloria/ebcc633a2310ead47857 to your computer and use it in GitHub Desktop.
Save sloria/ebcc633a2310ead47857 to your computer and use it in GitHub Desktop.
Non-working portscan denial test
- name: test csf | Port scans are denied
connection: local
sudo: no
# doalarm runs a command and returns an error if no output was captured in
# 3 seconds
# Here, a portscan is attempted; CSF should hang the connection, so doalarm() should
# return an error
command: doalarm () { perl -e 'alarm shift; exec @ARGV' "$@"; } && doalarm 3 nc -z 192.168.111.111 1-1023
register: portscan_result
failed_when: portscan_result.stdout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment