0

I do have a WebServer running on my VPS. I want to disable one link in Ubuntu. // By saying disable I mean refusing to surfing on that URL

Example; I do have this link: http://SERVER_IP:PORT/#/, I want to enable this link. But I want to disable this link: http://SERVER_IP:PORT/api/. How can I do it?

I tried;

iptables -A INPUT -m string --string "http://SERVER_IP:PORT/api/" --algo kmp --to 65535 -j DROP
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "http://SERVER_IP:PORT/api/" --algo kmp -j DROP
iptables -A INPUT -s http://SERVER_IP:PORT/api/ -j DROP
iptables -I INPUT 1 -p tcp --dport PORT -m string --string "http://SERVER_IP:PORT/api/" --algo kmp -j DROP
Eyüp
  • 11
  • 3
  • that would depend very much on the individual web server and the application you're running. You can probably configure the server to reply with 404 when a user tries to access that page – Esther Jul 26 '22 at 13:37
  • The problem is, I can't. The WebServer is compeletly build special for a BOT. So, there isn't any configuration file that I can edit. And this bot has some exploits, I need to block `http://SERVER_IP:PORT/api/` URL for exploits. Maybe we can do it with an iptables? – Eyüp Jul 26 '22 at 13:39
  • Does this answer your question? [using ufw to block outgoing traffic to website](https://askubuntu.com/questions/532305/using-ufw-to-block-outgoing-traffic-to-website) – graham Jul 26 '22 at 14:10
  • @24601 No, It doesn't answer my question. – Eyüp Jul 26 '22 at 14:22
  • [edit] your question with the reasons why not and what you have already tried. – graham Jul 26 '22 at 15:29
  • @24601 I edited my question. – Eyüp Jul 26 '22 at 15:44

0 Answers0