Advertisement
hjysy

how to block redirect to other site from iptables?

Sep 20th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. how to block redirect to other site from iptables?
  2. I would like to know how can I block redirect to any http:// using ip tables. So that user on my website don't redirect to any other website even I place code in my page.
  3. Will this work?
  4. ++++++++++++++
  5. If You want to buy cheap web hosting then visit http://Listfreetop.pw and select the cheapest hosting. it can be suitable for all your needs.
  6.  
  7. Top 200 best traffic exchange sites http://Listfreetop.pw/surf
  8.  
  9. list of top gpt sites
  10. list of top ptc sites
  11. list of top ptp sites
  12. list of top crypto currency Wallets sites
  13. Listfreetop.pw
  14. Listfreetop.pw
  15. Listfreetop.pw
  16. +++++++++++++++
  17. iptables -A OUTPUT -p tcp -m string --string "http://" --algo kmp -j REJECT --reject-with tcp-reset
  18.  
  19. Kindly let me know.
  20.  
  21. Do you want to prevent users from visiting any HTTP link on your site? I am not sure what you mean by the redirect. Are you referring to .htaccess redirection?
  22.  
  23. Do you want to prevent users from visiting any HTTP link on your site? I am not sure what you mean by the redirect. Are you referring to .htaccess redirection?
  24. Thank you for reply. I am in a situation where a hacker using chrome dev tool to redirect my php page and when I visit that page it redirect me to his website. There is no such redirect in my php page but he is doing it from external chrome dev tool and redirecting is only happening from chrome browser. I can not block chrome browser agent.
  25.  
  26. So I was thinking if there is any way I can prevent that from happening by iptables like blocking outgoing traffic from that page to his website as long as browser is open? or any suggestion will be very helpful.
  27. Market Research
  28.  
  29. It can probably be implemented through SELinux, but it is going to take a lot of effort.
  30.  
  31. I can not think of any way to achieve this using iptables though because there is no new TCP/UDP connection during the redirection as per my understanding of the issue. I am not sure if it can be classified as outgoing traffic. You can block ports 80 and 443 for outward connections though.
  32.  
  33. It can probably be implemented through SELinux, but it is going to take a lot of effort.
  34.  
  35. I can not think of any way to achieve this using iptables though because there is no new TCP/UDP connection during the redirection as per my understanding of the issue. I am not sure if it can be classified as outgoing traffic. You can block ports 80 and 443 for outward connections though.
  36. block port 80 will block my site too.
  37. Market Research
  38.  
  39. It won't block. Your web server listens to incoming connections to serve websites, not outward connections.
  40. Could you please let me know the iptable for that
  41.  
  42. iptables -A OUTPUT -p tcp -m string --string "80" --algo kmp -j REJECT --reject-with tcp-reset
  43. ?
  44.  
  45. Will this work?
  46. Market Research
  47.  
  48. Thank you for reply. I am in a situation where a hacker using chrome dev tool to redirect my php page and when I visit that page it redirect me to his website. There is no such redirect in my php page but he is doing it from external chrome dev tool and redirecting is only happening from chrome browser. I can not block chrome browser agent.
  49.  
  50. So I was thinking if there is any way I can prevent that from happening by iptables like blocking outgoing traffic from that page to his website as long as browser is open? or any suggestion will be very helpful.
  51. You're tackling this problem the wrong way. If someone is able to perform a redirect on your page either:
  52.  
  53. A) Backend is compromised
  54. B) You have an XSS exploit on your page
  55. C) Your browser is compromised
  56.  
  57. None of these are solved by firewall rules. You should find the source of the problem instead and fix that instead.
  58. Afterburst - The best unmetered VPS
  59.  
  60. ehosting
  61. trafficjenie.info
  62. hosting dude
  63. z hostel irkutsk
  64. cryptocoins.neocities.org
  65. host vip
  66. make money in rdr2 online
  67. t hostel
  68. domain 2 and 3
  69. 3 hostages north korea
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement