rsmusllp / king-phisher

Phishing Campaign Toolkit
BSD 3-Clause "New" or "Revised" License
2.29k stars 544 forks source link

tools/install.sh fails on install of matplotlib from requirements.txt on Digital Ocean droplet #79

Closed piratica closed 8 years ago

piratica commented 8 years ago

Issue Description

Attempting to setup a Digital Ocean droplet to test a site. Tried via PTF and then directly but failed each time at matplotlib. This seems to be specific to Digital Ocean droplets but seems to be distro independent.

Reproduction Steps

Initially used PTF for the install but it failed. Went directly into /pentest/exploitation/king-phisher and attempted to run tools/install.sh but failed again at the same spot. Noted that pip had been installing matplotlib and had gotten to 99% and then bombed (I was too lazy to take them down but it was consistent across Ubuntu, Debian and Fedora droplets).

Work Around so far

zeroSteiner commented 8 years ago

For Digital Ocean, the $20/month droplet needs to be used to have the 2GB of RAM in order to compile matplotlib. I ran into this error myself two weeks ago. You can temporarily either:

When going through the install you'll notice an out of memory error as it's trying to decode some data.

piratica commented 8 years ago

Very cool, thank you for the quick response on this. I'll give that a shot and follow-up here but it seems like this is a non-issue.

piratica commented 8 years ago

Ok, just spun up one of the $20 per month droplets and did the following:

zeroSteiner commented 8 years ago

It's complaining that freetype can't be built. If you're on Ubuntu, I think I remember there being an error with the freetype header not being in the correct location. Try running sudo ln -s /usr/include/freetype2/ft2build.h /usr/include/ft2build.h first.

piratica commented 8 years ago

Ok, so down the rabbit hole.

zeroSteiner commented 8 years ago

@wolfthefallen is working on a work around for the freetype issue. The necessary postgresql-server-dev packages should be installed automatically though. What flavor of Linux are you getting that error on?

piratica commented 8 years ago

This one is an Ubuntu droplet at Digital Ocean, a completely vanilla install. It's a burner so, if you want to poke around on it let me know. We'll need to find a way to pass credentials (public key?) but I'm happy to let you log on and poke around if it would help.

zeroSteiner commented 8 years ago

@piratica we were able to reproduce the fix the freetype build issue. Turns out that running apt-get update prior to installing any packages results in the freetype header being placed in the location where the install script expects it to be. This was patched in #80 which has been pushed up to the dev branch and will make its way to master in the next release.

Are there any outstanding issues left? I believe we've figured out both the memory requirements and addressed the freetype build error now.

piratica commented 8 years ago

Just tried again (git clone from the dev branch on this one) on a fresh droplet and got the same freetype error again. It seems to work everywhere except Digital Ocean and I've got a workaround that seems to be working well.
Also, apologies on the delayed response on this.

wolfthefallen commented 8 years ago

@piratica Thank you for trying out the fix in the dev branch. I'm having issues reproducing it with the new change, If you can please put the out put of the install script into a file or paste bin so I can review it that would be a great help. Also please let me know what Digital Ocean (DO) image and size you are using.

tools/install.sh > install_output.txt

I have a feeling the libfreetype is failing to install via apt-get, and since the install.sh script is not set to exit on failure their it is making it to pip install and failing there as the package is not in the correct place.

piratica commented 8 years ago

Resetting and trying again. Below is a play by play. The droplet is one of the $5 per month droplets with Ubuntu 14.04 64bit that's been resized to include 2GB RAM. This is a burner so all commands are running as root (yes, bad plan but the box has a maximum lifespan of about 24 hours).

piratica commented 8 years ago

Ok, repeated above noted process, walked away (as to prevent any unwelcome tinkering) and, when I returned, I saw the following:

Starting the King Phisher service
king-phisher start/running, process 26053

I've attached the install_output.txt in case there's any value there but this time it seems to have worked like a charm. I'll poke around with it a bit and let you know if I am able to break anything else :) install_output.txt

zeroSteiner commented 8 years ago

That's very odd, I do know the install script can be picky when run from another branch. I did see the message stating it was updating the apt-get cache implying that it had @wolfthefallen's changes. Very odd that it didn't work the previous time. We haven't made any changes since then.

zeroSteiner commented 8 years ago

We released version 1.2.0 last Friday so those changes to the install script have been merged into master. @piratica are you still experiencing issues or can this ticket be closed?

zeroSteiner commented 8 years ago

I'm going to close this ticket out as I'm not aware of any additional issues that need to be addressed at this time. If you think of something else that's related you can comment on this thread or else open a new ticket. Thanks!