nixpkgs/pkgs/by-name/so/social-engineer-toolkit/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

71 lines
2.0 KiB
Nix

{ lib, fetchFromGitHub, python3Packages, makeWrapper, metasploit }:
python3Packages.buildPythonApplication rec {
pname = "social-engineer-toolkit";
version = "8.0.3";
format = "other";
src = fetchFromGitHub {
owner = "trustedsec";
repo = pname;
rev = version;
sha256 = "ePbmUvnzLO0Wfuhym3bNSPV1x8rcCPqKMeWSRcbJGAo=";
};
postPatch = ''
substituteInPlace setoolkit \
--replace "src/core/config.baseline" "$out/share/social-engineer-toolkit/src/core/config.baseline"
substituteInPlace src/core/setcore.py \
--replace '"src/core/set.version"' "\"$out/share/social-engineer-toolkit/src/core/set.version\"" \
--replace "/opt/metasploit-framework" "${metasploit}/bin"
'';
nativeBuildInputs = [
makeWrapper
];
propagatedBuildInputs = with python3Packages; [
pexpect
pycrypto
requests
pyopenssl
pefile
impacket
qrcode
pillow
# Has been abandoned upstream. Features using this library are broken
# pymssql
];
installPhase = ''
runHook preInstall
install -Dt $out/bin setoolkit seautomate seproxy
mkdir -p $out/share/social-engineer-toolkit
cp -r modules readme src $out/share/social-engineer-toolkit/
runHook postInstall
'';
makeWrapperArgs = [
"--chdir ${placeholder "out"}/share/social-engineer-toolkit"
"--prefix PYTHONPATH : \"${placeholder "out"}/share/social-engineer-toolkit\""
];
# Project has no tests
doCheck = false;
meta = with lib; {
description = "Open-source penetration testing framework designed for social engineering";
longDescription = ''
The Social-Engineer Toolkit is an open-source penetration testing framework
designed for social engineering. SET has a number of custom attack vectors
that allow you to make a believable attack quickly.
'';
homepage = "https://github.com/trustedsec/social-engineer-toolkit";
mainProgram = "setoolkit";
license = licenses.bsd3;
maintainers = with maintainers; [ emilytrau ];
};
}