Author Topic: ban on the run  (Read 53 times)

0 Members and 1 Guest are viewing this topic.

Offline snoop

  • Occasional poster
  • *
  • Posts: 1
    • View Profile
ban on the run
« on: December 07, 2018, 11:55:57 PM »
hello! How can I ban IP not directly from HFS? I need to do it using my own program.
I see HFS settings are saved in ini or in registry
So I can modify them using my own tools. But HFS wont reload it in runtime. So how can I solve this problem?
Maybe somehow send a command to HFS to add a ban?

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1863
    • View Profile
Re: ban on the run
« Reply #1 on: December 09, 2018, 01:36:07 AM »
 Start HFS
In Menu/Limits/Bans…, enter the ip you will to be banned  example “192.168.1.10” without the quotation marks and yoy can check “Disconnect with no reply”

Apply + OK --> that's all!  ;)

Offline LeoNeeson

  • Tireless poster
  • ****
  • Posts: 514
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: ban on the run
« Reply #2 on: December 10, 2018, 07:26:20 AM »
@Snoop: Welcome to the forum. It's not totally clear how you want to "send a command to HFS to add a ban" using your own program. May I ask you what type of program you want to use?. If you add more details it would be easier to help you. If you need to issue a ban from an external connection (because you are not sitting behind the HFS server), perhaps using some HFS's macro you could do the same and much easier. Please add more details.

@Mars: If I'm not mistaken, this user wants to 'add a ban' using an external program (or from an external connection). But if he externally edits the .ini settings file, HFS won't read those configurations until HFS is restarted. He needs a 'live' way to issue a ban from an external program (and not using HFS's menu option). OR perhaps he wants to issue a ban from an external connection, and using a macro this could be more easier to achieve (it would require an admin login that executes a macro that adds to HFS the IP to be banned).
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
• I'm open to help and share any file you may need (just ask me) ;)

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1863
    • View Profile
Re: ban on the run
« Reply #3 on: December 10, 2018, 09:02:39 AM »
if it is necessary to send the addition of a ban ip remotely, it must be sended a form to an hfs script that will support the addition of the value using the macro {.set ini | .} but it is delicate from a safe point of view

you must retrieve the set using {.get ini | ban-list.}
but the data in return are in the form
192.168.1.1#banned|193.169.10.2#not allowed|255.3.45.36 # NO!|

including pipes and making the management pretty tricky because of the macros.

it is probably necessary to use these macros, but I do not know the exact effects in the handling of text strings

     'no pipe'        replace '|'  by '{:|:}'
     'no pipe'        replace '{:|:}'  by '|'

the fields must be separated and then reassembled to be fed back into the configuration, which will have to be saved automatically at the output or at regular intervals or in force by means of a macro.
everything that includes remote hfs configuration management is a risk for hacking, especially when the exchanges are not done in SSL

it must be remembered that mishandling or erroneous data may create a ban rendering hfs unreachable

I do not know if there is an equivalent in English but as we say in France, "the game is not worth the candle"
« Last Edit: December 10, 2018, 09:08:27 AM by Mars »