spencerdodd / kernelpop

kernel privilege escalation enumeration and exploitation framework
687 stars 130 forks source link

Python3 on redhat/centos distributions #15

Open CaledoniaProject opened 6 years ago

CaledoniaProject commented 6 years ago

Since kernelpop is written with python3, how is it supposed to work on redhat/centos distributions? e.g CentOS 6.3

Looks like py2installer is the only way around?

spencerdodd commented 6 years ago

Hi @CaledoniaProject, I don't have a ton of experience on those distros so wasn't sure there was an issue. In all honesty a pyinstaller .exe is probably a nice idea for increasing portability and cross-compatibility in all use cases, especially older systems or systems that might not have python3.

spencerdodd commented 6 years ago

I'll look into integrating an executable into the project build

CaledoniaProject commented 6 years ago

Thanks!

ralphyz commented 6 years ago

We are primarily using RedHat for the environment we are red teaming - and have not been successful in making this into an EXE using pyinstaller or static-python. However, we get some benefit with using the uname -a part of the script. Note: we did not spend a lot of time attempting to make this into an exe - just saying it was not trivial. If we have a chance, we will circle back to it.

spencerdodd commented 6 years ago

This project hit the backburner for a while. I will start working on an exe and potentially modifying to make it more build-able.

spencerdodd commented 6 years ago

Hey, so I just finished a version-agnostic release that works on both python2 and python3 as of https://github.com/spencerdodd/kernelpop/commit/125be75dfbaeeb3d37f6d3026047f5f87d85a3e0 . Does this fix the RedHat issue, or do you still need an executable? I apologize, I'm not too familiar with the RedHat ecosystem.

spencerdodd commented 6 years ago

I'm working on an executable build as well. It's going to require some project reworking, as I use some weird stuff in the project (dynamic module loading from path specifically) that makes it difficult to package an executable.

It may take a little while to get done, but it is at the top of my list

spencerdodd commented 6 years ago

hey! so I refactored the project and it should build into a binary now. try using the script create_executable.sh in the project. that should build an executable kernelpop in the project root. It relies on pyinstaller and the script attempts to install it. That's probably the main issue you would need to resolve if the script fails, otherwise it has worked on my test systems. Only issue was when I tried to build an executable on an OS that couldn't use pyinstaller.

So this should be resolved as of https://github.com/spencerdodd/kernelpop/commit/e66b59aa455341e1eedd4fd998f583698597e458 !