mandiant / flare-fakenet-ng

FakeNet-NG - Next Generation Dynamic Network Analysis Tool
Apache License 2.0
1.73k stars 357 forks source link

Look for configuration files in the binary location (vs the current directory) #180

Open Ana06 opened 2 months ago

Ana06 commented 2 months ago

The fakenet.exe binary looks for the config files/folders in the current directory (the location from which is executed). This breaks the executable if executed from a location that is not where the binary resides in memory:

C:\Users\flare\Desktop > C:\Tools\fakenet\fakenet3.2-alpha\fakenet.exe

  ______      _  ________ _   _ ______ _______     _   _  _____
 |  ____/\   | |/ /  ____| \ | |  ____|__   __|   | \ | |/ ____|
 | |__ /  \  | ' /| |__  |  \| | |__     | |______|  \| | |  __
 |  __/ /\ \ |  < |  __| | . ` |  __|    | |______| . ` | | |_ |
 | | / ____ \| . \| |____| |\  | |____   | |      | |\  | |__| |
 |_|/_/    \_\_|\_\______|_| \_|______|  |_|      |_| \_|\_____|

                        Version 3.2
  _____________________________________________________________
                   Developed by FLARE Team
    Copyright (C) 2016-2024 Mandiant, Inc. All rights reserved.
  _____________________________________________________________

04/12/24 02:26:37 PM [           FakeNet] Could not open configuration file C:\Users\flare\Desktop\configs\default.ini

Would it be possible to change it to look for the config files in the location of the binary? It would make it nicer for user to use fakenet and also simplify FLARE-VM installation code as this is not standard case and we can't use the helper functions we use to install most tools.

Ana06 commented 2 months ago

Reference: https://github.com/Ana06/VM-Packages/blob/9cfbd4df539686aea455919dcbf9645341209b01/packages/fakenet-ng.vm/tools/chocolateyinstall.ps1#L6