Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOS for Pentesting Overview #81418

Open
JoshuaFern opened this issue Mar 1, 2020 · 100 comments
Open

NixOS for Pentesting Overview #81418

JoshuaFern opened this issue Mar 1, 2020 · 100 comments
Assignees
Labels
0.kind: packaging request Request for a new package to be added 5. scope: tracking Long-lived issue tracking long-term fixes or multiple sub-problems

Comments

@JoshuaFern
Copy link
Member

JoshuaFern commented Mar 1, 2020

NixOS for Pentesting

This represents an effort to bring Security and Forensics software to NixOS, so that it can become a viable alternative to projects like Kali Linux and BlackArch.

Expect updates here to any progress we may be making. Contributions are welcome.

Exploitation
Forensics
Hardware
Information Gathering
Maintaining Access
Passwords
Reporting
Sniffing & Spoofing
Stress Testing
Vulnerability Analysis
Web Applications
Wireless

Also see: Are We Hackers Yet?

Why?

We live in a digital age where high-tech network attacks are rampant, it's critical to regularly scan for vulnerabilities and undergo penetration testing at least once a year to ensure our security practices are working. The only real way to have solid defensive security is to approach it from the mindset of an offensive attacker.

@JoshuaFern JoshuaFern added the 0.kind: packaging request Request for a new package to be added label Mar 1, 2020
@dhess
Copy link
Contributor

dhess commented Mar 2, 2020

radare2 is in nixpkgs.

@7c6f434c
Copy link
Member

7c6f434c commented Mar 2, 2020

dsniff is obsolete in the age of allegedely working switches? I thought overloading a switch still works sometimes…

@dhess
Copy link
Contributor

dhess commented Mar 2, 2020

I tried (unsuccessfully) to upstream libprelude to nixpkgs a few years ago. If anyone wants to try again, there's a working derivation here:

https://github.com/hackworthltd/hacknix/blob/master/pkgs/development/libraries/libprelude/default.nix

I believe that among the objections was the fact that I wasn't handling the Python bindings correctly, so that'll probably need cleaning up.

@Ma27 Ma27 mentioned this issue Mar 7, 2020
10 tasks
@JoshuaFern
Copy link
Member Author

Thanks for your contribution. @Ma27

@makefu
Copy link
Contributor

makefu commented Mar 10, 2020

I packaged dex2jar in for my nur repo ( nix-shell -p pkgs.nur.repos.makefu.dex2jar ) https://github.com/makefu/nur-packages/blob/master/dex2jar/default.nix

There is also drozer ( https://github.com/makefu/nur-packages/blob/master/drozer/default.nix ) and beef ( https://github.com/makefu/nur-packages/tree/master/beef ) however i am unsure how far i went to package these tools and if all functionality is working. They seem to build at least.

maybe we are lucky with other packages in NUR.

@devhell
Copy link
Contributor

devhell commented Mar 11, 2020

You're missing sleuthkit and autopsy in your list. ;-)

However, sleuthkit is in nixpkgs, but autopsy is not.

@JoshuaFern
Copy link
Member Author

It's not a comprehensive list, however I'm happy to add any particular packages people request. If I added absolutely everything to the list it would be well over 2500 items long ;)

I added sleuthkit and autopsy to the list, thanks.

@devhell
Copy link
Contributor

devhell commented Mar 12, 2020

You're absolutely right, but sleuthkit and autopsy are two staple DF tools that shouldn't miss on any list. Thank you for adding them ;)

@deliciouslytyped
Copy link
Contributor

deliciouslytyped commented Apr 5, 2020

enjarify may be more reliable than dex2jar, and bytecode-viewer is a good frontend / is bundled with procyon (and or cfr? I dont remember) which was a pretty good decompiler - or at least I had better luck than with others, even on old code - though FWIW it seems to be just a jar file and runs fine with java -jar

Edit: looks like it defaults to fernflower which is apparrently what intellij idea uses.

@xrelkd
Copy link
Contributor

