rejetto forum

ban on the run

snoop · 10 · 4684

0 Members and 1 Guest are viewing this topic.

Offline snoop

  • Occasional poster
  • *
    • Posts: 1
    • View Profile
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: 2059
    • View Profile
 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: 842
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
@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)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
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 »


Offline Fysack

  • Tireless poster
  • ****
    • Posts: 598
  • present picture
    • View Profile
    • Admin
hardcore *muselarm*
GOD CAN READ YOUR MIND


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
I can come up with a few things for this.

Open a protected resoce vitural folder that runs the separate program (such as peer guardian or peer blocker)

One macro .exec cmd batch (closes app / pipeline write/ relaunch app)...

-------

The other is create a text box and submit field that runs a macro to ban the IP in the box

Both would take advance macro/html.programong to accomplish.

The best solution I have found is a ddwrt ssh firewall
Using ipta Les to completely remove and reject said IP coming in.
http://rejetto.com/forum/index.php?topic=11405.msg1059288#msg1059288
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline Fysack

  • Tireless poster
  • ****
    • Posts: 598
  • present picture
    • View Profile
    • Admin
yes yes yes. ooooo loooove. reply buton. so, what is the question?

GOD CAN READ YOUR MIND


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
sorry for the late reply.
i can only think of one method at the moment, and it's to use the "-c" parameter to manipulate the "ban-list" entry
http://rejetto.com/wiki/index.php?title=HFS:_Command_line_parameters

this works if you have the "only 1 instance" enabled. Instead of running another hfs, all parameters will be passed to the running one.

this is just to write. Maybe it's possible to have a read/write solution, by having the settings saved to file (menu > save options > to file) that you can read when it changes.

« Last Edit: January 06, 2019, 01:02:27 PM by rejetto »


Offline Warnercag

  • Occasional poster
  • *
    • Posts: 4
    • View Profile
I say we set up a commitee to discuss this.....

But if it is kept, then make sure it's only TM3 members cars. Maybe rename it to the TorontoMazda3 sticker sightings? :
« Last Edit: January 17, 2019, 05:04:44 PM by Mars »


Offline Fysack

  • Tireless poster
  • ****
    • Posts: 598
  • present picture
    • View Profile
    • Admin
impossible, we are toyota landcruiser dudes
GOD CAN READ YOUR MIND