command line execution
Hi love the software.
When I try something like these commands block_command: "/bin/echo $IP block_command: "/bin/echo $IP >> bans.txt" It doesn't appear to run these commands.
Then after more testing the iptables commands don't appear to be working either. block_command: "/sbin/iptables -A INPUT -s $IP -j DROP" unblock_command: "/sbin/iptables -D INPUT -s $IP -j DROP"
When I run these commands outside of beartrap they work. Any ideas?
Ubuntu Server 14.04.1
root@fserver:/home/tbennett/beartrap# ruby bear_trap.rb -c config.yml -d Trying to load trigger: {"type"=>"FTP", "banner"=>"BearTrap-ftpd Service ready"} Loading /home/tbennett/beartrap/lib/Trigger/FTPTrigger.rb /home/tbennett/beartrap/lib/Trigger/FTPTrigger.rb loaded successfully Checking parameters for #FTPTrigger:0x0000000118b040 Parameters verified for #FTPTrigger:0x0000000118b040 Loading /home/tbennett/beartrap/lib/AlertHandler/CommandlineAlertHandler.rb /home/tbennett/beartrap/lib/AlertHandler/CommandlineAlertHandler.rb loaded successfully Checking parameters for #CommandlineAlertHandler:0x000000011a9248 Parameters verified for #CommandlineAlertHandler:0x000000011a9248 Binding FTP server to 0.0.0.0:21 Created thread for #TCPServer:0x000000011ba390 Command: /sbin/iptables -A INPUT -s 10.1.1.102 -j DROP
I found out what was going on. I submitted a pull request to fix it
Fixed with 29f14b0
Thanks for the patch, I can't believe I left that out! :+1: