init
This commit is contained in:
commit
0d777da073
5 changed files with 172 additions and 0 deletions
2
default.nix
Normal file
2
default.nix
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
pkgs.callPackage ./derivation.nix {}
|
84
derivation.nix
Normal file
84
derivation.nix
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
{ pkgs,
|
||||||
|
fetchFromGitHub,
|
||||||
|
fetchurl,
|
||||||
|
writeScript,
|
||||||
|
python3Packages,
|
||||||
|
stdenv,
|
||||||
|
stdenvNoCC,
|
||||||
|
}: let
|
||||||
|
src = stdenvNoCC.mkDerivation {
|
||||||
|
pname = "pppwn-python";
|
||||||
|
version = "1.0";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "TheOfficialFloW";
|
||||||
|
repo = "PPPwn";
|
||||||
|
rev = "fb4ab5ffa97e083775ccad3a95e2348fc6b53e1c";
|
||||||
|
hash = "sha256-jSxF8Ara5Iu26X9k89bpB/5ogUwgXreJueDGuLIlbgo=";
|
||||||
|
};
|
||||||
|
setup = ./setup.py;
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r $src/* $out/.
|
||||||
|
cp $setup $out/setup.py
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
python = with python3Packages;
|
||||||
|
buildPythonApplication {
|
||||||
|
pname = "pppwn-python";
|
||||||
|
version = "1.0";
|
||||||
|
|
||||||
|
propagatedBuildInputs = [scapy];
|
||||||
|
|
||||||
|
inherit src;
|
||||||
|
# buildPhase = "ls -l $src";
|
||||||
|
};
|
||||||
|
goldhen = fetchurl {
|
||||||
|
url = "https://github.com/GoldHEN/GoldHEN/releases/download/2.4b18/GoldHEN_v2.4b18.7z";
|
||||||
|
hash = "sha256-0MhMefZd9a/HmgDFePM6sapwrrnCBfHniYldx9T8o40=";
|
||||||
|
};
|
||||||
|
exploits = stdenv.mkDerivation {
|
||||||
|
pname = "pppwn-exploits";
|
||||||
|
version = "1.0";
|
||||||
|
inherit src goldhen;
|
||||||
|
nativeBuildInputs = with pkgs; [p7zip];
|
||||||
|
freebsd = fetchFromGitHub {
|
||||||
|
owner = "OpenOrbis";
|
||||||
|
repo = "freebsd-headers";
|
||||||
|
rev = "master";
|
||||||
|
hash = "sha256-a92e9vZIuPCH4DbnPGdYg/flwVZPvhKdIrbff7cZA1U=";
|
||||||
|
};
|
||||||
|
buildPhase = ''
|
||||||
|
cp -r $src/* .
|
||||||
|
cp -r $freebsd/* freebsd-headers
|
||||||
|
ls -l
|
||||||
|
ls -l freebsd-headers
|
||||||
|
make -C stage1 FW=960 clean && make -C stage1 FW=960
|
||||||
|
make -C stage2 FW=960 clean && make -C stage2 FW=960
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
7z x -y $goldhen
|
||||||
|
7z x -y pppnw_stage2/stage2_v1.03.7z
|
||||||
|
mkdir -p $out/stage2
|
||||||
|
cp -r stage1 $out
|
||||||
|
cp -r stage2_9.60.bin $out/stage2/stage2.bin
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in stdenv.mkDerivation {
|
||||||
|
pname = "pppwn";
|
||||||
|
version = "1.0";
|
||||||
|
inherit src python;
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp $python/bin/pppwn.py $out/bin/.
|
||||||
|
cp $src/offsets.py $out/bin/.
|
||||||
|
cat << EOF >> $out/bin/pppwn
|
||||||
|
#!${pkgs.bash}/bin/bash
|
||||||
|
$out/bin/pppwn.py \
|
||||||
|
--stage1=${exploits}/stage1/stage1.bin \
|
||||||
|
--stage2=${exploits}/stage2/stage2.bin \
|
||||||
|
--fw=960 \
|
||||||
|
"\$@"
|
||||||
|
EOF
|
||||||
|
chmod +x $out/bin/pppwn
|
||||||
|
'';
|
||||||
|
}
|
60
flake.lock
generated
Normal file
60
flake.lock
generated
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1726560853,
|
||||||
|
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1730129772,
|
||||||
|
"narHash": "sha256-/GVE8ugT5SWBbmOqaTjG3685Z6jCQVALkrIKqxZbIlI=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "800ffc56a2db95c9fb24c4a75be9803e9f8d8465",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
15
flake.nix
Normal file
15
flake.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in {
|
||||||
|
packages.default = import ./default.nix { inherit pkgs; };
|
||||||
|
# packages.default = pkgs.writeShellScriptBin "pppwn"
|
||||||
|
# "${self.packages.${system}.pppwn}/bin/pppwn.py \"$@\"";
|
||||||
|
});
|
||||||
|
}
|
11
setup.py
Normal file
11
setup.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
setup(name='pppwn',
|
||||||
|
version='1.0',
|
||||||
|
# Modules to import from other scripts:
|
||||||
|
packages=find_packages(),
|
||||||
|
# Executables
|
||||||
|
scripts=["pppwn.py", "offsets.py"],
|
||||||
|
)
|
Loading…
Add table
Reference in a new issue