secgroundzero / warberry

WarBerryPi - Tactical Exploitation
2.22k stars 288 forks source link

Automatic installer proposal. #16

Closed ghost closed 8 years ago

ghost commented 8 years ago

This is my automatic install script proposal.

secgroundzero commented 8 years ago

i like it. i just removed the part where the hostname is changed. i want to keep that optional. also removed the update and upgrade part as that should be optional as well.

i will add this pip install ipaddress which is missing

ghost commented 8 years ago

Delete line with upgrade is ok, but script should update repo data before installing deb packages. Without update some packages might come with old versions.

secgroundzero commented 8 years ago

i assume this is also incorrect Run warberry.py via /opt/warberry/python warberry.py as the warberry.py is not installed in that directory

secgroundzero commented 8 years ago

and why is virtualenv required?

ghost commented 8 years ago

/opt/warberry/python ~/WarBerry/warberry/warberry.py this is the correct path.

/opt/warberry/python warberry.py is only when you use script inside /warberry dir.

virturalenv? For not messing with sudo and global python path packages. Of course you can omit it and install packages with sudo pip install [packages] without virtualenv line.

Idea: add ln -s for ~/WarBerry/warberry/warberry.py to /usr/local/bin/warberry. Or just make script:

#warberry.sh
#!/bin/bash

/opt/warberry/python /home/pi/WarBerry/warberry/warberry.py

and ln -s it to /usr/local/bin as warberry.

It will help with running warberry script without convering to standard python package.


EDIT: Added proposed changes and runner script.

secgroundzero commented 8 years ago

please see my proposition below

!/usr/bin/env bash

WarBerry bootstrap script

APT_GET_CMD=$(which apt-get) WARBERRYDIR=/home/pi/WarBerry VENVDIR=/opt/warberry GITREPOS=("https://github.com/DanMcInerney/net-creds.git" "https://github.com/stasinopoulos/commix.git" "https://github.com/sqlmapproject/sqlmap.git" "https://github.com/CoreSecurity/impacket.git" "https://github.com/samratashok/nishang.git" "https://github.com/SpiderLabs/Responder.git" "https://github.com/sophron/wifiphisher.git" "https://github.com/Dionach/CMSmap.git" "https://github.com/PowerShellMafia/PowerSploit.git" "https://github.com/offensive-security/exploit-database.git")

echo """

    STARTING WarBerry INSTALLATION SCRIPT...

"""

if [ "$(id -u)" != "0" ]; then echo "ERROR: Sorry, you are not root. Run this script as root or with sudo." exit 1 fi

echo "CREATING DIRECTORIES..." mkdir -p $WARBERRYDIR/{Results,Tools}

if [[ ! -z $APT_GET_CMD ]]; then echo """ PERFORMING BASIC DEPENDENCIES INSTALLATION... """ apt-get -y update; apt-get -y install nbtscan \ curl \ tcpdump \ nmap \ ppp \ sg3-utils \ netdiscover \ macchanger \ onesixtyone \ nikto \ hydra \ john \ w3af-console \ python-dev \ python-pip \ cryptcat \ ike-scan \ libssl-dev \ make \ g++ \ iw \ python-bluez \ ettercap-text-only;

echo """
    BOOTSTRAPPING PYTHON UTILS...
"""
pip install --upgrade pip;

echo """
    INSTALLING PYTHON PACKAGES...
"""
sudo pip install scapy python-nmap ipaddress netaddr optparse-pretty;

echo """
    CLONING GIT PACKAGES TO WarBerry/Tools directory...
"""
# This is script that allows to clone multiple gh-repos in one command
cd  $WARBERRYDIR/Tools;
for f in "${GITREPOS[@]}"; do `git clone $f`; done

echo """
    DONE!
"""
echo """
    WarBerry IS READY TO ROCK!

"""

else echo "ERROR: can't find apt."

ghost commented 8 years ago

I just fetch your changes and add your proposal to bootstrap.sh script.

secgroundzero commented 8 years ago

added. thank you and closing the issue