rejetto forum

Blocking connections to the server if they use IP instead of the FQDN

0 Members and 1 Guest are viewing this topic.

Offline TheKezStrel

  • Occasional poster
  • *
    • Posts: 1
    • View Profile
Hi all,

Just a random question to all you guys here on the forum about HFS2.3m.

From running my HFS server for quite a few years and using different versions of HFS, I keep seeing a lot of hacking attempts in my logs that have always connected via the IP (hackers that scanned open ports and ) and not many using the domain name I have set up.

I'm unable to filter out the bad traffic at present since the FQDN for my location uses the same  WAN IP scanned to send the traffic through my router to the server network, then to the server on my local network. I.e. DNS for my FQDN is forwarded to my WanIP router > port forward to LanIP where the server resides.

When looking at the logs, there's lots of hacking attempts from people using the IP only based on the GET header HOST detail. I try it from my mobile using my FQDN (like www . mysitedomanname . com  WITHOUT SPACES) and the HOST detail in the GET header shows my domain name.

Is there any way of using the HOST detail in the GET Header to filter out connections?

On the forum I have found something like this line.

I found
{.if|{.%host ==}|redirect to a specific folder.}
and wondered if it could be modified to only accept connections if the HOST field matched my FQDN like
{.if|{.%host ==}|allow connection|disconnect.}

Also, which file I would need to add the line to?

Any and all help would be appreciated.

Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 851
  • Status: On hiatus (sporadically here)
    • View Profile
Hi!, and welcome to the forum... :)

Yes, this is possible to do (the very same question was answered a few days ago). You can follow the steps described HERE (replacing "" with your own ""). For future reference to other users, please report back which option worked better (#1, #2 or #3).

HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.