Answer the question
In order to leave comments, you need to log in
How to block access from the server?
Good afternoon. There is a server on centos. There is a php script on the server that sends requests to the test.ru domain via curl.
How to prevent the server from going there through iptables or something else?
That is, ideally, block both test.ru, and all possible subdomains, and several IP addresses. The server is working, I'm afraid to climb myself, maybe I've never encountered such tasks.
Answer the question
In order to leave comments, you need to log in
Ok, why do you need this script since it performs unnecessary actions? Just kill it, remove it from startup and remove it to hell.
use iptables, output chain
Something like iptables -I OUTPUT -p tcp --dport 80 -d $TEST_IPADDR -j DROP
But it's better to fix the script, because if it is impossible to establish a connection with the host, the script will start to slow down.
In my opinion, the answer is quite obvious.
you have only two obvious ways (to solve exactly the problem that you described):
either force it to go through a proxy, and already cut the necessary domains in the proxy rules,
or shoot your own legs with different methods from blocking IP addresses where it breaks to breaking off curla.
PS And personally, I would not run any obfuscated shtako on my server :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question