Unverified Commit fe219536 authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #240483 from fabaff/pentestgpt

pentestgpt: init at unstable-2023-06-27
parents cc466d1a 21db11de
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchPypi
, beautifulsoup4
, pythonOlder
}:

buildPythonPackage rec {
  pname = "google";
  version = "3.0.0";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-FDUwEi7lEwUJrV6YnwUS98shiy1O3br7rUD9EOjYzL4=";
  };

  propagatedBuildInputs = [
    beautifulsoup4
  ];

  # Module has no tests
  doCheck = false;

  pythonImportsCheck = [
    "googlesearch"
  ];

  meta = with lib; {
    description = "Python bindings to the Google search engine";
    homepage = "https://pypi.org/project/google/";
    license = with licenses; [ bsd3 ];
    maintainers = with maintainers; [ fab ];
  };
}
+66 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, cryptography
, fetchFromGitHub
, keyring
, pytestCheckHook
, pythonOlder
, pythonRelaxDepsHook
, playwright
, setuptools
, setuptools-scm
}:

buildPythonPackage rec {
  pname = "pycookiecheat";
  version = "0.5.0";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "n8henrie";
    repo = "pycookiecheat";
    rev = "refs/tags/v${version}";
    hash = "sha256-3I7iw/dwF4lRqmVM3OR402InZCFoV9gzKpRQrx4F9KA=";
  };

  pythonRelaxDeps = [
    "cryptography"
    "keyring"
  ];

  nativeBuildInputs = [
    pythonRelaxDepsHook
    setuptools
    setuptools-scm
  ];

  propagatedBuildInputs = [
    cryptography
    keyring
  ];

  nativeCheckInputs = [
    playwright
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "pycookiecheat"
  ];

  disabledTests = [
    # Tests want to use playwright executable
    "test_no_cookies"
    "test_fake_cookie"
  ];

  meta = with lib; {
    description = "Borrow cookies from your browser's authenticated session for use in Python scripts";
    homepage = "https://github.com/n8henrie/pycookiecheat";
    changelog = "https://github.com/n8henrie/pycookiecheat/blob/v${version}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
  };
}
+57 −0
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, python3
}:

python3.pkgs.buildPythonApplication rec {
  pname = "pentestgpt";
  version = "unstable-2023-06-27";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "GreyDGL";
    repo = "PentestGPT";
    rev = "e63a91f466a035e036827e8f492bc47c5c1135af";
    hash = "sha256-m0R/kMmbr5Ixuqvw6ZRoaAGCnI3j86Iwk4+TYqv0WbU=";
  };

  postPatch = ''
    substituteInPlace requirements.txt \
      --replace "playwright==1.28.0" "playwright" \
      --replace "beautifulsoup4~=4.11.2" "" \
      --replace "black" "" \
      --replace "pytest" ""
  '';

  propagatedBuildInputs = with python3.pkgs; [
    beautifulsoup4
    colorama
    google
    langchain
    loguru
    openai
    playwright
    prompt-toolkit
    pycookiecheat
    pyyaml
    requests
    rich
    sqlmap
    tiktoken
  ];

  # Tests require network access
  doCheck = false;

  pythonImportsCheck = [
    "pentestgpt"
  ];

  meta = with lib; {
    description = "GPT-empowered penetration testing tool";
    homepage = "https://github.com/GreyDGL/PentestGPT";
    changelog = "https://github.com/GreyDGL/PentestGPT/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -33861,6 +33861,8 @@ with pkgs;
  pencil = callPackage ../applications/graphics/pencil {
  };
  pentestgpt = callPackage ../tools/security/pentestgpt { };
  perseus = callPackage ../applications/science/math/perseus { };
  petrifoo = callPackage ../applications/audio/petrifoo {
+4 −0
Original line number Diff line number Diff line
@@ -4191,6 +4191,8 @@ self: super: with self; {

  goodwe = callPackage ../development/python-modules/goodwe { };

  google = callPackage ../development/python-modules/google { };

  google-ai-generativelanguage = callPackage ../development/python-modules/google-ai-generativelanguage { };

  google-api-core = callPackage ../development/python-modules/google-api-core { };
@@ -7797,6 +7799,8 @@ self: super: with self; {

  pycontrol4 = callPackage ../development/python-modules/pycontrol4 { };

  pycookiecheat = callPackage ../development/python-modules/pycookiecheat { };

  pycoolmasternet-async = callPackage ../development/python-modules/pycoolmasternet-async { };

  pyfibaro = callPackage ../development/python-modules/pyfibaro { };