zRapha / FAME

Framework for Adversarial Malware Evaluation.
Mozilla Public License 2.0
33 stars 9 forks source link

LIEF legacy-install-failure issue #39

Closed Shoot-to-root closed 5 months ago

Shoot-to-root commented 5 months ago

Hi,

I'm trying to install via pip but this error came up (as shown in pic below). image

I tried installing lief separately but another subprocess-exited-with-error and metadata-generation-failed error came up when I run pip install famework. I'm using Python 3.8.9 and the latest pip version. Please help, thanks!

zRapha commented 5 months ago

Hi, thanks for using FAME! Have you tried to run it with an earlier version of pip (such as pip install pip~=23.0)?

Shoot-to-root commented 5 months ago

Yes, I tried it with earlier version, it didn't work so I updated the pip version, but still doesn't work.

zRapha commented 5 months ago

It seems to be a Python issue with more recent versions, have you tried using Python3.7 as pointed out in the requirements? I cannot reproduce the issue when using Python3.7 and pip==24.0.

Shoot-to-root commented 5 months ago

Hi, sorry for the late reply. I managed to test it out today with Python 3.7.17 and pip==24.0, but there's still error. The error seems to be caused by gym:

image

Unrelated to the issue, I'm also curious to how you build back the generated malware sample from extracted features? Or do I misunderstand it, you didn't extract the feature, just inject perturbations into the files? If you can point me to the code that will be awesome, thanks!

zRapha commented 5 months ago

I am not able to test all versions now but I have an env with Python 3.7.15 and pip==22.0.4 and it seems to be installing fine. Have you checked if your pip is calling the proper Python version (in case you have more than one) as in:

python3.7 -m pip install famework

Re the question, the binary features are parsed and then built using the lief library. You can check the building function here.

Shoot-to-root commented 5 months ago

I managed to solve the problem with the help pf stack overflow! Turns out the gym 0.21 installation is broken with more recent versions. Now I can run it, thanks for your help!

However, when I used my malware samples to run, the program dismissed them: Object dismissed: samples/malware_set/. The files are PE32 executables. Are there any specific requirements for the input data? Or could you be so kind and send me the link to the datasets you used?

zRapha commented 5 months ago

Good to hear, WinPEs should work, however that message is raised if the input provided is not a file os.path.isfile(sample)==False

Shoot-to-root commented 5 months ago

I checked the file type, but the error is still raised: image

zRapha commented 5 months ago

I see, however without the binary sample I cannot reproduce any behavior. This seems to be a problem outside of FAME since the operation to check the file type is a regular built-in function. I would proceed to close this request now since the original problem has been solved but feel free to re-open if there are issues related with the installation.