Wednesday, May 24, 2017

Linux: Force Close A Socket / Port On Server In a TIME_WAIT State

Finding out current TIME_WAIT settings

Type the following command$ cat /proc/sys/net/ipv4/tcp_fin_timeout
Sample outputs:
60
You can lower the value by typing the following command as root user:# echo 20 > /proc/sys/net/ipv4/tcp_fin_timeout
To set /proc/sys/net/ipv4/tcp_fin_timeout to 20 permanently, edit the file /etc/sysctl.conf and set it as follows:
net.ipv4.tcp_fin_timeout=20

Restating the network service

To restart the network service under RHEL / CentOS based systems, enter:# service network restart
OR
# /etc/init.d/network restart
Ubuntu / Debian Linux, user try the following command:
sudo service networking restart
OR
sudo /etc/init.d/networking restart

cutter command

Cutter is an open source program that allows Linux firewall administrators to abort TCP/IP connections routed over the firewall or router on which it is run.

EXAMPLES

To cut all connections from 192.168.1.10 to server, enter:# cutter 192.168.1.10
To cut all ssh connection from 192.168.1.1 to server, type:
# cutter 192.168.1.1 22
To cut all http connection from 192.168.1.5 to ssh server 202.54.1.20, run:
# cutter 202.54.1.20 192.168.1.5 80
See how to install and use the cutter command for more information here.

No comments:

Sabotage RFID NFC machinery

  https://www.grandslipring.com/inductive-coupling/ https://physics.stackexchange.com/questions/17200/can-magnetic-fields-be-redirected-and-...