Skip to content

Commit

Permalink
Fixing test T1562.004-19 (#2943)
Browse files Browse the repository at this point in the history
Co-authored-by: Hare Sudhan <[email protected]>
  • Loading branch information
AlbertoPellitteri and cyberbuff authored Sep 24, 2024
1 parent de13448 commit 9f9fb5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions atomics/T1562.004/T1562.004.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,12 @@ atomic_tests:
if [ ! -x "$(command -v iptables)" ]; then echo -e "\n***** iptables NOT installed *****\n"; exit 1; fi
if ! echo "$(iptables -L)" | grep -q "DROP .*dpt:ftp"; then echo -e "\n***** this firewall rule is NOT activated *****\n***** activate it by executing \"iptables -A OUTPUT -p tcp --dport 21 -j DROP\" *****\n"; exit 1; fi
get_prereq_command: |
echo ""
iptables-save > /tmp/iptables.rules
if echo "$(iptables -L)" | grep -q "DROP .*dpt:ftp"; then echo "Rule found"; else echo "Rule not found. Setting it..."; iptables -A OUTPUT -p tcp --dport 21 -j DROP; fi
executor:
name: sh
elevation_required: true
command: |
iptables-save > /tmp/iptables.rules
iptables -D OUTPUT -p tcp --dport 21 -j DROP
cleanup_command: |
iptables-restore < /tmp/iptables.rules
Expand Down

0 comments on commit 9f9fb5f

Please sign in to comment.