2

I saw many webhosting companies are changing WHM Port and limiting it's access with the browser user-agent to be only accesses by a specific user-agent.

They are using User Agent switcher addon via Firefox and type this specific user-agent to access WHM.

How can i do this .?

1

2 Answers 2

0

I am not 100% sure about changing the port. It might best to use port-redirection (i.e. forward 0.0.0.0:1234 to localhost:2087 and drop all packets from the outside net to ports 2086/7).

To achieve the UA protection of your WHM, I would use the string matching in IPTables Here's it in use (for a different purpose): http://spamcleaner.org/en/misc/w00tw00t.html

I would set a deny by default rule, then allow anyone who has the string with the User-Agent that you require. While IP tables will match the entire packet (i.e. it won't specifically look at the User-Agent field of the request), if you make the string specific enough, this should not be a problem.

1

Limiting access based on user-Agent is not reliable at all. This is simply because anyone can set the user-agent to anything. There is also a firefox addon that enables you to type whatever you want to be sent as user-agent in your requests.

7
  • While this might be true, it doesn't answer the original question. Better to explain how to achieve it and also why it's not useful in the long term, than just provide an answer saying don't do this? Jun 6, 2012 at 10:33
  • @EightBitTony: Saying don't do this will be good if the OP is asking for something unreliable or risky.
    – Khaled
    Jun 6, 2012 at 10:39
  • @Khaled Merci, Do you have an idea for how to do it ? Jun 6, 2012 at 10:40
  • @EightBitTony Do you have an idea for how to do this ? Jun 6, 2012 at 10:41
  • I disagree - the UA protection is a nice way to prevent randomised brute-force attacks. I am assuming that the server admin will define a special (fictional) UA and only if they get a matching one, provide them with a login screen. Since this will only add a layer of security, it can't be a bad thing.
    – Jay
    Jun 11, 2012 at 19:12

Not the answer you're looking for? Browse other questions tagged .