xrelkd commented Apr 15, 2020

Could we add sn0int into this list?
sn0int is a Information Gathering tool.
The PR #85282 has been created.
Thank you!

@Pamplemousse
Copy link
Member

#67413 is a discussion to get angr on nix.
As of now, it is available as a nur repository .

@Pamplemousse
Copy link
Member

@JoshuaFern
Copy link
Member Author

OP updated, now with expanding categories!

@JoshuaFern
Copy link
Member Author

Thanks @xrelkd
OP updated.

@helinko
Copy link
Contributor

helinko commented May 6, 2020

Zap seems to be broken, I opened a ticket #87106

Also, in the OP Zap should probably be under Web Applications, not Passwords.

@offlinehacker
Copy link
Contributor

I think some packages are not useful to have in nixpkgs, maybe creating pentest overlay would be good, where we can have all different packages.

@Mic92
Copy link
Member

Mic92 commented May 9, 2020

I have frida and keystone in my NUR packages. Keystone is a disassembler required for tools like gef

@JJJollyjim
Copy link
Member

JJJollyjim commented May 20, 2020

I set up a little tool to show which of the Kali packages by category are installable through nix: https://jjjollyjim.github.io/arewehackersyet/index.html

It relies on the mappings being made manually: PR here if you find one that actually is packaged.

You could also import default.nix to install the sets of packages yourself, though not many of them exist yet :)

@makefu makefu mentioned this issue May 20, 2020
10 tasks
@makefu
Copy link
Contributor

makefu commented May 20, 2020

I set up a little tool to show which of the Kali packages by category are installable through nix: https://jjjollyjim.github.io/arewehackersyet/index.html

Great stuff, could you add this issue to the introduction text?

@JJJollyjim
Copy link
Member

good idea, done :)

@AkechiShiro
Copy link
Contributor

Hello all, as I haven't find much time to update and maintain the tracker, there is a new one made by @pyrox0

Here is the link : https://pyrox0.github.io/arewehackersyet/
Repo : https://github.com/pyrox0/arewehackersyet

Feel free to update the link, mentioned here as I will soon archive my project.

@kennystrawnmusic
Copy link

Hello all, as I haven't find much time to update and maintain the tracker, there is a new one made by @pyrox0

Here is the link : https://pyrox0.github.io/arewehackersyet/

Repo : https://github.com/pyrox0/arewehackersyet

Feel free to update the link, mentioned here as I will soon archive my project.

Might want to add ffuf to that tracker because it's definitely in the repo already. I've got it installed myself.

@pyrox0
Copy link
Member

pyrox0 commented Nov 24, 2024

Hello all, as I haven't find much time to update and maintain the tracker, there is a new one made by @pyrox0
Here is the link : pyrox0.github.io/arewehackersyet
Repo : pyrox0/arewehackersyet
Feel free to update the link, mentioned here as I will soon archive my project.

Might want to add ffuf to that tracker because it's definitely in the repo already. I've got it installed myself.

ffuf doesn't appear in the kali packages list that use in the tracker, therefore it's not included. The tracker specifically looks at all the kali linux metapackages that can be used to install groups of tools, and none beyond that(though that's something to look more into at some point)

@kennystrawnmusic
Copy link

Also see #352041 — we definitely need some more tooling related to this.

@pyrox0
Copy link
Member

pyrox0 commented Nov 25, 2024

Parrot is absolutely not more common than Kali. If you would like to make a similar tracker for Parrot packages(or adapt the one linked above for Parrot), you're welcome to, but considering Kali is practically an industry standard(pretty much every guide I've ever seen uses Kali, my university only uses Kali, etc), I don't see it as being as valuable as having the Kali tracker. Same situation with BlackArch, it's just way more niche and way less used. Also, I'd assume the package sets 95% overlap between kali and blackarch/parrot.

@kennystrawnmusic
Copy link

kennystrawnmusic commented Dec 1, 2024

