ban ip in router by iptables
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");
?>
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
Support Staff 1 Posted by potsky on 04 Nov, 2014 09:35 AM
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.