ban ip in router by iptables

Fixer's Avatar

Fixer

02 Nov, 2014 11:54 AM

with phpseclib you can connect to SSH and make command like iptables -A INPUT -s 255.255.255.255 -i eth0 -j DROP
http://phpseclib.sourceforge.net/

<?php
include('phpseclib/Net/SSH2.php');
$ssh = new Net_SSH2('192.168.1.1'); // router address

if (!$ssh->login('user', 'password')) {
exit('Login failed'); }

echo ("BAN $user_ip!");
$ssh->exec("iptables -A INPUT -s $user_ip -i eth0 -j DROP"); ?>

  1. Support Staff 1 Posted by potsky on 04 Nov, 2014 09:35 AM

    potsky's Avatar

    Hi Fixer,

    I will not implement this feature as this because it will not work on windows server, because I don't really know how to store credentials to connect to a server, because it is too dangerous to manage the iptables from an web interface by default...

    But !

    In fact, all you want is a plugin feature and plugins to install in Pimp My Log according to your needs, right ?

    Plugin will be part of version 2.0 given that it requires a full refactor.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

29 Nov, 2018 07:29 PM
11 Nov, 2018 07:20 AM
31 Oct, 2018 08:09 AM
28 Oct, 2018 05:43 PM
23 Oct, 2018 02:53 PM