I'd assume the package sets 95% overlap between kali and blackarch/parrot.

Parrot and BlackArch both have ffuf in their repositories, which is why I mentioned it. Also, you're wrong about Kali not having it in theirs. The complete overlooking of tools like ffuf along with Evil-WinRM (which is in the Kali repos too by the way despite not showing up on this tracker) and others leads me to believe that this is based on an outdated Kali tooling list from years ago that hasn't been updated to get with the times.

Also need to see Havoc on this tracker so I can close #352041, speaking of getting with the times.

@pyrox0
Copy link
Member

pyrox0 commented Dec 1, 2024

and others leads me to believe that this is based on an outdated Kali tooling list from years ago that hasn't been updated to get with the times.

As I mentioned, this is based on the Kali Metapackages, which do not have every single package. They only track ones that are installed by those metapackages. If you would like to contribute to the tracker the time and effort to track every single kali package that isn't in those metapackages, you're welcome to, but I do not have the time or energy to do so.

Also, if you had seen the repo, you'd see that I've updated the kali packages list a week ago, and the lack of updates was why I adopted the tracker in the first place. Feel free to ask kali to add more packages to those metapackages, though!

@ca5ua1
Copy link

ca5ua1 commented Dec 2, 2024

Btw, for some reason we missing xsser from 24.11 and unstable channels (in 24.05 exists)
As said in 8b0e9ce

xsser has been removed because it was unmaintained and relies on a archived project

But it still tool which people use, right? Am I missing something?

@kennystrawnmusic
Copy link

kennystrawnmusic commented Dec 2, 2024

Btw, for some reason we missing xsser from 24.11 and unstable channels (in 24.05 exists)

As said in 8b0e9ce

xsser has been removed because it was unmaintained and relies on a archived project

But it still tool which people use, right? Am I missing something?

It's still available as python311Packages.xsser in unstable from my understanding. Just not in the latest Python version.

There are alternatives like XSStrike (used by Hack the Box Academy in the CPTS XSS module) and PwnXSS (used by EC-Council in CEHv12 Module 14) that aren't in the repositories at all and need to be. I happen to have the following custom package for PwnXSS already working on my end (as an embedded call to mkDerivation in my configuration.nix, alongside CUPP which is also absolutely necessary despite not being in the nixpkgs repository), so supporting PwnXSS should be as easy as copying and pasting this into the tree:

{
  pkgs ? import <nixpkgs> {},
  stdenv ? pkgs.stdenv,
  ...
}:
stdenv.mkDerivation rec {
  pname = "pwnxss";
  version = "0.5.0";

  format = "pyproject";

  src = builtins.fetchGit {
    url = "https://github.com/Pwn0Sec/PwnXSS";
    ref = "master";
  };

  propagatedBuildInputs = with pkgs; [
    (python3.withPackages(pypkgs: [
      pypkgs.wrapPython
      pypkgs.beautifulsoup4
      pypkgs.requests
    ]))
  ];

  buildInputs = propagatedBuildInputs;
  nativeBuildInputs = propagatedBuildInputs;

  pythonPath = with pkgs.python3Packages; [ beautifulsoup4 requests ];

  pwnxssExecutable = placeholder "out" + "/bin/pwnxss";

  installPhase = ''
    # Base directories
    install -dm755 $out/share/pwnxss
    install -dm755 $out/bin
    # Copy files
    cp -a --no-preserve=ownership * "$out/share/pwnxss"
    # Use wrapper script to allow execution from anywhere
    cat > $out/bin/pwnxss << EOF
    #!${pkgs.bash}/bin/bash
    cd $out/share/pwnxss
    python pwnxss.py \$@
    EOF
    chmod a+x $out/bin/pwnxss
  '';
}

On the bright side: at least MITRE uses nix-shell for eCTF…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: packaging request Request for a new package to be added 5. scope: tracking Long-lived issue tracking long-term fixes or multiple sub-problems
Projects
None yet
Development

No branches or pull requests