Merge pull request #182814 from sbruder/update-flare-floss
This commit is contained in:
commit
f73e8cc0b1
5 changed files with 1588 additions and 39 deletions
1465
pkgs/development/python-modules/python-flirt/Cargo.lock
generated
Normal file
1465
pkgs/development/python-modules/python-flirt/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
46
pkgs/development/python-modules/python-flirt/default.nix
Normal file
46
pkgs/development/python-modules/python-flirt/default.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{ lib
|
||||||
|
, buildPythonPackage
|
||||||
|
, fetchFromGitHub
|
||||||
|
, rustPlatform
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "python-flirt";
|
||||||
|
version = "0.7.0";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "williballenthin";
|
||||||
|
repo = "lancelot";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "sha256-FsdnWWfyQte7FDz5ldo+S+3IEtbOIODOeh1fHDP2/4s=";
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
cp ${./Cargo.lock} Cargo.lock
|
||||||
|
'';
|
||||||
|
|
||||||
|
format = "pyproject";
|
||||||
|
|
||||||
|
nativeBuildInputs = with rustPlatform; [
|
||||||
|
cargoSetupHook
|
||||||
|
maturinBuildHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildAndTestSubdir = "pyflirt";
|
||||||
|
|
||||||
|
cargoDeps = rustPlatform.importCargoLock {
|
||||||
|
lockFile = ./Cargo.lock;
|
||||||
|
outputHashes = {
|
||||||
|
"zydis-3.1.1" = "sha256-/L28cBTCg/S7onDQXnqUoB5udoEO/depmxDUcnfIQEw=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
pythonImportsCheck = [ "flirt" ];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Python library for parsing, compiling, and matching Fast Library Identification and Recognition Technology (FLIRT) signatures";
|
||||||
|
homepage = "https://github.com/williballenthin/lancelot/tree/master/pyflirt";
|
||||||
|
license = licenses.asl20;
|
||||||
|
maintainers = with maintainers; [ sbruder ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,45 +1,52 @@
|
||||||
{ lib
|
{ lib
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, isPy3k
|
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, funcy
|
, funcy
|
||||||
, pefile
|
|
||||||
, vivisect
|
|
||||||
, intervaltree
|
, intervaltree
|
||||||
, setuptools
|
, pefile
|
||||||
|
, typing-extensions
|
||||||
|
, vivisect
|
||||||
|
, pytest-sugar
|
||||||
|
, pytestCheckHook
|
||||||
|
, python-flirt
|
||||||
}:
|
}:
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "viv-utils";
|
pname = "viv-utils";
|
||||||
version = "0.3.17";
|
version = "0.7.5";
|
||||||
disabled = isPy3k;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "williballenthin";
|
owner = "williballenthin";
|
||||||
repo = "viv-utils";
|
repo = "viv-utils";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "wZWp6PMn1to/jP6lzlY/x0IhS/0w0Ys7AdklNQ+Vmyc=";
|
sha256 = "sha256-JDu+1n1wP2Vsp2V/bKdE+RFp6bE8RNmimi4wdsatwME=";
|
||||||
};
|
};
|
||||||
|
|
||||||
# argparse is provided by Python itself
|
postPatch = ''
|
||||||
preBuild = ''
|
substituteInPlace setup.py \
|
||||||
sed '/"argparse",/d' -i setup.py
|
--replace "==" ">="
|
||||||
'';
|
'';
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
funcy
|
funcy
|
||||||
pefile
|
|
||||||
vivisect
|
|
||||||
intervaltree
|
intervaltree
|
||||||
setuptools
|
pefile
|
||||||
|
typing-extensions
|
||||||
|
vivisect
|
||||||
];
|
];
|
||||||
|
|
||||||
# no tests
|
checkInputs = [
|
||||||
doCheck = false;
|
pytest-sugar
|
||||||
|
pytestCheckHook
|
||||||
pythonImportsCheck = [
|
|
||||||
"viv_utils"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
optional-dependencies = {
|
||||||
|
flirt = [
|
||||||
|
python-flirt
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Utilities for working with vivisect";
|
description = "Utilities for working with vivisect";
|
||||||
homepage = "https://github.com/williballenthin/viv-utils";
|
homepage = "https://github.com/williballenthin/viv-utils";
|
||||||
|
|
|
@ -2,44 +2,73 @@
|
||||||
, python3
|
, python3
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
py = python3.override {
|
||||||
|
packageOverrides = final: prev: {
|
||||||
|
# required for networkx 2.5.1
|
||||||
|
decorator = prev.decorator.overridePythonAttrs (o: o // rec {
|
||||||
|
version = "4.4.2";
|
||||||
|
src = o.src.override {
|
||||||
|
inherit version;
|
||||||
|
sha256 = "sha256-46YvBSAXJEDKDcyCN0kxk4Ljd/N/FAoLme9F/suEv+c=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
python3.pkgs.buildPythonPackage rec {
|
# flare-floss requires this exact version (newer versions are incompatible)
|
||||||
|
networkx = prev.networkx.overridePythonAttrs (o: o // rec {
|
||||||
|
version = "2.5.1";
|
||||||
|
src = o.src.override {
|
||||||
|
inherit version;
|
||||||
|
sha256 = "sha256-EJzVhcrEEpf3EQPDxCrG73N58peI61TLdRvlpmO7I1o=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
py.pkgs.buildPythonPackage rec {
|
||||||
pname = "flare-floss";
|
pname = "flare-floss";
|
||||||
version = "1.7.0";
|
version = "2.0.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "fireeye";
|
owner = "mandiant";
|
||||||
repo = "flare-floss";
|
repo = "flare-floss";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "GMOA1+qM2A/Qw33kOTIINEvjsfqjWQWBXHNemh3IK8w=";
|
fetchSubmodules = true; # for tests
|
||||||
|
sha256 = "sha256-V4OWYcISyRdjf8x93B6h2hJwRgmRmk32hr8TrgRDu8Q=";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = with python3.pkgs; [
|
postPatch = ''
|
||||||
pyyaml
|
substituteInPlace setup.py \
|
||||||
simplejson
|
--replace "==" ">="
|
||||||
|
|
||||||
|
substituteInPlace floss/main.py \
|
||||||
|
--replace 'sigs_path = os.path.join(get_default_root(), "sigs")' 'sigs_path = "'"$out"'/share/flare-floss/sigs"'
|
||||||
|
'';
|
||||||
|
|
||||||
|
propagatedBuildInputs = with py.pkgs; [
|
||||||
|
halo
|
||||||
|
networkx
|
||||||
|
pydantic
|
||||||
tabulate
|
tabulate
|
||||||
vivisect
|
tqdm
|
||||||
plugnplay
|
|
||||||
viv-utils
|
viv-utils
|
||||||
];
|
vivisect
|
||||||
|
] ++ viv-utils.optional-dependencies.flirt;
|
||||||
|
|
||||||
checkInputs = with python3.pkgs; [
|
checkInputs = with py.pkgs; [
|
||||||
|
pytest-sugar
|
||||||
pytestCheckHook
|
pytestCheckHook
|
||||||
|
pyyaml
|
||||||
];
|
];
|
||||||
|
|
||||||
disabledTests = [
|
postInstall = ''
|
||||||
# test data is in a submodule
|
mkdir -p $out/share/flare-floss/
|
||||||
"test_main"
|
cp -r sigs $out/share/flare-floss/
|
||||||
];
|
'';
|
||||||
|
|
||||||
pythonImportsCheck = [
|
|
||||||
"floss"
|
|
||||||
"floss.plugins"
|
|
||||||
];
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Automatically extract obfuscated strings from malware";
|
description = "Automatically extract obfuscated strings from malware";
|
||||||
homepage = "https://github.com/fireeye/flare-floss";
|
homepage = "https://github.com/mandiant/flare-floss";
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
maintainers = teams.determinatesystems.members;
|
maintainers = teams.determinatesystems.members;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6741,6 +6741,8 @@ in {
|
||||||
|
|
||||||
python-ecobee-api = callPackage ../development/python-modules/python-ecobee-api { };
|
python-ecobee-api = callPackage ../development/python-modules/python-ecobee-api { };
|
||||||
|
|
||||||
|
python-flirt = callPackage ../development/python-modules/python-flirt { };
|
||||||
|
|
||||||
python-glanceclient = callPackage ../development/python-modules/python-glanceclient { };
|
python-glanceclient = callPackage ../development/python-modules/python-glanceclient { };
|
||||||
|
|
||||||
python-google-nest = callPackage ../development/python-modules/python-google-nest { };
|
python-google-nest = callPackage ../development/python-modules/python-google-nest { };
|
||||||
|
|
Loading…
Reference in a new issue