Skip to content

Instantly share code, notes, and snippets.

@bloatfan
Forked from vdw/gist:09efee4f264bb2630345
Last active May 26, 2021 15:12
Show Gist options
  • Save bloatfan/b68b35aaf76a4d01b579e0718242c57c to your computer and use it in GitHub Desktop.
Save bloatfan/b68b35aaf76a4d01b579e0718242c57c to your computer and use it in GitHub Desktop.

Revisions

  1. bloatfan renamed this gist May 26, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @vdw vdw revised this gist Jan 25, 2015. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,9 @@ Block brute forcing - iptables rules
    ```
    iptables -L -n
    iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set
    iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --update --seconds 600 --hitcount 3 -j DROP
    iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set --name ssh --rsource
    iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent ! --rcheck --seconds 600 --hitcount 3 --name ssh --rsource -j ACCEPT
  3. @vdw vdw revised this gist Jan 22, 2015. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,15 @@ Block with ip tables
    ```iptables -A INPUT -s IP-ADDRESS -j DROP```

    Kill connection
    ```tcpkill -i eth0 -9 port 50185```
    ```tcpkill -i eth0 -9 port 50185```

    Block brute forcing - iptables rules
    ```
    iptables -L -n
    iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set --name ssh --rsource
    iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent ! --rcheck --seconds 600 --hitcount 3 --name ssh --rsource -j ACCEPT
    service iptables save
    service iptables restart
    ```
  4. @vdw vdw revised this gist Jan 22, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    Install tcpkill
    ```yum -y install dsniff --enablerepo=epel```

    View connections
    View connections
    ```netstat -tnpa | grep ESTABLISHED.*sshd.```

    Block with ip tables
  5. @vdw vdw revised this gist Jan 22, 2015. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,9 @@
    Install tcpkill
    ```yum -y install dsniff --enablerepo=epel```

    View connections
    ```netstat -tnpa | grep ESTABLISHED.*sshd.```

    Block with ip tables
    ```iptables -A INPUT -s IP-ADDRESS -j DROP```

  6. @vdw vdw revised this gist Jan 22, 2015. No changes.
  7. @vdw vdw revised this gist Jan 22, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    Install tcpkill
    Install tcpkill
    ```yum -y install dsniff --enablerepo=epel```

    Block with ip tables
    Block with ip tables
    ```iptables -A INPUT -s IP-ADDRESS -j DROP```

    Kill connection
    Kill connection
    ```tcpkill -i eth0 -9 port 50185```
  8. @vdw vdw created this gist Jan 22, 2015.
    8 changes: 8 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    Install tcpkill
    ```yum -y install dsniff --enablerepo=epel```

    Block with ip tables
    ```iptables -A INPUT -s IP-ADDRESS -j DROP```

    Kill connection
    ```tcpkill -i eth0 -9 port 50185```