Advertisement
Guest User

Untitled

a guest
Jul 4th, 2018
1,418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 190.27 KB | None | 0 0
  1. #!/bin/bash
  2. #-Metadata----------------------------------------------------#
  3. # Filename: kali.sh (Update: 2015-12-02) #
  4. #-Info--------------------------------------------------------#
  5. # Personal post-install script for Kali Linux 2.0. #
  6. #-Author(s)---------------------------------------------------#
  7. # g0tmilk ~ https://blog.g0tmi1k.com/ #
  8. #-Operating System--------------------------------------------#
  9. # Designed for: Kali Linux 2.x [x64] (VM - VMware) #
  10. # Tested on: Kali Linux 2.0.0 x64/x84/full/light/mini/vm #
  11. # Kali v1.x: https://g0tmi1k/os-scripts/master/kali1.sh #
  12. #-Licence-----------------------------------------------------#
  13. # MIT License ~ http://opensource.org/licenses/MIT #
  14. #-Notes-------------------------------------------------------#
  15. # Run as root, just after a fresh/clean install of Kali 2.x. #
  16. # --- #
  17. # You will need 25GB+ of HDD space. #
  18. # --- #
  19. # Command line arguments: #
  20. # -burp = Automates configuring Burp Suite #
  21. # -dns = Use Google's DNS and locks permissions #
  22. # -hold = Disable updating certain packages (e.g. msf) #
  23. # -openvas = Installs & configures OpenVAS vuln scanner #
  24. # -osx = Configures Apple keyboard layout #
  25. # -rolling = Use kali-rolling repository #
  26. # #
  27. # -keyboard <value> = Change the keyboard layout language #
  28. # -timezone <value> = Change the timezone location #
  29. # #
  30. # e.g. # bash kali.sh -osx -burp -openvas -keyboard gb #
  31. # --- #
  32. # ** This script is meant for _ME_. ** #
  33. # ** EDIT this to meet _YOUR_ requirements! ** #
  34. #-------------------------------------------------------------#
  35.  
  36.  
  37. if [ 1 -eq 0 ]; then # This is never true, thus it acts as block comments ;)
  38. ### One liner - Grab the latest version and execute! ###########################
  39. wget -qO kali.sh https://raw.github.com/g0tmi1k/os-scripts/master/kali.sh && bash kali.sh -dns -burp -openvas -rolling -keyboard gb -timezone "Europe/London"
  40. ################################################################################
  41. ## Shorten URL: >->-> wget -qO- http://bit.do/postkali | bash <-<-<
  42. ## Alt Method: curl -s -L -k https://raw.github.com/g0tmi1k/kali-postinstall/master/kali_postinstall.sh > kali.sh | nohup bash
  43. ################################################################################
  44. fi
  45.  
  46.  
  47. #-Defaults-------------------------------------------------------------#
  48.  
  49.  
  50. ##### Location information
  51. keyboardApple=false # Using a Apple/Macintosh keyboard (non VM)? [ --osx ]
  52. keyboardLayout="" # Set keyboard layout [ --keyboard gb]
  53. timezone="" # Set timezone location [ --timezone Europe/London ]
  54.  
  55. ##### Optional steps
  56. burpFree=false # Disable configuring Burp Suite (for Burp Pro users...) [ --burp ]
  57. hardenDNS=false # Set static & lock DNS name server [ --dns ]
  58. freezeDEB=false # Disable updating certain packages (e.g. Metasploit) [ --hold ]
  59. openVAS=false # Install & configure OpenVAS (not everyone wants it...) [ --openvas ]
  60. rolling=false # Enable kali-rolling repos? [ --rolling ]
  61.  
  62. ##### (Optional) Enable debug mode?
  63. #set -x
  64.  
  65. ##### (Cosmetic) Colour output
  66. RED="\033[01;31m" # Issues/Errors
  67. GREEN="\033[01;32m" # Success
  68. YELLOW="\033[01;33m" # Warnings/Information
  69. BLUE="\033[01;34m" # Heading
  70. BOLD="\033[01;01m" # Highlight
  71. RESET="\033[00m" # Normal
  72.  
  73.  
  74. #-Arguments------------------------------------------------------------#
  75.  
  76.  
  77. ##### Read command line arguments
  78. while [[ "${#}" -gt 0 && ."${1}" == .-* ]]; do
  79. opt="${1}";
  80. shift;
  81. case "$(echo ${opt} | tr '[:upper:]' '[:lower:]')" in
  82. -|-- ) break 2;;
  83.  
  84. -osx|--osx )
  85. keyboardApple=true;;
  86. -apple|--apple )
  87. keyboardApple=true;;
  88.  
  89. -dns|--dns )
  90. hardenDNS=true;;
  91.  
  92. -hold|--hold )
  93. freezeDEB=true;;
  94.  
  95. -openvas|--openvas )
  96. openVAS=true;;
  97.  
  98. -burp|--burp )
  99. burpFree=true;;
  100.  
  101. -rolling|--rolling )
  102. rolling=true;;
  103.  
  104. -keyboard|--keyboard )
  105. keyboardLayout="${1}"; shift;;
  106. -keyboard=*|--keyboard=* )
  107. keyboardLayout="${opt#*=}";;
  108.  
  109. -timezone|--timezone )
  110. timezone="${1}"; shift;;
  111. -timezone=*|--timezone=* )
  112. timezone="${opt#*=}";;
  113.  
  114. *) echo -e ' '${RED}'[!]'${RESET}" Unknown option: ${RED}${x}${RESET}" 1>&2 && exit 1;;
  115. esac
  116. done
  117.  
  118.  
  119. ##### Check user inputs
  120. if [[ -n "${timezone}" && ! -f "/usr/share/zoneinfo/${timezone}" ]]; then
  121. echo -e ' '${RED}'[!]'${RESET}" Looks like the ${RED}timezone '${timezone}'${RESET} is incorrect/not supported (Example: Europe/London). Quitting..." 1>&2
  122. exit 1
  123. elif [[ -n "${keyboardLayout}" && -e /usr/share/X11/xkb/rules/xorg.lst ]]; then
  124. if ! $(grep -q " ${keyboardLayout} " /usr/share/X11/xkb/rules/xorg.lst); then
  125. echo -e ' '${RED}'[!]'${RESET}" Looks like the ${RED}keyboard layout '${keyboardLayout}'${RESET} is incorrect/not supported (Example: gb). Quitting..." 1>&2
  126. exit 1
  127. fi
  128. fi
  129.  
  130.  
  131. #-Start----------------------------------------------------------------#
  132.  
  133.  
  134. ##### Check if we are running as root - else this script will fail (hard!)
  135. if [[ ${EUID} -ne 0 ]]; then
  136. echo -e ' '${RED}'[!]'${RESET}" This script must be ${RED}run as root${RESET}. Quitting..." 1>&2
  137. exit 1
  138. else
  139. echo -e " ${BLUE}[*]${RESET} ${BOLD}Kali Linux 2.x post-install script${RESET}"
  140. fi
  141.  
  142.  
  143. ##### Fix display output for GUI programs when connecting via SSH
  144. export DISPLAY=:0.0 #[[ -z $SSH_CONNECTION ]] || export DISPLAY=:0.0
  145. export TERM=xterm
  146.  
  147.  
  148. ##### Give VM users a little heads up to get ready
  149. (dmidecode | grep -iq virtual) && echo -e " ${YELLOW}[i]${RESET} VM Detected. Please be sure to have the ${YELLOW}correct tools ISO mounted${RESET}" && sleep 5s
  150.  
  151.  
  152. if [[ $(which gnome-shell) ]]; then
  153. ##### Disable notification package updater
  154. echo -e "\n ${GREEN}[+]${RESET} Disabling ${GREEN}notification package updater${RESET} service ~ in case it runs during this script"
  155. export DISPLAY=:0.0 #[[ -z $SSH_CONNECTION ]] || export DISPLAY=:0.0
  156. dconf write /org/gnome/settings-daemon/plugins/updates/active false
  157. dconf write /org/gnome/desktop/notifications/application/gpk-update-viewer/active false
  158. timeout 5 killall -w /usr/lib/apt/methods/http >/dev/null 2>&1 #|| echo -e ' '${RED}'[!]'${RESET}" Failed to kill ${RED}/usr/lib/apt/methods/http${RESET}"
  159. #if [[ -e /var/lib/apt/lists/lock ]]; then
  160. # echo -e ' '${RED}'[!]'${RESET}" There might be ${RED}another (background) service${RESET} using ${BOLD}Advanced Packaging Tool${RESET} currently"
  161. # echo -e ' '${RED}'[!]'${RESET}" If you are 100% sure this is a mistake: $ rm -f /var/lib/{dpkg,apt/lists}/lock; dpkg --configure -a"
  162. # exit 1
  163. #fi
  164.  
  165. ##### Disable screensaver
  166. echo -e "\n ${GREEN}[+]${RESET} Disabling ${GREEN}screensaver${RESET}"
  167. xset s 0 0
  168. xset s off
  169. gsettings set org.gnome.desktop.session idle-delay 0 # Disable swipe on lockscreen
  170. fi
  171.  
  172.  
  173. ##### Check Internet access
  174. echo -e "\n ${GREEN}[+]${RESET} Checking ${GREEN}Internet access${RESET}"
  175. for i in {1..10}; do ping -c 1 -W ${i} www.google.com &>/dev/null && break; done
  176. if [[ "$?" -ne 0 ]]; then
  177. echo -e ' '${RED}'[!]'${RESET}" ${RED}Possible DNS issues${RESET}(?). Trying DHCP 'fix'" 1>&2
  178. chattr -i /etc/resolv.conf 2>/dev/null
  179. dhclient -r
  180. route delete default gw 192.168.155.1 2>/dev/null
  181. dhclient
  182. sleep 15s
  183. _TMP=true
  184. _CMD="$(ping -c 1 8.8.8.8 &>/dev/null)"
  185. if [[ "$?" -ne 0 && "$_TMP" == true ]]; then
  186. _TMP=false
  187. echo -e ' '${RED}'[!]'${RESET}" ${RED}No Internet access${RESET}. Manually fix the issue & re-run the script" 1>&2
  188. fi
  189. _CMD="$(ping -c 1 www.google.com &>/dev/null)"
  190. if [[ "$?" -ne 0 && "$_TMP" == true ]]; then
  191. _TMP=false
  192. echo -e ' '${RED}'[!]'${RESET}" ${RED}Possible DNS issues${RESET}(?). Manually fix the issue & re-run the script" 1>&2
  193. fi
  194. if [[ "$_TMP" == false ]]; then
  195. (dmidecode | grep -iq virtual) && echo -e " ${YELLOW}[i]${RESET} VM Detected. ${YELLOW}Try switching network adapter mode${RESET} (NAT/Bridged)"
  196. echo -e ' '${RED}'[!]'${RESET}" Quitting..." 1>&2
  197. exit 1
  198. fi
  199. fi
  200. #--- GitHub under DDoS?
  201. timeout 300 curl --progress -k -L -f "https://status.github.com/api/status.json" | grep -q "good" || (echo -e ' '${RED}'[!]'${RESET}" ${RED}GitHub is currently having issues${RESET}. ${BOLD}Lots may fail${RESET}. See: https://status.github.com/" 1>&2 && sleep 10s)
  202.  
  203.  
  204. ##### Enable default network repositories ~ http://docs.kali.org/general-use/kali-linux-sources-list-repositories
  205. echo -e "\n ${GREEN}[+]${RESET} Enabling default kali ${GREEN}network repositories${RESET} ~ ...if they were not selected during installation"
  206. #--- Add network repositories
  207. file=/etc/apt/sources.list; [ -e "${file}" ] && cp -n $file{,.bkup}
  208. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  209. #--- Main
  210. grep -q 'deb .* sana main non-free contrib' "${file}" 2>/dev/null || echo "deb http://http.kali.org/kali sana main non-free contrib" >> "${file}"
  211. grep -q 'deb-src .* sana main non-free contrib' "${file}" 2>/dev/null || echo "deb-src http://http.kali.org/kali sana main non-free contrib" >> "${file}"
  212. #--- Security
  213. grep -q 'deb .* sana/updates main contrib non-free' "${file}" 2>/dev/null || echo "deb http://security.kali.org/kali-security sana/updates main contrib non-free" >> "${file}"
  214. grep -q 'deb-src .* sana/updates main contrib non-free' "${file}" 2>/dev/null || echo "deb-src http://security.kali.org/kali-security sana/updates main contrib non-free" >> "${file}"
  215. #--- Disable CD repositories
  216. sed -i '/kali/ s/^\( \|\t\|\)deb cdrom/#deb cdrom/g' "${file}"
  217. #--- Update
  218. apt-get -qq update
  219. if [[ "$?" -ne 0 ]]; then
  220. echo -e ' '${RED}'[!]'${RESET}" There was an ${RED}issue accessing network repositories${RESET}" 1>&2
  221. echo -e " ${YELLOW}[i]${RESET} Are the remote network repositories ${YELLOW}currently being sync'd${RESET}?"
  222. echo -e " ${YELLOW}[i]${RESET} YOUR local ${YELLOW}network repository information${RESET} (Geo-IP based):"
  223. curl -sI http://http.kali.org/README
  224. exit 1
  225. fi
  226.  
  227.  
  228. ##### Install kernel headers
  229. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}kernel headers${RESET}"
  230. apt-get -y -qq install make gcc "linux-headers-$(uname -r)" || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  231. if [[ $? -ne 0 ]]; then
  232. echo -e ' '${RED}'[!]'${RESET}" There was an ${RED}issue installing kernel headers${RESET}" 1>&2
  233. echo -e " ${YELLOW}[i]${RESET} Are you ${YELLOW}USING${RESET} the ${YELLOW}latest kernel${RESET}?"
  234. echo -e " ${YELLOW}[i]${RESET} ${YELLOW}Reboot your machine${RESET}"
  235. exit 1
  236. fi
  237.  
  238.  
  239. ##### (Optional) Check to see if Kali is in a VM. If so, install "Virtual Machine Addons/Tools" for a "better" virtual experiment
  240. if [ -e "/etc/vmware-tools" ]; then
  241. echo -e "\n "${RED}'[!]'${RESET}" VMware Tools is ${RED}already installed${RESET}. Skipping..." 1>&2
  242. elif (dmidecode | grep -iq vmware); then
  243. ##### Install virtual machines tools ~ http://docs.kali.org/general-use/install-vmware-tools-kali-guest
  244. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}virtual machine tools${RESET}"
  245. #--- VM -> Install VMware Tools.
  246. mkdir -p /mnt/cdrom/
  247. umount -f /mnt/cdrom 2>/dev/null
  248. sleep 2s
  249. mount -o ro /dev/cdrom /mnt/cdrom 2>/dev/null; _mount="$?" # This will only check the first CD drive (if there are multiple bays)
  250. sleep 2s
  251. file=$(find /mnt/cdrom/ -maxdepth 1 -type f -name 'VMwareTools-*.tar.gz' -print -quit)
  252. ([[ "${_mount}" == 0 && -z "${file}" ]]) && echo -e ' '${RED}'[!]'${RESET}' Incorrect CD/ISO mounted' 1>&2
  253. if [[ "${_mount}" == 0 && -n "${file}" ]]; then # If there is a CD in (and its right!), try to install native Guest Additions
  254. echo -e ' '${YELLOW}'[i]'${RESET}' Patching & using "native VMware tools"'
  255. apt-get -y -qq install make gcc "linux-headers-$(uname -r)" git sudo || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  256. git clone -q https://github.com/rasa/vmware-tools-patches.git /tmp/vmware-tools-patches || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  257. cp -f "${file}" /tmp/vmware-tools-patches/downloads/
  258. pushd /tmp/vmware-tools-patches/ >/dev/null
  259. bash untar-and-patch-and-compile.sh
  260. popd >/dev/null
  261. umount -f /mnt/cdrom 2>/dev/null
  262. /usr/bin/vmware-user
  263. else # The fallback is 'open vm tools' ~ http://open-vm-tools.sourceforge.net/about.php
  264. echo -e " ${YELLOW}[i]${RESET} VMware Tools CD/ISO isn't mounted"
  265. echo -e " ${YELLOW}[i]${RESET} Skipping 'Native VMware Tools', switching to 'Open VM Tools'"
  266. apt-get -y -qq install open-vm-tools open-vm-tools-desktop open-vm-tools-dkms || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  267. apt-get -y -qq install make || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} # nags afterwards
  268. fi
  269. elif [ -e "/etc/init.d/vboxadd" ]; then
  270. echo -e "\n "${RED}'[!]'${RESET}" VirtualBox Guest Additions is ${RED}already installed${RESET}. Skipping..." 1>&2
  271. elif (dmidecode | grep -iq virtualbox); then
  272. ##### (Optional) Installing Virtualbox Guest Additions. Note: Need VirtualBox 4.2.xx+ (http://docs.kali.org/general-use/kali-linux-virtual-box-guest)
  273. echo -e "\n ${GREEN}[+]${RESET} (Optional) Installing ${GREEN}VirtualBox Guest Additions${RESET}"
  274. #--- Devices -> Install Guest Additions CD image...
  275. mkdir -p /mnt/cdrom/
  276. umount -f /mnt/cdrom 2>/dev/null
  277. sleep 2s
  278. mount -o ro /dev/cdrom /mnt/cdrom 2>/dev/null; _mount=$? # Only checks first CD drive (if multiple)
  279. sleep 2s
  280. file=/mnt/cdrom/VBoxLinuxAdditions.run
  281. if [[ "${_mount}" == 0 && -e "${file}" ]]; then
  282. apt-get -y -qq install make gcc "linux-headers-$(uname -r)" || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  283. cp -f "${file}" /tmp/
  284. chmod -f 0755 /tmp/VBoxLinuxAdditions.run
  285. /tmp/VBoxLinuxAdditions.run --nox11
  286. umount -f /mnt/cdrom 2>/dev/null
  287. #elif [[ "${_mount}" == 0 ]]; then
  288. else
  289. echo -e ' '${RED}'[!]'${RESET}' Incorrect CD/ISO mounted. Skipping...' 1>&2
  290. #apt-get -y -qq install virtualbox-guest-x11
  291. fi
  292. fi
  293.  
  294.  
  295. ##### Check to see if there is a second Ethernet card (if so, set an static IP address)
  296. ip addr show eth1 &>/dev/null
  297. if [[ "$?" == 0 ]]; then
  298. ##### Set a static IP address (192.168.155.175/24) on eth1
  299. echo -e "\n ${GREEN}[+]${RESET} Setting a ${GREEN}static IP address${RESET} (${BOLD}192.168.155.175/24${RESET}) on ${BOLD}eth1${RESET}"
  300. ip addr add 192.168.155.175/24 dev eth1 2>/dev/null
  301. route delete default gw 192.168.155.1 2>/dev/null
  302. file=/etc/network/interfaces.d/eth1.cfg; [ -e "${file}" ] && cp -n $file{,.bkup}
  303. grep -q '^iface eth1 inet static' "${file}" 2>/dev/null || cat <<EOF > "${file}"
  304. auto eth1
  305. iface eth1 inet static
  306. address 192.168.155.175
  307. netmask 255.255.255.0
  308. gateway 192.168.155.1
  309. post-up route delete default gw 192.168.155.1
  310. EOF
  311. fi
  312.  
  313.  
  314. ##### Set static & protecting DNS name servers. Note: May cause issues with forced values (e.g. captive portals etc)
  315. if [ "${hardenDNS}" != "false" ]; then
  316. echo -e "\n ${GREEN}[+]${RESET} Setting static & protecting ${GREEN}DNS name servers${RESET}"
  317. file=/etc/resolv.conf; [ -e "${file}" ] && cp -n $file{,.bkup}
  318. chattr -i "${file}" 2>/dev/null
  319. #--- Remove duplicate results
  320. #uniq "${file}" > "$file.new"; mv $file{.new,}
  321. #--- Use OpenDNS DNS
  322. #echo -e 'nameserver 208.67.222.222\nnameserver 208.67.220.220' > "${file}"
  323. #--- Use Google DNS
  324. echo -e 'nameserver 8.8.8.8\nnameserver 8.8.4.4' > "${file}"
  325. #--- Add domain
  326. #echo -e "domain ${domainName}\n#search ${domainName}" >> "${file}"
  327. #--- Protect it
  328. chattr +i "${file}" 2>/dev/null
  329. else
  330. echo -e "\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping DNS${RESET} (missing: '$0 ${BOLD}--dns${RESET}')..." 1>&2
  331. fi
  332.  
  333.  
  334. ##### Update location information - set either value to "" to skip.
  335. echo -e "\n ${GREEN}[+]${RESET} Updating ${GREEN}location information${RESET}"
  336. [ "${keyboardApple}" != "false" ] && echo -e "\n ${GREEN}[+]${RESET} Applying ${GREEN}Apple hardware${RESET} profile"
  337. #keyboardLayout="gb" # Great Britain
  338. #timezone="Europe/London" # London, Europe
  339. #[ -z "${timezone}" ] && timezone=Etc/UTC #Etc/GMT vs Etc/UTC vs UTC vs Europe/London
  340. #--- Configure keyboard layout
  341. if [[ -n "${keyboardLayout}" ]]; then
  342. echo -e "\n ${GREEN}[+]${RESET} Updating ${GREEN}location information${RESET} ~ keyboard layout (${BOLD}${keyboardLayout}${RESET})"
  343. geoip_keyboard=$(curl -s http://ifconfig.io/country_code | tr '[:upper:]' '[:lower:]')
  344. [ "${geoip_keyboard}" != "${keyboardLayout}" ] && echo -e " ${YELLOW}[i]${RESET} Keyboard layout (${BOLD}${keyboardLayout}${RESET}}) doesn't match what's been detected via GeoIP (${BOLD}${geoip_keyboard}${RESET}})"
  345. file=/etc/default/keyboard; #[ -e "${file}" ] && cp -n $file{,.bkup}
  346. sed -i 's/XKBLAYOUT=".*"/XKBLAYOUT="'${keyboardLayout}'"/' "${file}"
  347. [ "${keyboardApple}" != "false" ] && sed -i 's/XKBVARIANT=".*"/XKBVARIANT="mac"/' "${file}" # Enable if you are using Apple based products.
  348. #dpkg-reconfigure -f noninteractive keyboard-configuration #dpkg-reconfigure console-setup #dpkg-reconfigure keyboard-configuration -u # Need to restart xserver for effect
  349. else
  350. echo -e " ${YELLOW}[i]${RESET} ${YELLOW}Skipping keyboard layout${RESET} (missing: '$0 ${BOLD}--keyboard <value>${RESET}')..." 1>&2
  351. fi
  352. #--- Changing time zone
  353. if [[ -n "${timezone}" ]]; then
  354. echo -e "\n ${GREEN}[+]${RESET} Updating ${GREEN}location information${RESET} ~ time zone (${BOLD}${timezone}${RESET})"
  355. echo "${timezone}" > /etc/timezone
  356. ln -sf "/usr/share/zoneinfo/$(cat /etc/timezone)" /etc/localtime
  357. dpkg-reconfigure -f noninteractive tzdata
  358. else
  359. echo -e " ${YELLOW}[i]${RESET} ${YELLOW}Skipping time zone${RESET} (missing: '$0 ${BOLD}--timezone <value>${RESET}')..." 1>&2
  360. fi
  361. #--- Setting locale # Can't do due to user input
  362. #sed -i 's/^# en_/en_/' /etc/locale.gen #en_GB en_US
  363. #locale-gen
  364. ##echo -e 'LC_ALL=en_US.UTF-8\nLANG=en_US.UTF-8\nLANGUAGE=en_US:en' > /etc/default/locale
  365. #dpkg-reconfigure -f noninteractive tzdata
  366. ##locale -a # Check
  367. #--- Installing ntp
  368. apt-get -y -qq install ntp ntpdate || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  369. #--- Configuring ntp
  370. #file=/etc/default/ntp; [ -e "${file}" ] && cp -n $file{,.bkup}
  371. #grep -q "interface=127.0.0.1" "${file}" || sed -i "s/NTPD_OPTS='/NTPD_OPTS='--interface=127.0.0.1 /" "${file}"
  372. #--- Update time
  373. ntpdate -b -s -u pool.ntp.org
  374. #--- Start service
  375. systemctl restart ntp
  376. #--- Remove from start up
  377. systemctl disable ntp 2>/dev/null
  378. #--- Check
  379. #date
  380. #--- Only used for stats at the end
  381. start_time=$(date +%s)
  382.  
  383.  
  384. if [ "${freezeDEB}" != "false" ]; then
  385. ##### Don't ever update these packages
  386. echo -e "\n ${GREEN}[+]${RESET} ${GREEN}Don't update${RESET} these packages:"
  387. for x in metasploit-framework; do
  388. echo -e " ${YELLOW}[i]${RESET} + ${x}"
  389. echo "${x} hold" | dpkg --set-selections # To update: echo "{$} install" | dpkg --set-selections
  390. done
  391. fi
  392.  
  393.  
  394. if [ "${rolling}" != "false" ]; then
  395. ##### Enable default network repositories ~ http://docs.kali.org/general-use/kali-linux-sources-list-repositories
  396. echo -e "\n ${GREEN}[+]${RESET} Enabling ${GREEN}rolling repositories${RESET} ~ ${BOLD}Should only be used by advanced users${RESET}! Using this means tools will be updated more frequently"
  397. #--- Add network repositories
  398. file=/etc/apt/sources.list; [ -e "${file}" ] && cp -n $file{,.bkup}
  399. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  400. #--- Enable Rolling
  401. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  402. grep -q 'deb .* kali-rolling main contrib non-free' "${file}" 2>/dev/null || echo -e "\n\n# Kali Rolling\ndeb http://http.kali.org/kali kali-rolling main contrib non-free" >> "${file}"
  403. grep -q 'deb-src .* kali-rolling main contrib non-free' "${file}" 2>/dev/null || echo -e "deb-src http://http.kali.org/kali kali-rolling main contrib non-free" >> "${file}"
  404. #grep -q 'sana-proposed-updates main contrib non-free' "${file}" 2>/dev/null || echo -e "deb http://repo.kali.org/kali sana-proposed-updates main contrib non-free\ndeb-src http://repo.kali.org/kali sana-proposed-updates main contrib non-free" >> "${file}"
  405. #--- Disable main repo
  406. sed -i 's_deb http://http.kali.org/kali sana main_#deb http://http.kali.org/kali sana main_' ${file}
  407. sed -i 's_deb-src http://http.kali.org/kali sana main_#deb-src http://http.kali.org/kali sana main_' ${file}
  408. #--- Update
  409. apt-get -qq update
  410. if [[ "$?" -ne 0 ]]; then
  411. echo -e ' '${RED}'[!]'${RESET}" There was an ${RED}issue accessing network repositories${RESET}" 1>&2
  412. echo -e " ${YELLOW}[i]${RESET} Are the remote network repositories ${YELLOW}currently being sync'd${RESET}?"
  413. echo -e " ${YELLOW}[i]${RESET} YOUR ${YELLOW}network repositories information${RESET}:"
  414. curl -sI http://http.kali.org/README
  415. exit 1
  416. fi
  417. fi
  418.  
  419.  
  420. ##### Update OS from network repositories
  421. echo -e "\n ${GREEN}[+]${RESET} ${GREEN}Updating OS${RESET} from network repositories ~ this ${BOLD}may take a while${RESET} depending on your Internet connection & Kali version/age"
  422. for FILE in clean autoremove; do apt-get -y -qq "${FILE}"; done # Clean up clean remove autoremove autoclean
  423. export DEBIAN_FRONTEND=noninteractive
  424. apt-get -qq update && APT_LISTCHANGES_FRONTEND=none apt-get -o Dpkg::Options::="--force-confnew" -y dist-upgrade --fix-missing || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  425. #--- Cleaning up temp stuff
  426. for FILE in clean autoremove; do apt-get -y -qq "${FILE}"; done # Clean up - clean remove autoremove autoclean
  427. #--- Enable bleeding edge ~ http://www.kali.org/kali-monday/bleeding-edge-kali-repositories/
  428. #file=/etc/apt/sources.list; [ -e "${file}" ] && cp -n $file{,.bkup}
  429. #grep -q 'kali-bleeding-edge' "${file}" 2>/dev/null || echo -e "\n\n## Bleeding edge\ndeb http://repo.kali.org/kali sana-bleeding-edge main" >> "${file}"
  430. #apt-get -qq update && apt-get -y -qq upgrade
  431. #--- Check kernel stuff
  432. _TMP=$(dpkg -l | grep linux-image- | grep -vc meta)
  433. if [[ "${_TMP}" -gt 1 ]]; then
  434. echo -e "\n ${YELLOW}[i]${RESET} Detected multiple kernels installed"
  435. TMP=$(dpkg -l | grep linux-image | grep -v meta | sort -t '.' -k 2 -g | tail -n 1 | grep "$(uname -r)")
  436. [[ -z "${_TMP}" ]] && echo -e ' '${RED}'[!]'${RESET}' You are '${RED}'not using the latest kernel'${RESET} 1>&2 && echo -e " ${YELLOW}[i]${RESET} You have it downloaded & installed, ${YELLOW}just not using it${RESET}. You ${YELLOW}need to reboot${RESET}" && exit 1
  437. echo -e " ${YELLOW}[i]${RESET} Clean up: apt-get remove --purge $(dpkg -l 'linux-image-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')" # DO NOT RUN IF NOT USING THE LASTEST KERNEL!
  438. fi
  439.  
  440.  
  441. ##### Install "kali full" meta packages (default tool selection)
  442. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}kali-linux-full${RESET} meta-package ~ this ${BOLD}may take a while${RESET} depending on your Kali version (e.g. ARM, light, mini or docker...)"
  443. #--- Kali's default tools ~ https://www.kali.org/news/kali-linux-metapackages/
  444. apt-get -y -qq install kali-linux-full || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  445.  
  446.  
  447. ##### Fix audio issues
  448. echo -e "\n ${GREEN}[+]${RESET} Fixing ${GREEN}audio${RESET} issues"
  449. #--- Unmute on startup
  450. apt-get -y -qq install alsa-utils || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  451. #--- Set volume now
  452. amixer set Master unmute >/dev/null
  453. amixer set Master 50% >/dev/null
  454.  
  455.  
  456. ##### Configure GRUB
  457. echo -e "\n ${GREEN}[+]${RESET} Configuring ${GREEN}GRUB${RESET} ~ boot manager"
  458. grubTimeout=5
  459. (dmidecode | grep -iq virtual) && grubTimeout=1 # Much less if we are in a VM
  460. file=/etc/default/grub; [ -e "${file}" ] && cp -n $file{,.bkup}
  461. sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT='${grubTimeout}'/' "${file}" # Time out (lower if in a virtual machine, else possible dual booting)
  462. sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=""/' "${file}" # TTY resolution #GRUB_CMDLINE_LINUX_DEFAULT="vga=0x0318 quiet" (crashes VM/vmwgfx) (See Cosmetics)
  463. update-grub
  464.  
  465.  
  466. ###### Disable login manager (console login - non GUI) ***
  467. #echo -e "\n ${GREEN}[+]${RESET} ${GREEN}Disabling GUI${RESET} login screen"
  468. #--- Disable GUI login screen
  469. #systemctl set-default multi-user.target # ...or: file=/etc/X11/default-display-manager; [ -e "${file}" ] && cp -n $file{,.bkup} ; echo /bin/true > "${file}" # ...or: mv -f /etc/rc2.d/S19gdm3 /etc/rc2.d/K17gdm # ...or: apt-get -y -qq install chkconfig; chkconfig gdm3 off
  470. #--- Enable auto (gui) login
  471. #file=/etc/gdm3/daemon.conf; [ -e "${file}" ] && cp -n $file{,.bkup}
  472. #sed -i 's/^.*AutomaticLoginEnable = .*/AutomaticLoginEnable = true/' "${file}"
  473. #sed -i 's/^.*AutomaticLogin = .*/AutomaticLogin = root/' "${file}"
  474. #--- Shortcut for when you want to start GUI
  475. [ -e /usr/sbin/gdm3 ] && ln -sf /usr/sbin/gdm3 /usr/bin/startx
  476.  
  477.  
  478. ###### Configure startup ***
  479. #echo -e "\n ${GREEN}[+]${RESET} Configuring ${GREEN}startup${RESET} ~ randomize the hostname, eth0 & wlan0s MAC address"
  480. #--- Start up
  481. #file=/etc/rc.local; [ -e "${file}" ] && cp -n $file{,.bkup}
  482. #grep -q "macchanger" "${file}" 2>/dev/null || sed -i "s#^exit 0#for INT in eth0 wlan0; do\n $(which ip) link set \${INT} down\n $(which macchanger) -r \${INT} \&\& $(which sleep) 3s\n $(which ip) link set \${INT} up\ndone\n\n\nexit 0#" "${file}"
  483. #grep -q "hostname" "${file}" 2>/dev/null || sed -i "s#^exit 0#echo \$($(which cat) /dev/urandom | $(which tr) -dc 'A-Za-z' | $(which head) -c8) > /etc/hostname\nexit 0#" "${file}"
  484. #--- On demand
  485. file=/usr/local/bin/mac-rand; [ -e "${file}" ] && cp -n $file{,.bkup}
  486. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  487. #!/bin/bash
  488. for INT in eth0 wlan0; do
  489. echo "[i] Randomizing: \${INT}"
  490. ifconfig \${INT} down
  491. macchanger -r \${INT} && sleep 3s
  492. ifconfig \${INT} up
  493. echo "--------------------"
  494. done
  495. exit 0
  496. EOF
  497. chmod -f 0500 "${file}"
  498. #--- Auto on interface change state (untested)
  499. #file=/etc/network/if-pre-up.d/macchanger; [ -e "${file}" ] && cp -n $file{,.bkup}
  500. #cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  501. ##!/bin/bash
  502. #[ "\${IFACE}" == "lo" ] && exit 0
  503. #ifconfig \${IFACE} down
  504. #macchanger -r \${IFACE}
  505. #ifconfig \${IFACE} up
  506. #exit 0
  507. #EOF
  508. #chmod -f 0500 "${file}"
  509. #--- Disable random MAC address on start up
  510. rm -f /etc/network/if-pre-up.d/macchanger
  511.  
  512.  
  513. if [[ $(which gnome-shell) ]]; then
  514. ##### Configure GNOME 3
  515. echo -e "\n ${GREEN}[+]${RESET} Configuring ${GREEN}GNOME 3${RESET} ~ desktop environment"
  516. export DISPLAY=:0.0 #[[ -z $SSH_CONNECTION ]] || export DISPLAY=:0.0
  517. #-- Gnome Extension - Frippery (https://extensions.gnome.org/extension/13/applications-menu/) *** TaskBar has more features
  518. mkdir -p ~/.local/share/gnome-shell/extensions/
  519. timeout 300 curl --progress -k -L -f "http://frippery.org/extensions/gnome-shell-frippery-0.9.3.tgz" > /tmp/frippery.tgz || echo -e ' '${RED}'[!]'${RESET}" Issue downloading frippery.tgz" 1>&2
  520. tar -zxf /tmp/frippery.tgz -C ~/
  521. #-- Gnome Extension - TopIcons (https://extensions.gnome.org/extension/495/topicons/) # Doesn't work with v3.10
  522. #mkdir -p ~/.local/share/gnome-shell/extensions/topIcons@adel.gadllah@gmail.com/
  523. #curl --progress -k -L -f "https://extensions.gnome.org/review/download/2236.shell-extension.zip" > /tmp/topIcons.zip || echo -e ' '${RED}'[!]'${RESET}" Issue downloading topIcons.zip" 1>&2
  524. #unzip -q -o /tmp/topIcons.zip -d ~/.local/share/gnome-shell/extensions/topIcons@adel.gadllah@gmail.com/
  525. #sed -i 's/"shell-version": \[$/"shell-version": \[ "3.10",/' ~/.local/share/gnome-shell/extensions/topIcons@adel.gadllah@gmail.com/metadata.json
  526. #-- Gnome Extension - icon-hider (https://github.com/ikalnitsky/gnome-shell-extension-icon-hider)
  527. mkdir -p "/usr/share/gnome-shell/extensions/"
  528. git clone -q https://github.com/ikalnitsky/gnome-shell-extension-icon-hider.git /usr/share/gnome-shell/extensions/icon-hider@kalnitsky.org/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  529. #-- Gnome Extension - Disable Screen Shield (https://extensions.gnome.org/extension/672/disable-screen-shield/) # Doesn't work with v3.10
  530. #mkdir -p "/usr/share/gnome-shell/extensions/"
  531. #git clone -q https://github.com/lgpasquale/gnome-shell-extension-disable-screenshield.git /usr/share/gnome-shell/extensions/disable-screenshield@lgpasquale.com/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  532. #-- Gnome Extension - TaskBar (https://extensions.gnome.org/extension/584/taskbar/)
  533. mkdir -p "/usr/share/gnome-shell/extensions/"
  534. git clone -q https://github.com/zpydr/gnome-shell-extension-taskbar.git /usr/share/gnome-shell/extensions/TaskBar@zpydr/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  535. #--- Gnome Extensions (Enable)
  536. for EXTENSION in "alternate-tab@gnome-shell-extensions.gcampax.github.com" "drive-menu@gnome-shell-extensions.gcampax.github.com" "TaskBar@zpydr" "Bottom_Panel@rmy.pobox.com" "Panel_Favorites@rmy.pobox.com" "Move_Clock@rmy.pobox.com" "icon-hider@kalnitsky.org"; do
  537. GNOME_EXTENSIONS=$(gsettings get org.gnome.shell enabled-extensions | sed 's_^.\(.*\).$_\1_')
  538. echo "${GNOME_EXTENSIONS}" | grep -q "${EXTENSION}" || gsettings set org.gnome.shell enabled-extensions "[${GNOME_EXTENSIONS}, '${EXTENSION}']"
  539. done
  540. #--- Gnome Extensions (Disable)
  541. for EXTENSION in "dash-to-dock@micxgx.gmail.com" "workspace-indicator@gnome-shell-extensions.gcampax.github.com"; do
  542. GNOME_EXTENSIONS=$(gsettings get org.gnome.shell enabled-extensions | sed "s_^.\(.*\).\$_\1_; s_, '${EXTENSION}'__")
  543. gsettings set org.gnome.shell enabled-extensions "[${GNOME_EXTENSIONS}]"
  544. done
  545. #--- Dash Dock (even though it should be disabled)
  546. dconf write /org/gnome/shell/extensions/dash-to-dock/dock-fixed true
  547. #--- TaskBar (Global)
  548. dconf write /org/gnome/shell/extensions/TaskBar/first-start false
  549. #--- TaskBar (without Frippery) ~ gsettings set org.gnome.shell enabled-extensions "[$( gsettings get org.gnome.shell enabled-extensions | sed "s_^.\(.*\).\$_\1_; s#, 'Bottom_Panel@rmy.pobox.com'##; s#, 'Panel_Favorites@rmy.pobox.com'##; s#, 'Move_Clock@rmy.pobox.com'##" )]"
  550. #dconf write /org/gnome/shell/extensions/TaskBar/bottom-panel true
  551. #dconf write /org/gnome/shell/extensions/TaskBar/display-favorites true
  552. #dconf write /org/gnome/shell/extensions/TaskBar/hide-default-application-menu true
  553. #dconf write /org/gnome/shell/extensions/TaskBar/display-showapps-button false
  554. #dconf write /org/gnome/shell/extensions/TaskBar/appearance-selection "'showappsbutton'"
  555. #dconf write /org/gnome/shell/extensions/TaskBar/overview true
  556. #dconf write /org/gnome/shell/extensions/TaskBar/position-appview-button 2
  557. #dconf write /org/gnome/shell/extensions/TaskBar/position-desktop-button 0
  558. #dconf write /org/gnome/shell/extensions/TaskBar/position-favorites 3
  559. #dconf write /org/gnome/shell/extensions/TaskBar/position-max-right 4
  560. #dconf write /org/gnome/shell/extensions/TaskBar/position-tasks 4
  561. #dconf write /org/gnome/shell/extensions/TaskBar/position-workspace-button 1
  562. #dconf write /org/gnome/shell/extensions/TaskBar/separator-two true
  563. #dconf write /org/gnome/shell/extensions/TaskBar/separator-three true
  564. #dconf write /org/gnome/shell/extensions/TaskBar/separator-four true
  565. #dconf write /org/gnome/shell/extensions/TaskBar/separator-five true
  566. #dconf write /org/gnome/shell/extensions/TaskBar/separator-six true
  567. #dconf write /org/gnome/shell/extensions/TaskBar/separator-three-bottom true
  568. #dconf write /org/gnome/shell/extensions/TaskBar/separator-five-bottom true
  569. #dconf write /org/gnome/shell/extensions/TaskBar/appview-button-icon "'/usr/share/gnome-shell/extensions/TaskBar@zpydr/images/appview-button-default.svg'"
  570. #dconf write /org/gnome/shell/extensions/TaskBar/desktop-button-icon "'/usr/share/gnome-shell/extensions/TaskBar@zpydr/images/desktop-button-default.png'"
  571. #dconf write /org/gnome/shell/extensions/TaskBar/tray-button-icon "'/usr/share/gnome-shell/extensions/TaskBar@zpydr/images/bottom-panel-tray-button.svg'"
  572. #--- TaskBar (with Frippery)
  573. dconf write /org/gnome/shell/extensions/TaskBar/hide-default-application-menu true
  574. dconf write /org/gnome/shell/extensions/TaskBar/bottom-panel false
  575. dconf write /org/gnome/shell/extensions/TaskBar/display-favorites false
  576. dconf write /org/gnome/shell/extensions/TaskBar/display-desktop-button false
  577. dconf write /org/gnome/shell/extensions/TaskBar/display-showapps-button false
  578. dconf write /org/gnome/shell/extensions/TaskBar/display-tasks false
  579. dconf write /org/gnome/shell/extensions/TaskBar/display-workspace-button false
  580. dconf write /org/gnome/shell/extensions/TaskBar/overview false
  581. dconf write /org/gnome/shell/extensions/TaskBar/separator-two false
  582. dconf write /org/gnome/shell/extensions/TaskBar/separator-three false
  583. dconf write /org/gnome/shell/extensions/TaskBar/separator-four false
  584. dconf write /org/gnome/shell/extensions/TaskBar/separator-five false
  585. dconf write /org/gnome/shell/extensions/TaskBar/separator-six false
  586. #--- Workspaces
  587. gsettings set org.gnome.shell.overrides dynamic-workspaces false
  588. gsettings set org.gnome.desktop.wm.preferences num-workspaces 3
  589. #--- Top bar
  590. gsettings set org.gnome.desktop.interface clock-show-date true # Show date next to time
  591. #--- Dock settings
  592. gsettings set org.gnome.shell.extensions.dash-to-dock extend-height true # Set dock to use the full height
  593. gsettings set org.gnome.shell.extensions.dash-to-dock dock-position 'RIGHT' # Set dock to the right
  594. gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed true # Set dock to be always visible
  595. gsettings set org.gnome.shell favorite-apps "['gnome-terminal.desktop', 'org.gnome.Nautilus.desktop', 'iceweasel.desktop', 'kali-burpsuite.desktop', 'kali-msfconsole.desktop', 'geany.desktop']"
  596. #--- Keyboard shortcuts
  597. (dmidecode | grep -iq virtual) && gsettings set org.gnome.mutter overlay-key "Super_R" # Change 'super' key to right side (rather than left key)
  598. #--- Disable tracker service (But enables it in XFCE)
  599. gsettings set org.freedesktop.Tracker.Miner.Files crawling-interval -2
  600. gsettings set org.freedesktop.Tracker.Miner.Files enable-monitors false
  601. tracker-control -r
  602. #mkdir -p ~/.config/autostart/
  603. #cp -f /etc/xdg/autostart/tracker* ~/.config/autostart
  604. #sed -i 's/X-GNOME-Autostart-enabled=.*/X-GNOME-Autostart-enabled=false/' ~/.config/autostart/tracker*
  605. #--- Smaller title bar
  606. gsettings set org.gnome.desktop.wm.preferences titlebar-font "'Droid Bold 10'"
  607. gsettings set org.gnome.desktop.wm.preferences titlebar-uses-system-font false
  608. #--- Hide desktop icon
  609. dconf write /org/gnome/nautilus/desktop/computer-icon-visible false
  610. #--- Cosmetics - Change wallpaper & login (happens later)
  611. #cp -f /path/to/file.png /usr/share/images/desktop-base/kali-grub.png # Change grub boot
  612. #dconf write /org/gnome/desktop/screensaver/picture-uri "'file:///path/to/file.png'" # Change lock wallpaper (before swipe)
  613. #cp -f /path/to/file.png /usr/share/gnome-shell/theme/KaliLogin.png # Change login wallpaper (after swipe)
  614. #dconf write /org/gnome/desktop/background/picture-uri "'file:///path/to/file.png'" # Change desktop wallpaper
  615. gsettings set org.gnome.desktop.session idle-delay 0 # Disable swipe on lockscreen
  616. #--- Restart GNOME panel to apply/take effect (need to restart xserver for effect)
  617. #timeout 30 killall -q -w gnome-panel >/dev/null && gnome-shell --replace& # Still need to logoff!
  618. #reboot
  619. fi
  620.  
  621.  
  622. ##### Install XFCE4
  623. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}XFCE4${RESET}${RESET} ~ desktop environment"
  624. export DISPLAY=:0.0 #[[ -z $SSH_CONNECTION ]] || export DISPLAY=:0.0
  625. apt-get -y -qq install curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  626. apt-get -y -qq install xfce4 xfce4-places-plugin || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} #xfce4-goodies xfce4-battery-plugin xfce4-mount-plugin
  627. #apt-get -y -qq install shiki-colors-xfwm-theme # theme from repos
  628. #--- Configuring XFCE
  629. mv -f /usr/bin/startx{,-gnome}
  630. ln -sf /usr/bin/startx{fce4,}
  631. mkdir -p ~/.config/xfce4/{desktop,menu,panel,xfconf,xfwm4}/
  632. mkdir -p ~/.config/xfce4/panel/launcher-{2,4,5,6,8,9}/
  633. mkdir -p ~/.config/xfce4/xfconf/xfce-perchannel-xml/
  634. cat <<EOF > ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  635. <?xml version="1.0" encoding="UTF-8"?>
  636.  
  637. <channel name="xfce4-keyboard-shortcuts" version="1.0">
  638. <property name="commands" type="empty">
  639. <property name="custom" type="empty">
  640. <property name="XF86Display" type="string" value="xfce4-display-settings --minimal"/>
  641. <property name="&lt;Alt&gt;F2" type="string" value="xfrun4"/>
  642. <property name="&lt;Primary&gt;&lt;Alt&gt;t" type="string" value="/usr/bin/exo-open --launch TerminalEmulator"/>
  643. <property name="&lt;Primary&gt;&lt;Alt&gt;Delete" type="string" value="xflock4"/>
  644. <property name="&lt;Primary&gt;Escape" type="string" value="xfdesktop --menu"/>
  645. <property name="&lt;Super&gt;p" type="string" value="xfce4-display-settings --minimal"/>
  646. <property name="override" type="bool" value="true"/>
  647. <property name="&lt;Primary&gt;space" type="string" value="xfce4-appfinder"/>
  648. </property>
  649. </property>
  650. <property name="xfwm4" type="empty">
  651. <property name="custom" type="empty">
  652. <property name="&lt;Alt&gt;&lt;Control&gt;End" type="string" value="move_window_next_workspace_key"/>
  653. <property name="&lt;Alt&gt;&lt;Control&gt;Home" type="string" value="move_window_prev_workspace_key"/>
  654. <property name="&lt;Alt&gt;&lt;Control&gt;KP_1" type="string" value="move_window_workspace_1_key"/>
  655. <property name="&lt;Alt&gt;&lt;Control&gt;KP_2" type="string" value="move_window_workspace_2_key"/>
  656. <property name="&lt;Alt&gt;&lt;Control&gt;KP_3" type="string" value="move_window_workspace_3_key"/>
  657. <property name="&lt;Alt&gt;&lt;Control&gt;KP_4" type="string" value="move_window_workspace_4_key"/>
  658. <property name="&lt;Alt&gt;&lt;Control&gt;KP_5" type="string" value="move_window_workspace_5_key"/>
  659. <property name="&lt;Alt&gt;&lt;Control&gt;KP_6" type="string" value="move_window_workspace_6_key"/>
  660. <property name="&lt;Alt&gt;&lt;Control&gt;KP_7" type="string" value="move_window_workspace_7_key"/>
  661. <property name="&lt;Alt&gt;&lt;Control&gt;KP_8" type="string" value="move_window_workspace_8_key"/>
  662. <property name="&lt;Alt&gt;&lt;Control&gt;KP_9" type="string" value="move_window_workspace_9_key"/>
  663. <property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="string" value="cycle_reverse_windows_key"/>
  664. <property name="&lt;Alt&gt;Delete" type="string" value="del_workspace_key"/>
  665. <property name="&lt;Alt&gt;F10" type="string" value="maximize_window_key"/>
  666. <property name="&lt;Alt&gt;F11" type="string" value="fullscreen_key"/>
  667. <property name="&lt;Alt&gt;F12" type="string" value="above_key"/>
  668. <property name="&lt;Alt&gt;F4" type="string" value="close_window_key"/>
  669. <property name="&lt;Alt&gt;F6" type="string" value="stick_window_key"/>
  670. <property name="&lt;Alt&gt;F7" type="string" value="move_window_key"/>
  671. <property name="&lt;Alt&gt;F8" type="string" value="resize_window_key"/>
  672. <property name="&lt;Alt&gt;F9" type="string" value="hide_window_key"/>
  673. <property name="&lt;Alt&gt;Insert" type="string" value="add_workspace_key"/>
  674. <property name="&lt;Alt&gt;space" type="string" value="popup_menu_key"/>
  675. <property name="&lt;Alt&gt;Tab" type="string" value="cycle_windows_key"/>
  676. <property name="&lt;Control&gt;&lt;Alt&gt;d" type="string" value="show_desktop_key"/>
  677. <property name="&lt;Control&gt;&lt;Alt&gt;Down" type="string" value="down_workspace_key"/>
  678. <property name="&lt;Control&gt;&lt;Alt&gt;Left" type="string" value="left_workspace_key"/>
  679. <property name="&lt;Control&gt;&lt;Alt&gt;Right" type="string" value="right_workspace_key"/>
  680. <property name="&lt;Control&gt;&lt;Alt&gt;Up" type="string" value="up_workspace_key"/>
  681. <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="string" value="move_window_left_key"/>
  682. <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="string" value="move_window_right_key"/>
  683. <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="string" value="move_window_up_key"/>
  684. <property name="&lt;Control&gt;F1" type="string" value="workspace_1_key"/>
  685. <property name="&lt;Control&gt;F10" type="string" value="workspace_10_key"/>
  686. <property name="&lt;Control&gt;F11" type="string" value="workspace_11_key"/>
  687. <property name="&lt;Control&gt;F12" type="string" value="workspace_12_key"/>
  688. <property name="&lt;Control&gt;F2" type="string" value="workspace_2_key"/>
  689. <property name="&lt;Control&gt;F3" type="string" value="workspace_3_key"/>
  690. <property name="&lt;Control&gt;F4" type="string" value="workspace_4_key"/>
  691. <property name="&lt;Control&gt;F5" type="string" value="workspace_5_key"/>
  692. <property name="&lt;Control&gt;F6" type="string" value="workspace_6_key"/>
  693. <property name="&lt;Control&gt;F7" type="string" value="workspace_7_key"/>
  694. <property name="&lt;Control&gt;F8" type="string" value="workspace_8_key"/>
  695. <property name="&lt;Control&gt;F9" type="string" value="workspace_9_key"/>
  696. <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="string" value="lower_window_key"/>
  697. <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="string" value="raise_window_key"/>
  698. <property name="&lt;Super&gt;Tab" type="string" value="switch_window_key"/>
  699. <property name="Down" type="string" value="down_key"/>
  700. <property name="Escape" type="string" value="cancel_key"/>
  701. <property name="Left" type="string" value="left_key"/>
  702. <property name="Right" type="string" value="right_key"/>
  703. <property name="Up" type="string" value="up_key"/>
  704. <property name="override" type="bool" value="true"/>
  705. <property name="&lt;Super&gt;Left" type="string" value="tile_left_key"/>
  706. <property name="&lt;Super&gt;Right" type="string" value="tile_right_key"/>
  707. <property name="&lt;Super&gt;Up" type="string" value="maximize_window_key"/>
  708. </property>
  709. </property>
  710. <property name="providers" type="array">
  711. <value type="string" value="xfwm4"/>
  712. <value type="string" value="commands"/>
  713. </property>
  714. </channel>
  715. EOF
  716. cat <<EOF > ~/.config/xfce4/panel/launcher-2/13684522758.desktop || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  717. [Desktop Entry]
  718. Name=Terminal Emulator
  719. Encoding=UTF-8
  720. Exec=exo-open --launch TerminalEmulator
  721. Icon=utilities-terminal
  722. StartupNotify=false
  723. Terminal=false
  724. Comment=Use the command line
  725. Type=Application
  726. Categories=Utility;X-XFCE;X-Xfce-Toplevel;
  727. X-XFCE-Source=file:///usr/share/applications/exo-terminal-emulator.desktop
  728. EOF
  729. cat <<EOF > ~/.config/xfce4/panel/launcher-4/14470234761.desktop || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  730. [Desktop Entry]
  731. Name=wireshark
  732. Encoding=UTF-8
  733. Exec=sh -c "wireshark"
  734. Icon=wireshark
  735. StartupNotify=false
  736. Terminal=false
  737. Type=Application
  738. Categories=09-sniffing-spoofing;
  739. X-Kali-Package=wireshark
  740. X-XFCE-Source=file:///usr/share/applications/kali-wireshark.desktop
  741. EOF
  742. cat <<EOF > ~/.config/xfce4/panel/launcher-5/14470234962.desktop || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  743. [Desktop Entry]
  744. Name=burpsuite
  745. Encoding=UTF-8
  746. Exec=sh -c "java -jar /usr/bin/burpsuite"
  747. Icon=burpsuite
  748. StartupNotify=false
  749. Terminal=false
  750. Type=Application
  751. Categories=03-webapp-analysis;03-06-web-application-proxies;
  752. X-Kali-Package=burpsuite
  753. X-XFCE-Source=file:///usr/share/applications/kali-burpsuite.desktop
  754. EOF
  755. cat <<EOF > ~/.config/xfce4/panel/launcher-6/13684522587.desktop || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  756. [Desktop Entry]
  757. Name=Iceweasel
  758. Encoding=UTF-8
  759. Exec=iceweasel %u
  760. Icon=iceweasel
  761. StartupNotify=true
  762. Terminal=false
  763. Comment=Browse the World Wide Web
  764. GenericName=Web Browser
  765. X-GNOME-FullName=Iceweasel Web Browser
  766. X-MultipleArgs=false
  767. Type=Application
  768. Categories=Network;WebBrowser;
  769. MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
  770. StartupWMClass=Iceweasel
  771. X-XFCE-Source=file:///usr/share/applications/iceweasel.desktop
  772. EOF
  773. cat <<EOF > ~/.config/xfce4/panel/launcher-8/13684522859.desktop || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  774. [Desktop Entry]
  775. Name=Geany
  776. Encoding=UTF-8
  777. Exec=geany %F
  778. Icon=geany
  779. StartupNotify=true
  780. Terminal=false
  781. Comment=A fast and lightweight IDE using GTK2
  782. GenericName=Integrated Development Environment
  783. Type=Application
  784. Categories=GTK;Development;IDE;
  785. MimeType=text/plain;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-dsrc;text/x-pascal;text/x-perl;text/x-python;application/x-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/xml;text/html;text/css;text/x-sql;text/x-diff;
  786. X-XFCE-Source=file:///usr/share/applications/geany.desktop
  787. EOF
  788. cat <<EOF > ~/.config/xfce4/panel/launcher-9/136845425410.desktop || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  789. [Desktop Entry]
  790. Name=Application Finder
  791. Exec=xfce4-appfinder
  792. Icon=xfce4-appfinder
  793. StartupNotify=true
  794. Terminal=false
  795. Type=Application
  796. Categories=X-XFCE;Utility;
  797. Comment=Find and launch applications installed on your system
  798. X-XFCE-Source=file:///usr/share/applications/xfce4-appfinder.desktop
  799. EOF
  800. _TMP=""
  801. [ "${burpFree}" != "false" ] && _TMP="-t int -s 5"
  802. xfconf-query -n -a -c xfce4-panel -p /panels -t int -s 0
  803. xfconf-query --create --channel xfce4-panel --property /panels/panel-0/plugin-ids \
  804. -t int -s 1 -t int -s 2 -t int -s 3 -t int -s 4 ${_TMP} -t int -s 6 -t int -s 8 -t int -s 9 \
  805. -t int -s 10 -t int -s 11 -t int -s 13 -t int -s 15 -t int -s 16 -t int -s 17 -t int -s 19 -t int -s 20
  806. xfconf-query -n -c xfce4-panel -p /panels/panel-0/length -t int -s 100
  807. xfconf-query -n -c xfce4-panel -p /panels/panel-0/size -t int -s 30
  808. xfconf-query -n -c xfce4-panel -p /panels/panel-0/position -t string -s "p=6;x=0;y=0"
  809. xfconf-query -n -c xfce4-panel -p /panels/panel-0/position-locked -t bool -s true
  810. xfconf-query -n -c xfce4-panel -p /plugins/plugin-1 -t string -s applicationsmenu # application menu
  811. xfconf-query -n -c xfce4-panel -p /plugins/plugin-2 -t string -s launcher # terminal ID: 13684522758
  812. xfconf-query -n -c xfce4-panel -p /plugins/plugin-3 -t string -s places # places
  813. xfconf-query -n -c xfce4-panel -p /plugins/plugin-4 -t string -s launcher # wireshark ID: 14470234761
  814. [ "${burpFree}" != "false" ] && xfconf-query -n -c xfce4-panel -p /plugins/plugin-5 -t string -s launcher # burpsuite ID: 14470234962
  815. xfconf-query -n -c xfce4-panel -p /plugins/plugin-6 -t string -s launcher # iceweasel ID: 13684522587
  816. xfconf-query -n -c xfce4-panel -p /plugins/plugin-8 -t string -s launcher # geany ID: 13684522859 (geany gets installed later)
  817. xfconf-query -n -c xfce4-panel -p /plugins/plugin-9 -t string -s launcher # search ID: 136845425410
  818. xfconf-query -n -c xfce4-panel -p /plugins/plugin-10 -t string -s tasklist
  819. xfconf-query -n -c xfce4-panel -p /plugins/plugin-11 -t string -s separator
  820. xfconf-query -n -c xfce4-panel -p /plugins/plugin-13 -t string -s mixer # audio
  821. xfconf-query -n -c xfce4-panel -p /plugins/plugin-15 -t string -s systray
  822. xfconf-query -n -c xfce4-panel -p /plugins/plugin-16 -t string -s actions
  823. xfconf-query -n -c xfce4-panel -p /plugins/plugin-17 -t string -s clock
  824. xfconf-query -n -c xfce4-panel -p /plugins/plugin-19 -t string -s pager
  825. xfconf-query -n -c xfce4-panel -p /plugins/plugin-20 -t string -s showdesktop
  826. # application menu
  827. xfconf-query -n -c xfce4-panel -p /plugins/plugin-1/show-tooltips -t bool -s true
  828. xfconf-query -n -c xfce4-panel -p /plugins/plugin-1/show-button-title -t bool -s false
  829. # terminal
  830. xfconf-query -n -c xfce4-panel -p /plugins/plugin-2/items -t string -s "13684522758.desktop" -a
  831. # places
  832. xfconf-query -n -c xfce4-panel -p /plugins/plugin-3/mount-open-volumes -t bool -s true
  833. # wireshark
  834. xfconf-query -n -c xfce4-panel -p /plugins/plugin-4/items -t string -s "14470234761.desktop" -a
  835. # burp
  836. [ "${burpFree}" != "false" ] && xfconf-query -n -c xfce4-panel -p /plugins/plugin-5/items -t string -s "14470234962.desktop" -a
  837. # iceweasel
  838. xfconf-query -n -c xfce4-panel -p /plugins/plugin-6/items -t string -s "13684522587.desktop" -a
  839. # geany
  840. xfconf-query -n -c xfce4-panel -p /plugins/plugin-8/items -t string -s "13684522859.desktop" -a
  841. # search
  842. xfconf-query -n -c xfce4-panel -p /plugins/plugin-9/items -t string -s "136845425410.desktop" -a
  843. # tasklist (& separator - required for padding)
  844. xfconf-query -n -c xfce4-panel -p /plugins/plugin-10/show-labels -t bool -s true
  845. xfconf-query -n -c xfce4-panel -p /plugins/plugin-10/show-handle -t bool -s false
  846. xfconf-query -n -c xfce4-panel -p /plugins/plugin-11/style -t int -s 0
  847. xfconf-query -n -c xfce4-panel -p /plugins/plugin-11/expand -t bool -s true
  848. # systray
  849. xfconf-query -n -c xfce4-panel -p /plugins/plugin-15/show-frame -t bool -s false
  850. # actions
  851. xfconf-query -n -c xfce4-panel -p /plugins/plugin-16/appearance -t int -s 1
  852. xfconf-query -n -c xfce4-panel -p /plugins/plugin-16/items -t string -s "+logout-dialog" -t string -s "-switch-user" -t string -s "-separator" -t string -s "-logout" -t string -s "+lock-screen" -t string -s "+hibernate" -t string -s "+suspend" -t string -s "+restart" -t string -s "+shutdown" -a
  853. # clock
  854. xfconf-query -n -c xfce4-panel -p /plugins/plugin-17/show-frame -t bool -s false
  855. xfconf-query -n -c xfce4-panel -p /plugins/plugin-17/mode -t int -s 2
  856. xfconf-query -n -c xfce4-panel -p /plugins/plugin-17/digital-format -t string -s "%R, %Y-%m-%d"
  857. # pager / workspace
  858. xfconf-query -n -c xfce4-panel -p /plugins/plugin-19/miniature-view -t bool -s true
  859. xfconf-query -n -c xfce4-panel -p /plugins/plugin-19/rows -t int -s 1
  860. xfconf-query -n -c xfwm4 -p /general/workspace_count -t int -s 3
  861. #--- Theme options
  862. xfconf-query -n -c xsettings -p /Net/ThemeName -s "Kali-X"
  863. xfconf-query -n -c xsettings -p /Net/IconThemeName -s "Vibrancy-Kali"
  864. xfconf-query -n -c xsettings -p /Gtk/MenuImages -t bool -s true
  865. xfconf-query -n -c xfce4-panel -p /plugins/plugin-1/button-icon -t string -s "kali-menu"
  866. #--- Window management
  867. xfconf-query -n -c xfwm4 -p /general/snap_to_border -t bool -s true
  868. xfconf-query -n -c xfwm4 -p /general/snap_to_windows -t bool -s true
  869. xfconf-query -n -c xfwm4 -p /general/wrap_windows -t bool -s false
  870. xfconf-query -n -c xfwm4 -p /general/wrap_workspaces -t bool -s false
  871. xfconf-query -n -c xfwm4 -p /general/click_to_focus -t bool -s false
  872. #--- TouchPad
  873. #xfconf-query -n -c pointers -p /SynPS2_Synaptics_TouchPad/Properties/Synaptics_Edge_Scrolling -t int -s 0 -t int -s 0 -t int -s 0
  874. #xfconf-query -n -c pointers -p /SynPS2_Synaptics_TouchPad/Properties/Synaptics_Tap_Action -t int -s 0 -t int -s 0 -t int -s 0 -t int -s 0 -t int -s 0 -t int -s 0 -t int -s 0
  875. #xfconf-query -n -c pointers -p /SynPS2_Synaptics_TouchPad/Properties/Synaptics_Two-Finger_Scrolling -t int -s 1 -t int -s 1
  876. xfconf-query -n -c xfwm4 -p /general/click_to_focus -t bool -s true
  877. #--- Hide icons
  878. xfconf-query -n -c xfce4-desktop -p /desktop-icons/file-icons/show-filesystem -t bool -s false
  879. xfconf-query -n -c xfce4-desktop -p /desktop-icons/file-icons/show-home -t bool -s false
  880. xfconf-query -n -c xfce4-desktop -p /desktop-icons/file-icons/show-trash -t bool -s false
  881. xfconf-query -n -c xfce4-desktop -p /desktop-icons/file-icons/show-removable -t bool -s false
  882. #--- Start and exit values
  883. xfconf-query -n -c xfce4-session -p /splash/Engine -t string -s ""
  884. xfconf-query -n -c xfce4-session -p /shutdown/LockScreen -t bool -s true
  885. xfconf-query -n -c xfce4-session -p /general/SaveOnExit -t bool -s false
  886. #--- Power options
  887. #xfconf-query -n -c xfce4-power-manager -p /xfce4-power-manager/lid-action-on-ac -t int -s 1
  888. #xfconf-query -n -c xfce4-power-manager -p /xfce4-power-manager/lid-action-on-battery -t int -s 1
  889. #--- App Finder
  890. xfconf-query -n -c xfce4-appfinder -p /last/pane-position -t int -s 248
  891. xfconf-query -n -c xfce4-appfinder -p /last/window-height -t int -s 742
  892. xfconf-query -n -c xfce4-appfinder -p /last/window-width -t int -s 648
  893. #--- Remove Mail Reader from menu
  894. file=/usr/share/applications/exo-mail-reader.desktop #; [ -e "${file}" ] && cp -n $file{,.bkup}
  895. sed -i 's/^NotShowIn=*/NotShowIn=XFCE;/; s/^OnlyShowIn=XFCE;/OnlyShowIn=/' "${file}"
  896. grep -q "NotShowIn=XFCE" "${file}" || echo "NotShowIn=XFCE;" >> "${file}"
  897. #--- Enable compositing
  898. xfconf-query -n -c xfwm4 -p /general/use_compositing -t bool -s true
  899. xfconf-query -n -c xfwm4 -p /general/frame_opacity -t int -s 85
  900.  
  901.  
  902. ##### Configure XFCE4
  903. echo -e "\n ${GREEN}[+]${RESET} Configuring ${GREEN}XFCE4${RESET}${RESET} ~ desktop environment"
  904. #--- Disable user folders
  905. apt-get -y -qq install xdg-user-dirs || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  906. xdg-user-dirs-update
  907. file=/etc/xdg/user-dirs.conf; [ -e "${file}" ] && cp -n $file{,.bkup}
  908. sed -i 's/^enable=.*/enable=False/' "${file}" #sed -i 's/^XDG_/#XDG_/; s/^#XDG_DESKTOP/XDG_DESKTOP/;' ~/.config/user-dirs.dirs
  909. find ~/ -maxdepth 1 -mindepth 1 \( -name 'Documents' -o -name 'Music' -o -name 'Pictures' -o -name 'Public' -o -name 'Templates' -o -name 'Videos' \) -type d -empty -delete
  910. xdg-user-dirs-update
  911. #--- XFCE fixes for default applications
  912. mkdir -p ~/.local/share/applications/
  913. file=~/.local/share/applications/mimeapps.list; [ -e "${file}" ] && cp -n $file{,.bkup}
  914. [ ! -e "${file}" ] && echo '[Added Associations]' > "${file}"
  915. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  916. for VALUE in file trash; do
  917. sed -i 's#x-scheme-handler/'${VALUE}'=.*#x-scheme-handler/'${VALUE}'=exo-file-manager.desktop#' "${file}"
  918. grep -q '^x-scheme-handler/'${VALUE}'=' "${file}" 2>/dev/null || echo 'x-scheme-handler/'${VALUE}'=exo-file-manager.desktop' >> "${file}"
  919. done
  920. for VALUE in http https; do
  921. sed -i 's#^x-scheme-handler/'${VALUE}'=.*#x-scheme-handler/'${VALUE}'=exo-web-browser.desktop#' "${file}"
  922. grep -q '^x-scheme-handler/'${VALUE}'=' "${file}" 2>/dev/null || echo 'x-scheme-handler/'${VALUE}'=exo-web-browser.desktop' >> "${file}"
  923. done
  924. [[ $(tail -n 1 "${file}") != "" ]] && echo >> "${file}"
  925. file=~/.config/xfce4/helpers.rc; [ -e "${file}" ] && cp -n $file{,.bkup} #exo-preferred-applications #xdg-mime default
  926. sed -i 's#^FileManager=.*#FileManager=Thunar#' "${file}" 2>/dev/null
  927. grep -q '^FileManager=Thunar' "${file}" 2>/dev/null || echo 'FileManager=Thunar' >> "${file}"
  928. #--- Configure file browser - Thunar (need to re-login for effect)
  929. mkdir -p ~/.config/Thunar/
  930. file=~/.config/Thunar/thunarrc; [ -e "${file}" ] && cp -n $file{,.bkup}
  931. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  932. sed -i 's/LastShowHidden=.*/LastShowHidden=TRUE/' "${file}" 2>/dev/null || echo -e "[Configuration]\nLastShowHidden=TRUE" > ~/.config/Thunar/thunarrc;
  933. #--- XFCE fixes for GNOME Terminator (We do this later)
  934. #mkdir -p ~/.local/share/xfce4/helpers/
  935. #file=~/.local/share/xfce4/helpers/custom-TerminalEmulator.desktop; [ -e "${file}" ] && cp -n $file{,.bkup}
  936. #sed -i 's#^X-XFCE-CommandsWithParameter=.*#X-XFCE-CommandsWithParameter=/usr/bin/terminator --command="%s"#' "${file}" 2>/dev/null || cat <<EOF > "${file}"
  937. #[Desktop Entry]
  938. #NoDisplay=true
  939. #Version=1.0
  940. #Encoding=UTF-8
  941. #Type=X-XFCE-Helper
  942. #X-XFCE-Category=TerminalEmulator
  943. #X-XFCE-CommandsWithParameter=/usr/bin/terminator --command="%s"
  944. #Icon=terminator
  945. #Name=terminator
  946. #X-XFCE-Commands=/usr/bin/terminator
  947. #EOF
  948. #file=~/.config/xfce4/helpers.rc; [ -e "${file}" ] && cp -n $file{,.bkup} #exo-preferred-applications #xdg-mime default
  949. #sed -i 's#^TerminalEmulator=.*#TerminalEmulator=custom-TerminalEmulator#' "${file}"
  950. #grep -q '^TerminalEmulator=custom-TerminalEmulator' "${file}" 2>/dev/null || echo 'TerminalEmulator=custom-TerminalEmulator' >> "${file}"
  951. #--- XFCE fixes for Iceweasel (We do this later)
  952. #file=~/.config/xfce4/helpers.rc; [ -e "${file}" ] && cp -n $file{,.bkup} #exo-preferred-applications #xdg-mime default
  953. #sed -i 's#^WebBrowser=.*#WebBrowser=iceweasel#' "${file}"
  954. #grep -q '^WebBrowser=iceweasel' "${file}" 2>/dev/null || echo 'WebBrowser=iceweasel' >> "${file}"
  955. #--- Fix GNOME keyring issue
  956. file=/etc/xdg/autostart/gnome-keyring-pkcs11.desktop; #[ -e "${file}" ] && cp -n $file{,.bkup}
  957. grep -q "XFCE" "${file}" || sed -i 's/^OnlyShowIn=*/OnlyShowIn=XFCE;/' "${file}"
  958. #--- Disable tracker (issue is, enables it in GNOME)
  959. tracker-control -r
  960. mkdir -p ~/.config/autostart/
  961. rm -f ~/.config/autostart/tracker-*.desktop
  962. rm -f /etc/xdg/autostart/tracker-*.desktop
  963. #--- Set XFCE as default desktop manager
  964. file=~/.xsession; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.xsession
  965. echo xfce4-session > "${file}"
  966. #--- Enable num lock at start up (might not be smart if you're using a smaller keyboard (laptop?)) ~ https://wiki.xfce.org/faq
  967. #xfconf-query -n -c keyboards -p /Default/Numlock -t bool -s true
  968. apt-get -y -qq install numlockx || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  969. file=/etc/xdg/xfce4/xinitrc; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/rc.local
  970. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  971. grep -q '^/usr/bin/numlockx' "${file}" 2>/dev/null || echo "/usr/bin/numlockx on" >> "${file}"
  972. #--- Add keyboard shortcut (CTRL+SPACE) to open Application Finder
  973. file=~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml #; [ -e "${file}" ] && cp -n $file{,.bkup}
  974. grep -q '<property name="&lt;Primary&gt;space" type="string" value="xfce4-appfinder"/>' "${file}" || sed -i 's#<property name="\&lt;Alt\&gt;F2" type="string" value="xfrun4"/>#<property name="\&lt;Alt\&gt;F2" type="string" value="xfrun4"/>\n <property name="\&lt;Primary\&gt;space" type="string" value="xfce4-appfinder"/>#' "${file}"
  975. #--- Add keyboard shortcut (CTRL+ALT+t) to start a terminal window
  976. file=~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml #; [ -e "${file}" ] && cp -n $file{,.bkup}
  977. grep -q '<property name="&lt;Primary&gt;&lt;Alt&gt;t" type="string" value="/usr/bin/exo-open --launch TerminalEmulator"/>' "${file}" || sed -i 's#<property name="\&lt;Alt\&gt;F2" type="string" value="xfrun4"/>#<property name="\&lt;Alt\&gt;F2" type="string" value="xfrun4"/>\n <property name="\&lt;Primary\&gt;\&lt;Alt\&gt;t" type="string" value="/usr/bin/exo-open --launch TerminalEmulator"/>#' "${file}"
  978. #--- Create Conky refresh script (conky gets installed later)
  979. file=/usr/local/bin/conky-refresh; [ -e "${file}" ] && cp -n $file{,.bkup}
  980. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  981. #!/bin/bash
  982.  
  983. /usr/bin/timeout 5 /usr/bin/killall -9 -q -w conky
  984. /usr/bin/conky &
  985. EOF
  986. chmod -f 0500 "${file}"
  987. #--- Add keyboard shortcut (CTRL+r) to run the conky refresh script
  988. file=~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml #; [ -e "${file}" ] && cp -n $file{,.bkup}
  989. grep -q '<property name="&lt;Primary&gt;r" type="string" value="/usr/local/bin/conky-refresh"/>' "${file}" || sed -i 's#<property name="\&lt;Alt\&gt;F2" type="string" value="xfrun4"/>#<property name="\&lt;Alt\&gt;F2" type="string" value="xfrun4"/>\n <property name="\&lt;Primary\&gt;r" type="string" value="/usr/local/bin/conky-refresh"/>#' "${file}"
  990. #--- Remove any old sessions
  991. rm -f ~/.cache/sessions/*
  992. #--- Reload XFCE
  993. #/usr/bin/xfdesktop --reload
  994.  
  995.  
  996. ##### Cosmetics (themes & wallpapers)
  997. echo -e "\n ${GREEN}[+]${RESET} ${GREEN}Cosmetics${RESET}${RESET} ~ Making it different each startup"
  998. mkdir -p ~/.themes/
  999. export DISPLAY=:0.0 #[[ -z $SSH_CONNECTION ]] || export DISPLAY=:0.0
  1000. #--- shiki-colors-light v1.3 XFCE4 theme
  1001. timeout 300 curl --progress -k -L -f "http://xfce-look.org/CONTENT/content-files/142110-Shiki-Colors-Light-Menus.tar.gz" > /tmp/Shiki-Colors-Light-Menus.tar.gz || echo -e ' '${RED}'[!]'${RESET}" Issue downloading Shiki-Colors-Light-Menus.tar.gz" 1>&2 #***!!! hardcoded path!
  1002. tar -zxf /tmp/Shiki-Colors-Light-Menus.tar.gz -C ~/.themes/
  1003. #xfconf-query -n -c xsettings -p /Net/ThemeName -s "Shiki-Colors-Light-Menus"
  1004. #xfconf-query -n -c xsettings -p /Net/IconThemeName -s "Vibrancy-Kali-Dark"
  1005. #--- axiom / axiomd (May 18 2010) XFCE4 theme
  1006. timeout 300 curl --progress -k -L -f "http://xfce-look.org/CONTENT/content-files/90145-axiom.tar.gz" > /tmp/axiom.tar.gz || echo -e ' '${RED}'[!]'${RESET}" Issue downloading axiom.tar.gz" 1>&2 #***!!! hardcoded path!
  1007. tar -zxf /tmp/axiom.tar.gz -C ~/.themes/
  1008. xfconf-query -n -c xsettings -p /Net/ThemeName -s "axiomd"
  1009. xfconf-query -n -c xsettings -p /Net/IconThemeName -s "Vibrancy-Kali-Dark"
  1010. #--- Get new desktop wallpaper
  1011. mkdir -p /usr/share/wallpapers/
  1012. timeout 300 curl --progress -k -L -f "http://www.kali.org/images/wallpapers-01/kali-wp-june-2014_1920x1080_A.png" > /usr/share/wallpapers/kali_blue_3d_a.png || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_blue_3d_a.png" 1>&2 #***!!! hardcoded paths!
  1013. timeout 300 curl --progress -k -L -f "http://www.kali.org/images/wallpapers-01/kali-wp-june-2014_1920x1080_B.png" > /usr/share/wallpapers/kali_blue_3d_b.png || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_blue_3d_b.png" 1>&2
  1014. timeout 300 curl --progress -k -L -f "http://www.kali.org/images/wallpapers-01/kali-wp-june-2014_1920x1080_G.png" > /usr/share/wallpapers/kali_black_honeycomb.png || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_black_honeycomb.png" 1>&2
  1015. timeout 300 curl --progress -k -L -f "http://imageshack.us/a/img17/4646/vzex.png" > /usr/share/wallpapers/kali_blue_splat.png || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_blue_splat.png" 1>&2
  1016. timeout 300 curl --progress -k -L -f "http://wallpaperstock.net/kali-linux_wallpapers_39530_1920x1080.jpg" > /usr/share/wallpapers/kali-linux_wallpapers_39530.png || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali-linux_wallpapers_39530.png" 1>&2
  1017. timeout 300 curl --progress -k -L -f "http://em3rgency.com/wp-content/uploads/2012/12/Kali-Linux-faded-no-Dragon-small-text.png" > /usr/share/wallpapers/kali_black_clean.png || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_black_clean.png" 1>&2
  1018. timeout 300 curl --progress -k -L -f "http://www.hdwallpapers.im/download/kali_linux-wallpaper.jpg" > /usr/share/wallpapers/kali_black_stripes.jpg || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_black_stripes.jpg" 1>&2
  1019. timeout 300 curl --progress -k -L -f "http://fc01.deviantart.net/fs71/f/2011/118/e/3/bt___edb_wallpaper_by_xxdigipxx-d3f4nxv.png" > /usr/share/wallpapers/kali_bt_edb.jpg || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_bt_edb.jpg" 1>&2
  1020. timeout 300 curl --progress -k -L -f "http://pre07.deviantart.net/58d1/th/pre/i/2015/223/4/8/kali_2_0_alternate_wallpaper_by_xxdigipxx-d95800s.png" > /usr/share/wallpapers/kali_2_0_alternate_wallpaper.png || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_2_0_alternate_wallpaper.png" 1>&2
  1021. timeout 300 curl --progress -k -L -f "http://pre01.deviantart.net/4210/th/pre/i/2015/195/3/d/kali_2_0__personal__wp_by_xxdigipxx-d91c8dq.png" > /usr/share/wallpapers/kali_2_0__personal.png || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_2_0__personal.png" 1>&2
  1022. _TMP="$(find /usr/share/wallpapers/ -maxdepth 1 -type f \( -name 'kali_*' -o -empty \) | xargs -n1 file | grep -i 'HTML\|empty' | cut -d ':' -f1)"
  1023. for FILE in $(echo ${_TMP}); do rm -f "${FILE}"; done
  1024. [[ -e "/usr/share/wallpapers/kali_default-1440x900.jpg" ]] && ln -sf /usr/share/wallpapers/kali/contents/images/1440x900.png /usr/share/wallpapers/kali_default-1440x900.jpg # Kali1
  1025. [[ -e "/usr/share/images/desktop-base/kali-wallpaper_1920x1080.png" ]] && ln -sf /usr/share/images/desktop-base/kali-wallpaper_1920x1080.png /usr/share/wallpapers/kali_default2.0-1920x1080.jpg # Kali2
  1026. [[ -e "/usr/share/gnome-shell/theme/KaliLogin.png" ]] && cp -f /usr/share/gnome-shell/theme/KaliLogin.png /usr/share/wallpapers/KaliLogin2.0-login.jpg # Kali2
  1027. #--- Change desktop wallpaper (single random pick - on each install). Note: For now...
  1028. wallpaper=$(shuf -n1 -e /usr/share/wallpapers/kali_*) #wallpaper=/usr/share/wallpapers/kali_blue_splat.png
  1029. xfconf-query -n -c xfce4-desktop -p /backdrop/screen0/monitor0/image-show -t bool -s true
  1030. xfconf-query -n -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path - string -s "${wallpaper}" # XFCE
  1031. dconf write /org/gnome/desktop/background/picture-uri "'file://${wallpaper}'" # GNOME
  1032. #--- Change login wallpaper
  1033. dconf write /org/gnome/desktop/screensaver/picture-uri "'file://${wallpaper}'" # Change lock wallpaper (before swipe)
  1034. cp -f "${wallpaper}" /usr/share/gnome-shell/theme/KaliLogin.png # Change login wallpaper (after swipe)
  1035. #--- New wallpaper - add to startup (random each login)
  1036. file=/usr/local/bin/rand-wallpaper; [ -e "${file}" ] && cp -n $file{,.bkup}
  1037. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  1038. #!/bin/bash
  1039.  
  1040. wallpaper="\$(shuf -n1 -e \$(find /usr/share/wallpapers/ -maxdepth 1 -type f -name 'kali_*'))"
  1041. /usr/bin/xfconf-query -n -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -t string -s \${wallpaper}
  1042. /usr/bin/dconf write /org/gnome/desktop/screensaver/picture-uri "'file://\${wallpaper}'" # Change lock wallpaper (before swipe)
  1043. cp -f "\${wallpaper}" /usr/share/gnome-shell/theme/KaliLogin.png # Change login wallpaper (after swipe)
  1044. /usr/bin/xfdesktop --reload 2>/dev/null
  1045. EOF
  1046. chmod -f 0500 "${file}"
  1047. mkdir -p ~/.config/autostart/
  1048. file=~/.config/autostart/wallpaper.desktop; [ -e "${file}" ] && cp -n $file{,.bkup}
  1049. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  1050. [Desktop Entry]
  1051. Type=Application
  1052. Exec=/usr/local/bin/rand-wallpaper
  1053. Hidden=false
  1054. NoDisplay=false
  1055. X-GNOME-Autostart-enabled=true
  1056. Name=wallpaper
  1057. EOF
  1058. #--- Remove old temp files
  1059. rm -f /tmp/Shiki-Colors-Light-Menus.tar* /tmp/axiom.tar*
  1060.  
  1061.  
  1062. ##### Configure file Note: need to restart xserver for effect
  1063. echo -e "\n ${GREEN}[+]${RESET} Configuring ${GREEN}file${RESET} (Nautilus/Thunar) ~ GUI file system navigation"
  1064. mkdir -p ~/.config/gtk-2.0/
  1065. file=~/.config/gtk-2.0/gtkfilechooser.ini; [ -e "${file}" ] && cp -n $file{,.bkup}
  1066. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1067. sed -i 's/^.*ShowHidden.*/ShowHidden=true/' "${file}" 2>/dev/null || cat <<EOF > "${file}"
  1068. [Filechooser Settings]
  1069. LocationMode=path-bar
  1070. ShowHidden=true
  1071. ExpandFolders=false
  1072. ShowSizeColumn=true
  1073. GeometryX=66
  1074. GeometryY=39
  1075. GeometryWidth=780
  1076. GeometryHeight=618
  1077. SortColumn=name
  1078. SortOrder=ascending
  1079. EOF
  1080. dconf write /org/gnome/nautilus/preferences/show-hidden-files true
  1081. file=/root/.gtk-bookmarks; [ -e "${file}" ] && cp -n $file{,.bkup}
  1082. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1083. grep -q '^file:///root/Downloads ' "${file}" 2>/dev/null || echo 'file:///root/Downloads Downloads' >> "${file}"
  1084. (dmidecode | grep -iq vmware) && (mkdir -p /mnt/hgfs/ 2>/dev/null; grep -q '^file:///mnt/hgfs ' "${file}" 2>/dev/null || echo 'file:///mnt/hgfs VMShare' >> "${file}")
  1085. grep -q '^file:///tmp ' "${file}" 2>/dev/null || echo 'file:///tmp TMP' >> "${file}"
  1086. grep -q '^file:///usr/share ' "${file}" 2>/dev/null || echo 'file:///usr/share Kali Tools' >> "${file}"
  1087. grep -q '^file:///opt ' "${file}" 2>/dev/null || echo 'file:///opt Tools' >> "${file}"
  1088. grep -q '^file:///usr/local/src ' "${file}" 2>/dev/null || echo 'file:///usr/local/src SRC' >> "${file}"
  1089. grep -q '^file:///var/ftp ' "${file}" 2>/dev/null || echo 'file:///var/ftp FTP' >> "${file}"
  1090. grep -q '^file:///var/samba ' "${file}" 2>/dev/null || echo 'file:///var/samba Samba' >> "${file}"
  1091. grep -q '^file:///var/tftp ' "${file}" 2>/dev/null || echo 'file:///var/tftp TFTP' >> "${file}"
  1092. grep -q '^file:///var/www/html ' "${file}" 2>/dev/null || echo 'file:///var/www/html WWW' >> "${file}"
  1093.  
  1094.  
  1095. ##### Configure GNOME terminal Note: need to restart xserver for effect
  1096. echo -e "\n ${GREEN}[+]${RESET} Configuring GNOME ${GREEN}terminal${RESET} ~ CLI interface"
  1097. gconftool-2 -t bool -s /apps/gnome-terminal/profiles/Default/scrollback_unlimited true # Terminal -> Edit -> Profile Preferences -> Scrolling -> Scrollback: Unlimited -> Close
  1098. gconftool-2 -t string -s /apps/gnome-terminal/profiles/Default/background_darkness 0.85611499999999996 # Not working 100%!
  1099. gconftool-2 -t string -s /apps/gnome-terminal/profiles/Default/background_type transparent
  1100.  
  1101.  
  1102. ##### Configure bash - all users
  1103. echo -e "\n ${GREEN}[+]${RESET} Configuring ${GREEN}bash${RESET} ~ CLI shell"
  1104. file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.bashrc
  1105. grep -q "cdspell" "${file}" || echo "shopt -sq cdspell" >> "${file}" # Spell check 'cd' commands
  1106. grep -q "checkwinsize" "${file}" || echo "shopt -sq checkwinsize" >> "${file}" # Wrap lines correctly after resizing
  1107. grep -q "nocaseglob" "${file}" || echo "shopt -sq nocaseglob" >> "${file}" # Case insensitive pathname expansion
  1108. grep -q "HISTSIZE" "${file}" || echo "HISTSIZE=10000" >> "${file}" # Bash history (memory scroll back)
  1109. grep -q "HISTFILESIZE" "${file}" || echo "HISTFILESIZE=10000" >> "${file}" # Bash history (file .bash_history)
  1110. #--- Apply new configs
  1111. if [[ "${SHELL}" == "/bin/zsh" ]]; then source ~/.zshrc else source "${file}"; fi
  1112.  
  1113.  
  1114. ##### Install bash colour - all users
  1115. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}bash colour${RESET} ~ colours shell output"
  1116. file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.bashrc
  1117. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1118. sed -i 's/.*force_color_prompt=.*/force_color_prompt=yes/' "${file}"
  1119. grep -q '^force_color_prompt' "${file}" 2>/dev/null || echo 'force_color_prompt=yes' >> "${file}"
  1120. sed -i 's#PS1='"'"'.*'"'"'#PS1='"'"'${debian_chroot:+($debian_chroot)}\\[\\033\[01;31m\\]\\u@\\h\\\[\\033\[00m\\]:\\[\\033\[01;34m\\]\\w\\[\\033\[00m\\]\\$ '"'"'#' "${file}"
  1121. grep -q "^export LS_OPTIONS='--color=auto'" "${file}" 2>/dev/null || echo "export LS_OPTIONS='--color=auto'" >> "${file}"
  1122. grep -q '^eval "$(dircolors)"' "${file}" 2>/dev/null || echo 'eval "$(dircolors)"' >> "${file}"
  1123. grep -q "^alias ls='ls $LS_OPTIONS'" "${file}" 2>/dev/null || echo "alias ls='ls $LS_OPTIONS'" >> "${file}"
  1124. grep -q "^alias ll='ls $LS_OPTIONS -l'" "${file}" 2>/dev/null || echo "alias ll='ls $LS_OPTIONS -l'" >> "${file}"
  1125. grep -q "^alias l='ls $LS_OPTIONS -lA'" "${file}" 2>/dev/null || echo "alias l='ls $LS_OPTIONS -lA'" >> "${file}"
  1126. #--- All other users that are made afterwards
  1127. file=/etc/skel/.bashrc #; [ -e "${file}" ] && cp -n $file{,.bkup}
  1128. sed -i 's/.*force_color_prompt=.*/force_color_prompt=yes/' "${file}"
  1129. #--- Apply new configs
  1130. if [[ "${SHELL}" == "/bin/zsh" ]]; then source ~/.zshrc else source "${file}"; fi
  1131.  
  1132.  
  1133. ##### Install grc
  1134. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}grc${RESET} ~ colours shell output"
  1135. apt-get -y -qq install grc || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1136. #--- Setup aliases
  1137. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  1138. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1139. grep -q '^## grc diff alias' "${file}" 2>/dev/null || echo -e "## grc diff alias\nalias diff='$(which grc) $(which diff)'\n" >> "${file}"
  1140. grep -q '^## grc dig alias' "${file}" 2>/dev/null || echo -e "## grc dig alias\nalias dig='$(which grc) $(which dig)'\n" >> "${file}"
  1141. grep -q '^## grc gcc alias' "${file}" 2>/dev/null || echo -e "## grc gcc alias\nalias gcc='$(which grc) $(which gcc)'\n" >> "${file}"
  1142. grep -q '^## grc ifconfig alias' "${file}" 2>/dev/null || echo -e "## grc ifconfig alias\nalias ifconfig='$(which grc) $(which ifconfig)'\n" >> "${file}"
  1143. grep -q '^## grc mount alias' "${file}" 2>/dev/null || echo -e "## grc mount alias\nalias mount='$(which grc) $(which mount)'\n" >> "${file}"
  1144. #grep -q '^## grc mount alias' "${file}" 2>/dev/null || echo -e "## grc mount alias\nalias mount='$(which grc) $(which mount) | $(whereis column -t)'\n" >> "${file}"
  1145. grep -q '^## grc netstat alias' "${file}" 2>/dev/null || echo -e "## grc netstat alias\nalias netstat='$(which grc) $(which netstat)'\n" >> "${file}"
  1146. grep -q '^## grc ping alias' "${file}" 2>/dev/null || echo -e "## grc ping alias\nalias ping='$(which grc) $(which ping)'\n" >> "${file}"
  1147. grep -q '^## grc ps alias' "${file}" 2>/dev/null || echo -e "## grc ps alias\nalias ps='$(which grc) $(which ps)'\n" >> "${file}"
  1148. grep -q '^## grc tail alias' "${file}" 2>/dev/null || echo -e "## grc tail alias\nalias tail='$(which grc) $(which tail)'\n" >> "${file}"
  1149. grep -q '^## grc traceroute alias' "${file}" 2>/dev/null || echo -e "## grc traceroute alias\nalias traceroute='$(which grc) $(which traceroute)'\n" >> "${file}"
  1150. grep -q '^## grc wdiff alias' "${file}" 2>/dev/null || echo -e "## grc wdiff alias\nalias wdiff='$(which grc) $(which wdiff)'\n" >> "${file}"
  1151. #configure #esperanto #ldap #e #cvs #log #mtr #ls #irclog #mount2
  1152. #--- Apply new aliases
  1153. if [[ "${SHELL}" == "/bin/zsh" ]]; then source ~/.zshrc else source "${file}"; fi
  1154.  
  1155.  
  1156. ##### Install bash completion - all users
  1157. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}bash completion${RESET} ~ tab complete CLI commands"
  1158. apt-get -y -qq install bash-completion || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1159. file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.bashrc
  1160. sed -i '/# enable bash completion in/,+7{/enable bash completion/!s/^#//}' "${file}"
  1161. #--- Apply new configs
  1162. if [[ "${SHELL}" == "/bin/zsh" ]]; then source ~/.zshrc else source "${file}"; fi
  1163.  
  1164.  
  1165. ##### Configure aliases - root user
  1166. echo -e "\n ${GREEN}[+]${RESET} Configuring ${GREEN}aliases${RESET} ~ CLI shortcuts"
  1167. #--- Enable defaults - root user
  1168. for FILE in /etc/bash.bashrc ~/.bashrc ~/.bash_aliases; do #/etc/profile /etc/bashrc /etc/bash_aliases /etc/bash.bash_aliases
  1169. [[ ! -f "${FILE}" ]] && continue
  1170. cp -n $FILE{,.bkup}
  1171. sed -i 's/#alias/alias/g' "${FILE}"
  1172. done
  1173. #--- General system ones
  1174. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  1175. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1176. grep -q '^## grep aliases' "${file}" 2>/dev/null || echo -e '## grep aliases\nalias grep="grep --color=always"\nalias ngrep="grep -n"\n' >> "${file}"
  1177. grep -q '^alias egrep=' "${file}" 2>/dev/null || echo -e 'alias egrep="egrep --color=auto"\n' >> "${file}"
  1178. grep -q '^alias fgrep=' "${file}" 2>/dev/null || echo -e 'alias fgrep="fgrep --color=auto"\n' >> "${file}"
  1179. #--- Add in ours (OS programs)
  1180. grep -q '^alias tmux' "${file}" 2>/dev/null || echo -e '## tmux\nalias tmux="tmux attach || tmux new"\n' >> "${file}" #alias tmux="tmux attach -t $HOST || tmux new -s $HOST"
  1181. grep -q '^alias axel' "${file}" 2>/dev/null || echo -e '## axel\nalias axel="axel -a"\n' >> "${file}"
  1182. grep -q '^alias screen' "${file}" 2>/dev/null || echo -e '## screen\nalias screen="screen -xRR"\n' >> "${file}"
  1183. #--- Add in ours (shortcuts)
  1184. grep -q '^## Checksums' "${file}" 2>/dev/null || echo -e '## Checksums\nalias sha1="openssl sha1"\nalias md5="openssl md5"\n' >> "${file}"
  1185. grep -q '^## Force create folders' "${file}" 2>/dev/null || echo -e '## Force create folders\nalias mkdir="/bin/mkdir -pv"\n' >> "${file}"
  1186. #grep -q '^## Mount' "${file}" 2>/dev/null || echo -e '## Mount\nalias mount="mount | column -t"\n' >> "${file}"
  1187. grep -q '^## List open ports' "${file}" 2>/dev/null || echo -e '## List open ports\nalias ports="netstat -tulanp"\n' >> "${file}"
  1188. grep -q '^## Get header' "${file}" 2>/dev/null || echo -e '## Get header\nalias header="curl -I"\n' >> "${file}"
  1189. grep -q '^## Get external IP address' "${file}" 2>/dev/null || echo -e '## Get external IP address\nalias ipx="curl -s http://ipinfo.io/ip"\n' >> "${file}"
  1190. grep -q '^## DNS - External IP #1' "${file}" 2>/dev/null || echo -e '## DNS - External IP #1\nalias dns1="dig +short @resolver1.opendns.com myip.opendns.com"\n' >> "${file}"
  1191. grep -q '^## DNS - External IP #2' "${file}" 2>/dev/null || echo -e '## DNS - External IP #2\nalias dns2="dig +short @208.67.222.222 myip.opendns.com"\n' >> "${file}"
  1192. grep -q '^## DNS - Check' "${file}" 2>/dev/null || echo -e '### DNS - Check ("#.abc" is Okay)\nalias dns3="dig +short @208.67.220.220 which.opendns.com txt"\n' >> "${file}"
  1193. grep -q '^## Directory navigation aliases' "${file}" 2>/dev/null || echo -e '## Directory navigation aliases\nalias ..="cd .."\nalias ...="cd ../.."\nalias ....="cd ../../.."\nalias .....="cd ../../../.."\n' >> "${file}"
  1194. grep -q '^## Extract file' "${file}" 2>/dev/null || echo -e '## Extract file, example. "ex package.tar.bz2"\nex() {\n if [[ -f $1 ]]; then\n case $1 in\n *.tar.bz2) tar xjf $1 ;;\n *.tar.gz) tar xzf $1 ;;\n *.bz2) bunzip2 $1 ;;\n *.rar) rar x $1 ;;\n *.gz) gunzip $1 ;;\n *.tar) tar xf $1 ;;\n *.tbz2) tar xjf $1 ;;\n *.tgz) tar xzf $1 ;;\n *.zip) unzip $1 ;;\n *.Z) uncompress $1 ;;\n *.7z) 7z x $1 ;;\n *) echo $1 cannot be extracted ;;\n esac\n else\n echo $1 is not a valid file\n fi\n}\n' >> "${file}"
  1195. grep -q '^## strings' "${file}" 2>/dev/null || echo -e '## strings\nalias strings="strings -a"\n' >> "${file}"
  1196. grep -q '^## history' "${file}" 2>/dev/null || echo -e '## history\nalias hg="history | grep"\n' >> "${file}"
  1197. grep -q '^## Add more aliases' "${file}" 2>/dev/null || echo -e '## Add more aliases\nalias upd="sudo apt-get update"\nalias upg="sudo apt-get upgrade"\nalias ins="sudo apt-get install"\nalias rem="sudo apt-get purge"\nalias fix="sudo apt-get install -f"\n' >> "${file}"
  1198. #alias ll="ls -l --block-size=\'1 --color=auto"
  1199. #--- Add in tools
  1200. grep -q '^## nmap' "${file}" 2>/dev/null || echo -e '## nmap\nalias nmap="nmap --reason --open"\n' >> "${file}"
  1201. grep -q '^## aircrack-ng' "${file}" 2>/dev/null || echo -e '## aircrack-ng\nalias aircrack-ng="aircrack-ng -z"\n' >> "${file}"
  1202. grep -q '^## airodump-ng' "${file}" 2>/dev/null || echo -e '## airodump-ng \nalias airodump-ng="airodump-ng --manufacturer --wps --uptime"\n' >> "${file}" # aircrack-ng 1.2 rc2
  1203. grep -q '^## metasploit' "${file}" 2>/dev/null || echo -e '## metasploit\nalias msfc="systemctl start postgresql; msfdb start; msfconsole -q \"$@\""\nalias msfconsole="systemctl start postgresql; msfdb start; msfconsole \"$@\""\n' >> "${file}"
  1204. [ "${openVAS}" != "false" ] && grep -q '^## openvas' "${file}" 2>/dev/null || echo -e '## openvas\nalias openvas="openvas-stop; openvas-start; sleep 3s; xdg-open https://127.0.0.1:9392/ >/dev/null 2>&1"\n' >> "${file}"
  1205. grep -q '^## mana-toolkit' "${file}" 2>/dev/null || echo -e '## mana-toolkit\nalias mana-toolkit-start="a2ensite 000-mana-toolkit;a2dissite 000-default;systemctl apache2 restart"\n\nalias mana-toolkit-stop="a2dissite 000-mana-toolkit;a2ensite 000-default;systemctl apache2 restart"\n' >> "${file}"
  1206. grep -q '^## ssh' "${file}" 2>/dev/null || echo -e '## ssh\nalias ssh-start="systemctl restart ssh"\nalias ssh-stop="systemctl stop ssh"\n' >> "${file}"
  1207. #airmon-vz --verbose
  1208. #--- Add in folders
  1209. grep -q '^## www' "${file}" 2>/dev/null || echo -e '## www\nalias wwwroot="cd /var/www/html/"\n#alias www="cd /var/www/html/"\n' >> "${file}" # systemctl apache2 start
  1210. grep -q '^## ftp' "${file}" 2>/dev/null || echo -e '## ftp\nalias ftproot="cd /var/ftp/"\n' >> "${file}" # systemctl pure-ftpd start
  1211. grep -q '^## tftp' "${file}" 2>/dev/null || echo -e '## tftp\nalias tftproot="cd /var/tftp/"\n' >> "${file}" # systemctl atftpd start
  1212. grep -q '^## smb' "${file}" 2>/dev/null || echo -e '## smb\nalias sambaroot="cd /var/samba/"\n#alias smbroot="cd /var/samba/"\n' >> "${file}" # systemctl samba start
  1213. (dmidecode | grep -iq vmware) && (grep -q '^## vmware' "${file}" 2>/dev/null || echo -e '## vmware\nalias vmroot="cd /mnt/hgfs/"\n' >> "${file}")
  1214. grep -q '^## edb' "${file}" 2>/dev/null || echo -e '## edb\nalias edb="cd /usr/share/exploitdb/platforms/"\nalias edbroot="cd /usr/share/exploitdb/platforms/"\n' >> "${file}"
  1215. grep -q '^## wordlist' "${file}" 2>/dev/null || echo -e '## wordlist\nalias wordlist="cd /usr/share/wordlists/"\nalias wordls="cd /usr/share/wordlists/"\n' >> "${file}"
  1216. #--- Apply new aliases
  1217. if [[ "${SHELL}" == "/bin/zsh" ]]; then source ~/.zshrc else source "${file}"; fi
  1218. #--- Check
  1219. #alias
  1220.  
  1221.  
  1222. ##### Install GNOME Terminator
  1223. echo -e "\n ${GREEN}[+]${RESET} Installing GNOME ${GREEN}Terminator${RESET} ~ multiple terminals in a single window"
  1224. apt-get -y -qq install terminator || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1225. #--- Configure terminator
  1226. mkdir -p ~/.config/terminator/
  1227. file=~/.config/terminator/config; [ -e "${file}" ] && cp -n $file{,.bkup}
  1228. [ -e "${file}" ] || cat <<EOF > "${file}"
  1229. [global_config]
  1230. enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
  1231. [keybindings]
  1232. [profiles]
  1233. [[default]]
  1234. background_darkness = 0.9
  1235. scroll_on_output = False
  1236. copy_on_selection = True
  1237. background_type = transparent
  1238. scrollback_infinite = True
  1239. show_titlebar = False
  1240. [layouts]
  1241. [[default]]
  1242. [[[child1]]]
  1243. type = Terminal
  1244. parent = window0
  1245. [[[window0]]]
  1246. type = Window
  1247. parent = ""
  1248. [plugins]
  1249. EOF
  1250. #--- XFCE fix for terminator
  1251. mkdir -p ~/.local/share/xfce4/helpers/
  1252. file=~/.local/share/xfce4/helpers/custom-TerminalEmulator.desktop; [ -e "${file}" ] && cp -n $file{,.bkup}
  1253. sed -i 's#^X-XFCE-CommandsWithParameter=.*#X-XFCE-CommandsWithParameter=/usr/bin/terminator --command="%s"#' "${file}" 2>/dev/null || cat <<EOF > "${file}"
  1254. [Desktop Entry]
  1255. NoDisplay=true
  1256. Version=1.0
  1257. Encoding=UTF-8
  1258. Type=X-XFCE-Helper
  1259. X-XFCE-Category=TerminalEmulator
  1260. X-XFCE-CommandsWithParameter=/usr/bin/terminator --command="%s"
  1261. Icon=terminator
  1262. Name=terminator
  1263. X-XFCE-Commands=/usr/bin/terminator
  1264. EOF
  1265. file=~/.config/xfce4/helpers.rc; [ -e "${file}" ] && cp -n $file{,.bkup} #exo-preferred-applications #xdg-mime default
  1266. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1267. sed -i 's#^TerminalEmulator=.*#TerminalEmulator=custom-TerminalEmulator#' "${file}"
  1268. grep -q '^TerminalEmulator=custom-TerminalEmulator' "${file}" 2>/dev/null || echo -e 'TerminalEmulator=custom-TerminalEmulator' >> "${file}"
  1269.  
  1270.  
  1271. ##### Install ZSH & Oh-My-ZSH - root user. Note: 'Open terminal here', will not work with ZSH. Make sure to have tmux already installed
  1272. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}ZSH${RESET} & ${GREEN}Oh-My-ZSH${RESET} ~ unix shell"
  1273. #group="sudo"
  1274. apt-get -y -qq install zsh git curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1275. #--- Setup oh-my-zsh
  1276. #rm -rf ~/.oh-my-zsh/
  1277. timeout 300 curl --progress -k -L -f "https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh" | zsh #curl -s -L "https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading file" 1>&2
  1278. #--- Configure zsh
  1279. file=~/.zshrc; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/zsh/zshrc
  1280. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1281. grep -q 'interactivecomments' "${file}" 2>/dev/null || echo 'setopt interactivecomments' >> "${file}"
  1282. grep -q 'ignoreeof' "${file}" 2>/dev/null || echo 'setopt ignoreeof' >> "${file}"
  1283. grep -q 'correctall' "${file}" 2>/dev/null || echo 'setopt correctall' >> "${file}"
  1284. grep -q 'globdots' "${file}" 2>/dev/null || echo 'setopt globdots' >> "${file}"
  1285. grep -q '.bash_aliases' "${file}" 2>/dev/null || echo 'source $HOME/.bash_aliases' >> "${file}"
  1286. grep -q '/usr/bin/tmux' "${file}" 2>/dev/null || echo '#if ([[ -z "$TMUX" && -n "$SSH_CONNECTION" ]]); then /usr/bin/tmux attach || /usr/bin/tmux new; fi' >> "${file}" # If not already in tmux and via SSH
  1287. #--- Configure zsh (themes) ~ https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
  1288. sed -i 's/ZSH_THEME=.*/ZSH_THEME="mh"/' "${file}" # Other themes: mh, jreese, alanpeabody, candy, terminalparty, kardan, nicoulaj, sunaku
  1289. #--- Configure oh-my-zsh
  1290. sed -i 's/.*DISABLE_AUTO_UPDATE="true"/DISABLE_AUTO_UPDATE="true"/' "${file}"
  1291. sed -i 's/plugins=(.*)/plugins=(git tmux last-working-dir)/' "${file}"
  1292. #--- Set zsh as default shell (current user)
  1293. chsh -s "$(which zsh)"
  1294. #--- Use it ~ Not much point to it being a post-install script
  1295. #/usr/bin/env zsh # Use it
  1296. #source "${file}" # Make sure to reload our config
  1297. #--- Copy it to other user(s)
  1298. #if [ -e "/home/${username}/" ]; then # Will do this later on again, if there isn't already a user
  1299. # cp -f /{root,home/${username}}/.zshrc
  1300. # cp -rf /{root,home/${username}}/.oh-my-zsh/
  1301. # chown -R ${username}\:${group} /home/${username}/.zshrc /home/${username}/.oh-my-zsh/
  1302. # chsh "${username}" -s "$(which zsh)"
  1303. # sed -i 's#^export ZSH=/.*/.oh-my-zsh#export ZSH=/home/'${username}'/.oh-my-zsh#' /home/${username}/.zshrc
  1304. #fi
  1305.  
  1306.  
  1307. ##### Install tmux - all users
  1308. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}tmux${RESET} ~ multiplex virtual consoles"
  1309. #group="sudo"
  1310. #apt-get -y -qq remove screen # Optional: If we're going to have/use tmux, why have screen?
  1311. apt-get -y -qq install tmux || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1312. #--- Configure tmux
  1313. file=~/.tmux.conf; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/tmux.conf
  1314. [ -e "${file}" ] || cat <<EOF > "${file}"
  1315. #-Settings---------------------------------------------------------------------
  1316. ## Make it like screen (use CTRL+a)
  1317. unbind C-b
  1318. set -g prefix C-a
  1319.  
  1320. ## Pane switching (SHIFT+ARROWS)
  1321. bind-key -n S-Left select-pane -L
  1322. bind-key -n S-Right select-pane -R
  1323. bind-key -n S-Up select-pane -U
  1324. bind-key -n S-Down select-pane -D
  1325.  
  1326. ## Windows switching (ALT+ARROWS)
  1327. bind-key -n M-Left previous-window
  1328. bind-key -n M-Right next-window
  1329.  
  1330. ## Windows re-ording (SHIFT+ALT+ARROWS)
  1331. bind-key -n M-S-Left swap-window -t -1
  1332. bind-key -n M-S-Right swap-window -t +1
  1333.  
  1334. ## Activity Monitoring
  1335. setw -g monitor-activity on
  1336. set -g visual-activity on
  1337.  
  1338. ## Set defaults
  1339. set -g default-terminal screen-256color
  1340. set -g history-limit 5000
  1341.  
  1342. ## Default windows titles
  1343. set -g set-titles on
  1344. set -g set-titles-string '#(whoami)@#H - #I:#W'
  1345.  
  1346. ## Last window switch
  1347. bind-key C-a last-window
  1348.  
  1349. ## Reload settings (CTRL+a -> r)
  1350. unbind r
  1351. bind r source-file /etc/tmux.conf
  1352.  
  1353. ## Load custom sources
  1354. #source ~/.bashrc #(issues if you use /bin/bash & Debian)
  1355.  
  1356. EOF
  1357. [ -e /bin/zsh ] && echo -e '## Use ZSH as default shell\nset-option -g default-shell /bin/zsh\n' >> "${file}" # Need to have ZSH installed before running this command/line
  1358. cat <<EOF >> "${file}"
  1359. ## Show tmux messages for longer
  1360. set -g display-time 3000
  1361.  
  1362. ## Status bar is redrawn every minute
  1363. set -g status-interval 60
  1364.  
  1365.  
  1366. #-Theme------------------------------------------------------------------------
  1367. ## Default colours
  1368. set -g status-bg black
  1369. set -g status-fg white
  1370.  
  1371. ## Left hand side
  1372. set -g status-left-length '34'
  1373. set -g status-left '#[fg=green,bold]#(whoami)#[default]@#[fg=yellow,dim]#H #[fg=green,dim][#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[fg=green,dim]]'
  1374.  
  1375. ## Inactive windows in status bar
  1376. set-window-option -g window-status-format '#[fg=red,dim]#I#[fg=grey,dim]:#[default,dim]#W#[fg=grey,dim]'
  1377.  
  1378. ## Current or active window in status bar
  1379. #set-window-option -g window-status-current-format '#[bg=white,fg=red]#I#[bg=white,fg=grey]:#[bg=white,fg=black]#W#[fg=dim]#F'
  1380. set-window-option -g window-status-current-format '#[fg=red,bold](#[fg=white,bold]#I#[fg=red,dim]:#[fg=white,bold]#W#[fg=red,bold])'
  1381.  
  1382. ## Right hand side
  1383. set -g status-right '#[fg=green][#[fg=yellow]%Y-%m-%d #[fg=white]%H:%M#[fg=green]]'
  1384. EOF
  1385. #--- Setup alias
  1386. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  1387. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1388. grep -q '^alias tmux' "${file}" 2>/dev/null || echo -e '## tmux\nalias tmux="tmux attach || tmux new"\n' >> "${file}" #alias tmux="tmux attach -t $HOST || tmux new -s $HOST"
  1389. #--- Apply new alias
  1390. if [[ "${SHELL}" == "/bin/zsh" ]]; then source ~/.zshrc else source "${file}"; fi
  1391. #--- Copy it to other user(s) ~
  1392. #if [ -e /home/${username}/ ]; then # Will do this later on again, if there isn't already a user
  1393. # cp -f /{etc/,home/${username}/.}tmux.conf #cp -f /{root,home/${username}}/.tmux.conf
  1394. # chown ${username}\:${group} /home/${username}/.tmux.conf
  1395. # file=/home/${username}/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup}
  1396. # grep -q '^alias tmux' "${file}" 2>/dev/null || echo -e '## tmux\nalias tmux="tmux attach || tmux new"\n' >> "${file}" #alias tmux="tmux attach -t $HOST || tmux new -s $HOST"
  1397. #fi
  1398. #--- Use it ~ bit pointless if used in a post-install script
  1399. #tmux
  1400.  
  1401.  
  1402. ##### Configure screen ~ if possible, use tmux instead!
  1403. echo -e "\n ${GREEN}[+]${RESET} Configuring ${GREEN}screen${RESET} ~ multiplex virtual consoles"
  1404. #apt-get -y -qq install screen || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1405. #--- Configure screen
  1406. file=~/.screenrc; [ -e "${file}" ] && cp -n $file{,.bkup}
  1407. [ -e "${file}" ] || cat <<EOF > "${file}"
  1408. ## Don't display the copyright page
  1409. startup_message off
  1410.  
  1411. ## tab-completion flash in heading bar
  1412. vbell off
  1413.  
  1414. ## Keep scrollback n lines
  1415. defscrollback 1000
  1416.  
  1417. ## Hardstatus is a bar of text that is visible in all screens
  1418. hardstatus on
  1419. hardstatus alwayslastline
  1420. hardstatus string '%{gk}%{G}%H %{g}[%{Y}%l%{g}] %= %{wk}%?%-w%?%{=b kR}(%{W}%n %t%?(%u)%?%{=b kR})%{= kw}%?%+w%?%?%= %{g} %{Y} %Y-%m-%d %C%a %{W}'
  1421.  
  1422. ## Title bar
  1423. termcapinfo xterm ti@:te@
  1424.  
  1425. ## Default windows (syntax: screen -t label order command)
  1426. screen -t bash1 0
  1427. screen -t bash2 1
  1428.  
  1429. ## Select the default window
  1430. select 0
  1431. EOF
  1432.  
  1433.  
  1434. ##### Install vim - all users
  1435. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}vim${RESET} ~ CLI text editor"
  1436. apt-get -y -qq install vim || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1437. #--- Configure vim
  1438. file=/etc/vim/vimrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.vimrc
  1439. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1440. sed -i 's/.*syntax on/syntax on/' "${file}"
  1441. sed -i 's/.*set background=dark/set background=dark/' "${file}"
  1442. sed -i 's/.*set showcmd/set showcmd/' "${file}"
  1443. sed -i 's/.*set showmatch/set showmatch/' "${file}"
  1444. sed -i 's/.*set ignorecase/set ignorecase/' "${file}"
  1445. sed -i 's/.*set smartcase/set smartcase/' "${file}"
  1446. sed -i 's/.*set incsearch/set incsearch/' "${file}"
  1447. sed -i 's/.*set autowrite/set autowrite/' "${file}"
  1448. sed -i 's/.*set hidden/set hidden/' "${file}"
  1449. sed -i 's/.*set mouse=.*/"set mouse=a/' "${file}"
  1450. grep -q '^set number' "${file}" 2>/dev/null || echo 'set number' >> "${file}" # Add line numbers
  1451. grep -q '^set autoindent' "${file}" 2>/dev/null || echo 'set autoindent' >> "${file}" # Set auto indent
  1452. grep -q '^set expandtab' "${file}" 2>/dev/null || echo -e 'set expandtab\nset smarttab' >> "${file}" # Set use spaces instead of tabs
  1453. grep -q '^set softtabstop' "${file}" 2>/dev/null || echo -e 'set softtabstop=4\nset shiftwidth=4' >> "${file}" # Set 4 spaces as a 'tab'
  1454. grep -q '^set foldmethod=marker' "${file}" 2>/dev/null || echo 'set foldmethod=marker' >> "${file}" # Folding
  1455. grep -q '^nnoremap <space> za' "${file}" 2>/dev/null || echo 'nnoremap <space> za' >> "${file}" # Space toggle folds
  1456. grep -q '^set hlsearch' "${file}" 2>/dev/null || echo 'set hlsearch' >> "${file}" # Highlight search results
  1457. grep -q '^set laststatus' "${file}" 2>/dev/null || echo -e 'set laststatus=2\nset statusline=%F%m%r%h%w\ (%{&ff}){%Y}\ [%l,%v][%p%%]' >> "${file}" # Status bar
  1458. grep -q '^filetype on' "${file}" 2>/dev/null || echo -e 'filetype on\nfiletype plugin on\nsyntax enable\nset grepprg=grep\ -nH\ $*' >> "${file}" # Syntax highlighting
  1459. grep -q '^set wildmenu' "${file}" 2>/dev/null || echo -e 'set wildmenu\nset wildmode=list:longest,full' >> "${file}" # Tab completion
  1460. grep -q '^set invnumber' "${file}" 2>/dev/null || echo -e ':nmap <F8> :set invnumber<CR>' >> "${file}" # Toggle line numbers
  1461. grep -q '^set pastetoggle=<F9>' "${file}" 2>/dev/null || echo -e 'set pastetoggle=<F9>' >> "${file}" # Hotkey - turning off auto indent when pasting
  1462. grep -q '^:command Q q' "${file}" 2>/dev/null || echo -e ':command Q q' >> "${file}" # Fix stupid typo I always make
  1463. #--- Set as default editor
  1464. export EDITOR="vim" #update-alternatives --config editor
  1465. file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup}
  1466. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1467. grep -q '^EDITOR' "${file}" 2>/dev/null || echo 'EDITOR="vim"' >> "${file}"
  1468. git config --global core.editor "vim"
  1469. #--- Set as default mergetool
  1470. git config --global merge.tool vimdiff
  1471. git config --global merge.conflictstyle diff3
  1472. git config --global mergetool.prompt false
  1473.  
  1474.  
  1475. ##### Setup iceweasel
  1476. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}iceweasel${RESET} ~ GUI web browser"
  1477. apt-get install -y -qq unzip curl iceweasel || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1478. #--- Configure iceweasel
  1479. export DISPLAY=:0.0 #[[ -z $SSH_CONNECTION ]] || export DISPLAY=:0.0
  1480. timeout 15 iceweasel >/dev/null 2>&1 #iceweasel & sleep 15s; killall -q -w iceweasel >/dev/null # Start and kill. Files needed for first time run
  1481. timeout 5 killall -9 -q -w iceweasel >/dev/null #|| echo -e ' '${RED}'[!]'${RESET}" Failed to kill ${RED}iceweasel${RESET}"
  1482. file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'prefs.js' -print -quit) && [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/iceweasel/pref/*.js
  1483. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1484. #sed -i 's/^.network.proxy.socks_remote_dns.*/user_pref("network.proxy.socks_remote_dns", true);' "${file}" 2>/dev/null || echo 'user_pref("network.proxy.socks_remote_dns", true);' >> "${file}"
  1485. sed -i 's/^.browser.safebrowsing.enabled.*/user_pref("browser.safebrowsing.enabled", false);' "${file}" 2>/dev/null || echo 'user_pref("browser.safebrowsing.enabled", false);' >> "${file}" # Iceweasel -> Edit -> Preferences -> Security -> Block reported web forgeries
  1486. sed -i 's/^.browser.safebrowsing.malware.enabled.*/user_pref("browser.safebrowsing.malware.enabled", false);' "${file}" 2>/dev/null || echo 'user_pref("browser.safebrowsing.malware.enabled", false);' >> "${file}" # Iceweasel -> Edit -> Preferences -> Security -> Block reported attack sites
  1487. sed -i 's/^.browser.safebrowsing.remoteLookups.enabled.*/user_pref("browser.safebrowsing.remoteLookups.enabled", false);' "${file}" 2>/dev/null || echo 'user_pref("browser.safebrowsing.remoteLookups.enabled", false);' >> "${file}"
  1488. sed -i 's/^.*browser.startup.page.*/user_pref("browser.startup.page", 0);' "${file}" 2>/dev/null || echo 'user_pref("browser.startup.page", 0);' >> "${file}" # Iceweasel -> Edit -> Preferences -> General -> When firefox starts: Show a blank page
  1489. sed -i 's/^.*privacy.donottrackheader.enabled.*/user_pref("privacy.donottrackheader.enabled", true);' "${file}" 2>/dev/null || echo 'user_pref("privacy.donottrackheader.enabled", true);' >> "${file}" # Privacy -> Enable: Tell websites I do not want to be tracked
  1490. sed -i 's/^.*browser.showQuitWarning.*/user_pref("browser.showQuitWarning", true);' "${file}" 2>/dev/null || echo 'user_pref("browser.showQuitWarning", true);' >> "${file}" # Stop Ctrl+Q from quitting without warning
  1491. sed -i 's/^.*extensions.https_everywhere._observatory.popup_shown.*/user_pref("extensions.https_everywhere._observatory.popup_shown", true);' "${file}" 2>/dev/null || echo 'user_pref("extensions.https_everywhere._observatory.popup_shown", true);' >> "${file}"
  1492. sed -i 's/^.network.security.ports.banned.override/user_pref("network.security.ports.banned.override", "1-65455");' "${file}" 2>/dev/null || echo 'user_pref("network.security.ports.banned.override", "1-65455");' >> "${file}" # Remove "This address is restricted"
  1493. #--- Replace bookmarks (base: http://pentest-bookmarks.googlecode.com)
  1494. file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'bookmarks.html' -print -quit) && [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/iceweasel/profile/bookmarks.html
  1495. timeout 300 curl --progress -k -L -f "http://pentest-bookmarks.googlecode.com/files/bookmarksv1.5.html" > /tmp/bookmarks_new.html || echo -e ' '${RED}'[!]'${RESET}" Issue downloading bookmarks_new.html" 1>&2 #***!!! hardcoded version! Need to manually check for updates
  1496. #--- Configure bookmarks
  1497. awk '!a[$0]++' /tmp/bookmarks_new.html | \egrep -v ">(Latest Headlines|Getting Started|Recently Bookmarked|Recent Tags|Mozilla Firefox|Help and Tutorials|Customize Firefox|Get Involved|About Us|Hacker Media|Bookmarks Toolbar|Most Visited)</" | \egrep -v "^ </DL><p>" | \egrep -v "^<DD>Add" > "${file}"
  1498. sed -i 's#^</DL><p># </DL><p>\n </DL><p>\n</DL><p>#' "${file}" # Fix import issues from pentest-bookmarks...
  1499. sed -i 's#^ <DL><p># <DL><p>\n <DT><A HREF="http://127.0.0.1/">localhost</A>#' "${file}" # Add localhost to bookmark toolbar (before hackery folder)
  1500. sed -i 's#^</DL><p># <DT><A HREF="https://127.0.0.1:8834/">Nessus</A>\n</DL><p>#' "${file}" # Add Nessus UI bookmark toolbar
  1501. [ "${openVAS}" != "false" ] && sed -i 's#^</DL><p># <DT><A HREF="https://127.0.0.1:9392/">OpenVAS</A>\n</DL><p>#' "${file}" # Add OpenVAS UI to bookmark toolbar
  1502. #sed -i 's#^</DL><p># <DT><A HREF="https://127.0.0.1:3780/">Nexpose</A>\n</DL><p>#' "${file}" # Add Nexpose UI to bookmark toolbar
  1503. sed -i 's#^</DL><p># <DT><A HREF="http://127.0.0.1:3000/ui/panel">BeEF</A>\n</DL><p>#' "${file}" # Add BeEF UI to bookmark toolbar
  1504. sed -i 's#^</DL><p># <DT><A HREF="http://127.0.0.1/rips/">RIPS</A>\n</DL><p>#' "${file}" # Add RIPs to bookmark toolbar
  1505. sed -i 's#^</DL><p># <DT><A HREF="https://paulschou.com/tools/xlate/">XLATE</A>\n</DL><p>#' "${file}" # Add XLATE to bookmark toolbar
  1506. sed -i 's#^</DL><p># <DT><A HREF="https://hackvertor.co.uk/public">HackVertor</A>\n</DL><p>#' "${file}" # Add HackVertor to bookmark toolbar
  1507. sed -i 's#^</DL><p># <DT><A HREF="http://www.irongeek.com/skiddypad.php">SkiddyPad</A>\n</DL><p>#' "${file}" # Add Skiddypad to bookmark toolbar
  1508. sed -i 's#^</DL><p># <DT><A HREF="https://www.exploit-db.com/search/">Exploit-DB</A>\n</DL><p>#' "${file}" # Add Exploit-DB to bookmark toolbar
  1509. sed -i 's#^</DL><p># <DT><A HREF="http://offset-db.com/">Offset-DB</A>\n</DL><p>#' "${file}" # Add offset-db to bookmark toolbar
  1510. #sed -i 's#^</DL><p># <DT><A HREF="http://shell-storm.org/shellcode/">Shelcodes</A>\n</DL><p>#' "${file}" # Add shellcode to bookmark toolbar
  1511. #sed -i 's#^</DL><p># <DT><A HREF="http://ropshell.com/">ROP Shell</A>\n</DL><p>#' "${file}" # Add ROP Shell to bookmark toolbar
  1512. sed -i 's#^</DL><p># <DT><A HREF="https://ifconfig.io/">ifconfig</A>\n</DL><p>#' "${file}" # Add ifconfig.io to bookmark toolbar
  1513. sed -i 's#<HR>#<DT><H3 ADD_DATE="1303667175" LAST_MODIFIED="1303667175" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar</H3>\n<DD>Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar#' "${file}"
  1514. #--- Clear bookmark cache
  1515. find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -mindepth 1 -type f -name places.sqlite -delete
  1516. find ~/.mozilla/firefox/*.default*/bookmarkbackups/ -type f -delete
  1517. #--- Default for XFCE
  1518. file=~/.config/xfce4/helpers.rc; [ -e "${file}" ] && cp -n $file{,.bkup} #exo-preferred-applications #xdg-mime default
  1519. sed -i 's#^WebBrowser=.*#WebBrowser=iceweasel#' "${file}"
  1520. grep -q '^WebBrowser=iceweasel' "${file}" 2>/dev/null || echo 'WebBrowser=iceweasel' >> "${file}"
  1521. #--- Remove old temp files
  1522. rm -f /tmp/bookmarks_new.html
  1523.  
  1524.  
  1525. ##### Setup iceweasel's plugins
  1526. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}iceweasel's plugins${RESET} ~ Useful addons"
  1527. #--- Configure iceweasel
  1528. export DISPLAY=:0.0 #[[ -z $SSH_CONNECTION ]] || export DISPLAY=:0.0
  1529. #--- Download extensions
  1530. ffpath="$(find ~/.mozilla/firefox/*.default*/ -maxdepth 0 -mindepth 0 -type d -name '*.default*' -print -quit)/extensions"
  1531. [ "${ffpath}" == "/extensions" ] && echo -e ' '${RED}'[!]'${RESET}" Couldn't find Firefox/Iceweasel folder" 1>&2
  1532. mkdir -p "${ffpath}/"
  1533. #curl --progress -k -L -f "https://github.com/mozmark/ringleader/blob/master/fx_pnh.xpi?raw=true" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading fx_pnh.xpi" 1>&2 # plug-n-hack
  1534. #curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/284030/addon-284030-latest.xpi?src=dp-btn-primary" -o "$ffpath/{6bdc61ae-7b80-44a3-9476-e1d121ec2238}.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'HTTPS Finder'" 1>&2 # HTTPS Finder
  1535. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/5817/addon-5817-latest.xpi?src=dp-btn-primary" -o "$ffpath/SQLiteManager@mrinalkant.blogspot.com.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'SQLite Manager'" 1>&2 # SQLite Manager
  1536. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/1865/addon-1865-latest.xpi?src=dp-btn-primary" -o "$ffpath/{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Adblock Plus'" 1>&2 # Adblock Plus
  1537. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/92079/addon-92079-latest.xpi?src=dp-btn-primary" -o "$ffpath/{bb6bc1bb-f824-4702-90cd-35e2fb24f25d}.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Cookies Manager+'" 1>&2 # Cookies Manager+
  1538. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/1843/addon-1843-latest.xpi?src=dp-btn-primary" -o "$ffpath/firebug@software.joehewitt.com.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Firebug'" 1>&2 # Firebug
  1539. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/15023/addon-15023-latest.xpi?src=dp-btn-primary" -o "$ffpath/foxyproxy-basic@eric.h.jung.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'FoxyProxy Basic'" 1>&2 # FoxyProxy Basic
  1540. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/429678/addon-429678-latest.xpi?src=dp-btn-primary" -o "$ffpath/useragentoverrider@qixinglu.com.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'User Agent Overrider'" 1>&2 # User Agent Overrider
  1541. timeout 300 curl --progress -k -L -f "https://www.eff.org/files/https-everywhere-latest.xpi" -o "$ffpath/https-everywhere@eff.org.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'HTTPS Everywhere'" 1>&2 # HTTPS Everywhere
  1542. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/3829/addon-3829-latest.xpi?src=dp-btn-primary" -o "$ffpath/{8f8fe09b-0bd3-4470-bc1b-8cad42b8203a}.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Live HTTP Headers'" 1>&2 # Live HTTP Headers
  1543. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/966/addon-966-latest.xpi?src=dp-btn-primary" -o "$ffpath/{9c51bd27-6ed8-4000-a2bf-36cb95c0c947}.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Tamper Data'" 1>&2 # Tamper Data
  1544. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/300254/addon-300254-latest.xpi?src=dp-btn-primary" -o "$ffpath/check-compatibility@dactyl.googlecode.com.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Disable Add-on Compatibility Checks'" 1>&2 # Disable Add-on Compatibility Checks
  1545. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/3899/addon-3899-latest.xpi?src=dp-btn-primary" -o "$ffpath/{F5DDF39C-9293-4d5e-9AA8-E04E6DD5E9B4}.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'HackBar'" 1>&2 # HackBar
  1546. timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/607454/addon-607454-latest.xpi?src=dp-btn-primary" -o "$ffpath/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}.xpi" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'uBlock'" 1>&2 # uBlock
  1547. #--- Installing extensions
  1548. for FILE in $(find "${ffpath}" -maxdepth 1 -type f -name '*.xpi'); do
  1549. d="$(basename "${FILE}" .xpi)"
  1550. mkdir -p "${ffpath}/${d}/"
  1551. unzip -q -o -d "${ffpath}/${d}/" "${FILE}"
  1552. rm -f "${FILE}"
  1553. done
  1554. #--- Enable Iceweasel's addons/plugins/extensions
  1555. timeout 15 iceweasel >/dev/null 2>&1 #iceweasel & sleep 15s; killall -q -w iceweasel >/dev/null
  1556. sleep 3s
  1557. file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'extensions.sqlite' -print -quit) #&& [ -e "${file}" ] && cp -n $file{,.bkup}
  1558. if [ ! -e "${file}" ] || [ -z "${file}" ]; then
  1559. #echo -e ' '${RED}'[!]'${RESET}" Something went wrong enabling Iceweasel's extensions via method #1. Trying method #2..." 1>&2
  1560. false
  1561. else
  1562. echo -e " ${YELLOW}[i]${RESET} Enabled ${YELLOW}Iceweasel's extensions${RESET} (via method #1!)"
  1563. apt-get install -y -qq sqlite3 || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1564. rm -f /tmp/iceweasel.sql; touch /tmp/iceweasel.sql
  1565. echo "UPDATE 'main'.'addon' SET 'active' = 1, 'userDisabled' = 0;" > /tmp/iceweasel.sql # Force them all!
  1566. sqlite3 "${file}" < /tmp/iceweasel.sql #fuser extensions.sqlite
  1567. fi
  1568. file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'extensions.json' -print -quit) #&& [ -e "${file}" ] && cp -n $file{,.bkup}
  1569. if [ ! -e "${file}" ] || [ -z "${file}" ]; then
  1570. #echo -e ' '${RED}'[!]'${RESET}" Something went wrong enabling Iceweasel's extensions via method #2. Did method #1 also fail?" 1>&2
  1571. false
  1572. else
  1573. echo -e " ${YELLOW}[i]${RESET} Enabled ${YELLOW}Iceweasel's extensions${RESET} (via method #2!)"
  1574. sed -i 's/"active":false,/"active":true,/g' "${file}" # Force them all!
  1575. sed -i 's/"userDisabled":true,/"userDisabled":false,/g' "${file}" # Force them all!
  1576. fi
  1577. file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'prefs.js' -print -quit) #&& [ -e "${file}" ] && cp -n $file{,.bkup}
  1578. [ ! -z "${file}" ] && sed -i '/extensions.installCache/d' "${file}"
  1579. timeout 5 iceweasel >/dev/null 2>&1 # For extensions that just work without restarting
  1580. sleep 3s
  1581. timeout 5 iceweasel >/dev/null 2>&1 # ...for (most) extensions, as they need iceweasel to restart
  1582. sleep 5s
  1583. #--- Configure HackBar
  1584. file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'xulstore.json' -print -quit) #&& [ -e "${file}" ] && cp -n $file{,.bkup}
  1585. if [ -e "${file}" ]; then
  1586. sed -i 's/"hackBarToolbar":{"collapsed":".*"},/"hackBarToolbar":{"collapsed":"true"},/g' "${file}" # Hide the bar on startup
  1587. grep -q "hackBarToolbar" "${file}" 2>/dev/null || sed -i 's/"nav-bar"/"hackBarToolbar":{"collapsed":"true"},"nav-bar"/g' "${file}" # Hide the bar on startup
  1588. fi
  1589. #--- Configure foxyproxy
  1590. file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'foxyproxy.xml' -print -quit) #&& [ -e "${file}" ] && cp -n $file{,.bkup}
  1591. if [ -z "${file}" ]; then
  1592. echo -e ' '${RED}'[!]'${RESET}' Something went wrong with the FoxyProxy iceweasel extension (did any extensions install?). Skipping...' 1>&2
  1593. elif [ -e "${file}" ]; then
  1594. grep -q 'localhost:8080' "${file}" 2>/dev/null || sed -i 's#<proxy name="Default"#<proxy name="localhost:8080" id="1145138293" notes="e.g. Burp, w3af" fromSubscription="false" enabled="true" mode="manual" selectedTabIndex="0" lastresort="false" animatedIcons="true" includeInCycle="false" color="\#07753E" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="true" disableCache="true" clearCookiesBeforeUse="false" rejectCookies="false"><matches/><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="127.0.0.1" port="8080" socksversion="5" isSocks="false" username="" password="" domain=""/></proxy><proxy name="Default"#' "${file}" # localhost:8080
  1595. grep -q 'localhost:8081' "${file}" 2>/dev/null || sed -i 's#<proxy name="Default"#<proxy name="localhost:8081 (socket5)" id="212586674" notes="e.g. SSH" fromSubscription="false" enabled="true" mode="manual" selectedTabIndex="0" lastresort="false" animatedIcons="true" includeInCycle="false" color="\#917504" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="true" disableCache="true" clearCookiesBeforeUse="false" rejectCookies="false"><matches/><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="127.0.0.1" port="8081" socksversion="5" isSocks="true" username="" password="" domain=""/></proxy><proxy name="Default"#' "${file}" # localhost:8081 (socket5)
  1596. grep -q '"No Caching"' "${file}" 2>/dev/null || sed -i 's#<proxy name="Default"#<proxy name="No Caching" id="3884644610" notes="" fromSubscription="false" enabled="true" mode="system" selectedTabIndex="0" lastresort="false" animatedIcons="true" includeInCycle="false" color="\#990DA6" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="true" disableCache="true" clearCookiesBeforeUse="false" rejectCookies="false"><matches/><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="" port="" socksversion="5" isSocks="false" username="" password="" domain=""/></proxy><proxy name="Default"#' "${file}" # No caching
  1597. else
  1598. echo -ne '<?xml version="1.0" encoding="UTF-8"?>\n<foxyproxy mode="disabled" selectedTabIndex="0" toolbaricon="true" toolsMenu="true" contextMenu="false" advancedMenus="false" previousMode="disabled" resetIconColors="true" useStatusBarPrefix="true" excludePatternsFromCycling="false" excludeDisabledFromCycling="false" ignoreProxyScheme="false" apiDisabled="false" proxyForVersionCheck=""><random includeDirect="false" includeDisabled="false"/><statusbar icon="true" text="false" left="options" middle="cycle" right="contextmenu" width="0"/><toolbar left="options" middle="cycle" right="contextmenu"/><logg enabled="false" maxSize="500" noURLs="false" header="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;\n&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;link rel=&quot;icon&quot; href=&quot;http://getfoxyproxy.org/favicon.ico&quot;/&gt;&lt;link rel=&quot;shortcut icon&quot; href=&quot;http://getfoxyproxy.org/favicon.ico&quot;/&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;http://getfoxyproxy.org/styles/log.css&quot; type=&quot;text/css&quot;/&gt;&lt;/head&gt;&lt;body&gt;&lt;table class=&quot;log-table&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;td class=&quot;heading&quot;&gt;${timestamp-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${url-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${proxy-name-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${proxy-notes-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${pattern-name-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${pattern-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${pattern-case-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${pattern-type-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${pattern-color-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${pac-result-heading}&lt;/td&gt;&lt;td class=&quot;heading&quot;&gt;${error-msg-heading}&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tfoot&gt;&lt;tr&gt;&lt;td/&gt;&lt;/tr&gt;&lt;/tfoot&gt;&lt;tbody&gt;" row="&lt;tr&gt;&lt;td class=&quot;timestamp&quot;&gt;${timestamp}&lt;/td&gt;&lt;td class=&quot;url&quot;&gt;&lt;a href=&quot;${url}&quot;&gt;${url}&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;proxy-name&quot;&gt;${proxy-name}&lt;/td&gt;&lt;td class=&quot;proxy-notes&quot;&gt;${proxy-notes}&lt;/td&gt;&lt;td class=&quot;pattern-name&quot;&gt;${pattern-name}&lt;/td&gt;&lt;td class=&quot;pattern&quot;&gt;${pattern}&lt;/td&gt;&lt;td class=&quot;pattern-case&quot;&gt;${pattern-case}&lt;/td&gt;&lt;td class=&quot;pattern-type&quot;&gt;${pattern-type}&lt;/td&gt;&lt;td class=&quot;pattern-color&quot;&gt;${pattern-color}&lt;/td&gt;&lt;td class=&quot;pac-result&quot;&gt;${pac-result}&lt;/td&gt;&lt;td class=&quot;error-msg&quot;&gt;${error-msg}&lt;/td&gt;&lt;/tr&gt;" footer="&lt;/tbody&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;"/><warnings/><autoadd enabled="false" temp="false" reload="true" notify="true" notifyWhenCanceled="true" prompt="true"><match enabled="true" name="Dynamic AutoAdd Pattern" pattern="*://${3}${6}/*" isRegEx="false" isBlackList="false" isMultiLine="false" caseSensitive="false" fromSubscription="false"/><match enabled="true" name="" pattern="*You are not authorized to view this page*" isRegEx="false" isBlackList="false" isMultiLine="true" caseSensitive="false" fromSubscription="false"/></autoadd><quickadd enabled="false" temp="false" reload="true" notify="true" notifyWhenCanceled="true" prompt="true"><match enabled="true" name="Dynamic QuickAdd Pattern" pattern="*://${3}${6}/*" isRegEx="false" isBlackList="false" isMultiLine="false" caseSensitive="false" fromSubscription="false"/></quickadd><defaultPrefs origPrefetch="null"/><proxies>' > "${file}"
  1599. echo -ne '<proxy name="localhost:8080" id="1145138293" notes="e.g. Burp, w3af" fromSubscription="false" enabled="true" mode="manual" selectedTabIndex="0" lastresort="false" animatedIcons="true" includeInCycle="false" color="#07753E" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="true" disableCache="true" clearCookiesBeforeUse="false" rejectCookies="false"><matches/><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="127.0.0.1" port="8080" socksversion="5" isSocks="false" username="" password="" domain=""/></proxy>' >> "${file}"
  1600. echo -ne '<proxy name="localhost:8081 (socket5)" id="212586674" notes="e.g. SSH" fromSubscription="false" enabled="true" mode="manual" selectedTabIndex="0" lastresort="false" animatedIcons="true" includeInCycle="false" color="#917504" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="true" disableCache="true" clearCookiesBeforeUse="false" rejectCookies="false"><matches/><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="127.0.0.1" port="8081" socksversion="5" isSocks="true" username="" password="" domain=""/></proxy>' >> "${file}"
  1601. echo -ne '<proxy name="No Caching" id="3884644610" notes="" fromSubscription="false" enabled="true" mode="system" selectedTabIndex="0" lastresort="false" animatedIcons="true" includeInCycle="false" color="#990DA6" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="true" disableCache="true" clearCookiesBeforeUse="false" rejectCookies="false"><matches/><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="" port="" socksversion="5" isSocks="false" username="" password="" domain=""/></proxy>' >> "${file}"
  1602. echo -ne '<proxy name="Default" id="3377581719" notes="" fromSubscription="false" enabled="true" mode="direct" selectedTabIndex="0" lastresort="true" animatedIcons="false" includeInCycle="true" color="#0055E5" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="false" disableCache="false" clearCookiesBeforeUse="false" rejectCookies="false"><matches><match enabled="true" name="All" pattern="*" isRegEx="false" isBlackList="false" isMultiLine="false" caseSensitive="false" fromSubscription="false"/></matches><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="" port="" socksversion="5" isSocks="false" username="" password=""/></proxy>' >> "${file}"
  1603. echo -e '</proxies></foxyproxy>' >> "${file}"
  1604. fi
  1605. #--- Wipe session (due to force close)
  1606. find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'sessionstore.*' -delete
  1607. #--- Remove old temp files
  1608. rm -f /tmp/iceweasel.sql
  1609.  
  1610.  
  1611. ##### Install exe2hex
  1612. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}exe2hex${RESET} ~ Inline file transfer"
  1613. timeout 300 curl --progress -k -L -f "https://raw.githubusercontent.com/g0tmi1k/exe2hex/master/exe2hex.py" > /usr/local/bin/exe2hex || echo -e ' '${RED}'[!]'${RESET}" Issue downloading exe2hex" 1>&2
  1614. chmod +x /usr/local/bin/exe2hex
  1615.  
  1616.  
  1617. ##### Install MPC
  1618. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}MPC${RESET} ~ Msfvenom Payload Creator"
  1619. timeout 300 curl --progress -k -L -f "https://raw.githubusercontent.com/g0tmi1k/mpc/master/mpc.sh" > /usr/local/bin/mpc || echo -e ' '${RED}'[!]'${RESET}" Issue downloading mpc" 1>&2
  1620. chmod +x /usr/local/bin/mpc
  1621.  
  1622.  
  1623.  
  1624. ##### Install PyCharm (Community Edition)
  1625. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}PyCharm (Community Edition)${RESET} ~ Python IDE"
  1626. timeout 300 curl --progress -k -L -f "https://download.jetbrains.com/python/pycharm-community-5.0.tar.gz" > /tmp/pycharms-community.tar.gz || echo -e ' '${RED}'[!]'${RESET}" Issue downloading pycharms-community.tar.gz" 1>&2 #***!!! hardcoded version!
  1627. tar -xf /tmp/pycharms-community.tar.gz -C /tmp/
  1628. rm -rf /usr/share/pycharms/
  1629. mv -f /tmp/pycharm-community-*/ /usr/share/pycharms
  1630. ln -sf /usr/share/pycharms/bin/pycharm.sh /usr/local/bin/pycharms
  1631.  
  1632.  
  1633. ##### Install wdiff
  1634. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}wdiff${RESET} ~ Compares two files word by word"
  1635. apt-get -y -qq install wdiff wdiff-doc || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1636.  
  1637.  
  1638. ##### Install Meld
  1639. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Meld${RESET} ~ GUI text compare"
  1640. apt-get -y -qq install meld || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1641. #--- Configure meld
  1642. gconftool-2 -t bool -s /apps/meld/show_line_numbers true
  1643. gconftool-2 -t bool -s /apps/meld/show_whitespace true
  1644. gconftool-2 -t bool -s /apps/meld/use_syntax_highlighting true
  1645. gconftool-2 -t int -s /apps/meld/edit_wrap_lines 2
  1646.  
  1647.  
  1648. ##### Configure python console - all users
  1649. echo -e "\n ${GREEN}[+]${RESET} Configuring ${GREEN}python console${RESET} ~ tab complete & history support"
  1650. export PYTHONSTARTUP=$HOME/.pythonstartup
  1651. file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.bashrc
  1652. grep -q PYTHONSTARTUP "${file}" || echo 'export PYTHONSTARTUP=$HOME/.pythonstartup' >> "${file}"
  1653. #--- Python start up file
  1654. cat <<EOF > ~/.pythonstartup || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  1655. import readline
  1656. import rlcompleter
  1657. import atexit
  1658. import os
  1659.  
  1660. ## Tab completion
  1661. readline.parse_and_bind('tab: complete')
  1662.  
  1663. ## History file
  1664. histfile = os.path.join(os.environ['HOME'], '.pythonhistory')
  1665. try:
  1666. readline.read_history_file(histfile)
  1667. except IOError:
  1668. pass
  1669.  
  1670. atexit.register(readline.write_history_file, histfile)
  1671.  
  1672. ## Quit
  1673. del os, histfile, readline, rlcompleter
  1674. EOF
  1675. #--- Apply new configs
  1676. if [[ "${SHELL}" == "/bin/zsh" ]]; then source ~/.zshrc else source "${file}"; fi
  1677.  
  1678.  
  1679. ##### Install go
  1680. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}go${RESET} ~ programming language"
  1681. apt-get -y -qq install golang || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1682.  
  1683.  
  1684. ##### Install gitg
  1685. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}gitg${RESET} ~ GUI git client"
  1686. apt-get -y -qq install gitg || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1687.  
  1688.  
  1689. ##### Install sparta (https://bugs.kali.org/view.php?id=2021)
  1690. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}sparta${RESET} ~ GUI automatic wrapper"
  1691. apt-get -y -qq install sparta || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1692. #apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1693. #git clone -q https://github.com/secforce/sparta.git /opt/sparta-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  1694. #pushd /opt/sparta-git/ >/dev/null
  1695. #git pull -q
  1696. #popd >/dev/null
  1697. ##--- Add to path
  1698. #file=/usr/local/bin/sparta-git
  1699. #cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  1700. ##!/bin/bash
  1701. #
  1702. #cd /opt/sparta-git/ && python sparta.py "\$@"
  1703. #EOF
  1704. #chmod +x "${file}"
  1705.  
  1706.  
  1707. ##### Install wireshark
  1708. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Wireshark${RESET} ~ GUI network protocol analyzer"
  1709. #--- Hide running as root warning
  1710. mkdir -p ~/.wireshark/
  1711. file=~/.wireshark/recent_common; #[ -e "${file}" ] && cp -n $file{,.bkup}
  1712. [ -e "${file}" ] || echo "privs.warn_if_elevated: FALSE" > "${file}"
  1713. #--- Hide 'Lua: Error during loading' warning
  1714. file=/usr/share/wireshark/init.lua; [ -e "${file}" ] && cp -n $file{,.bkup}
  1715. sed -i 's/^disable_lua = .*/disable_lua = true/' "${file}"
  1716.  
  1717.  
  1718. ##### Install silver searcher
  1719. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}silver searcher${RESET} ~ code searching"
  1720. apt-get -y -qq install silversearcher-ag || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1721. #apt-get -y -qq install git automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1722. #git clone -q https://github.com/ggreer/the_silver_searcher.git /usr/local/src/the_silver_searcher || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1723. #pushd /usr/local/src/the_silver_searcher/ >/dev/null
  1724. #git pull -q
  1725. #bash ./build.sh
  1726. #make -s clean; make -s install
  1727. #popd >/dev/null
  1728. #ag <name>
  1729.  
  1730.  
  1731. ##### Install graudit
  1732. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}graudit${RESET} ~ source code auditing"
  1733. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1734. git clone -q https://github.com/wireghoul/graudit.git /opt/graudit-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  1735. #--- Add to path
  1736. file=/usr/local/bin/graudit-git
  1737. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  1738. #!/bin/bash
  1739.  
  1740. cd /opt/graudit-git/ && bash graudit.sh "\$@"
  1741. EOF
  1742. chmod +x "${file}"
  1743.  
  1744.  
  1745. ##### Install libreoffice
  1746. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}LibreOffice${RESET} ~ GUI office suite"
  1747. apt-get -y -qq install libreoffice || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1748.  
  1749.  
  1750. ##### Install cherrytree
  1751. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}cherrytree${RESET} ~ GUI note taking"
  1752. apt-get -y -qq install cherrytree || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1753.  
  1754.  
  1755. ##### Install ipcalc & sipcalc
  1756. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}ipcalc${RESET} & ${GREEN}sipcalc${RESET} ~ CLI subnet calculators"
  1757. apt-get -y -qq install ipcalc sipcalc || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1758.  
  1759.  
  1760. ##### Install recordmydesktop
  1761. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}RecordMyDesktop${RESET} ~ GUI video screen capture"
  1762. apt-get -y -qq install recordmydesktop || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1763. #--- Installing GUI front end
  1764. apt-get -y -qq install gtk-recordmydesktop || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1765.  
  1766.  
  1767. ##### Install asciinema
  1768. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}asciinema${RESET} ~ CLI terminal recorder"
  1769. curl -s -L https://asciinema.org/install | sh
  1770.  
  1771.  
  1772. ##### Install gimp
  1773. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}gimp${RESET} ~ GUI image editing"
  1774. #apt-get -y -qq install gimp || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1775.  
  1776.  
  1777. ##### Install shutter
  1778. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}shutter${RESET} ~ GUI static screen capture"
  1779. apt-get -y -qq install shutter || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1780.  
  1781.  
  1782. ##### Install gdebi
  1783. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}gdebi${RESET} ~ GUI package installer"
  1784. apt-get -y -qq install gdebi || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1785.  
  1786.  
  1787. ##### Install psmisc ~ allows for 'killall command' to be used
  1788. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}psmisc${RESET} ~ suite to help with running processes"
  1789. apt-get -y -qq install psmisc || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1790.  
  1791.  
  1792. ###### Setup pipe viewer
  1793. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}pipe viewer${RESET} ~ CLI progress bar"
  1794. apt-get install -y -qq pv || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1795.  
  1796. ##### Install ca-certificates
  1797. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}ca-certificates${RESET} ~ HTTPS/SSL/TLS"
  1798. apt-get -y -qq install ca-certificates || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1799.  
  1800.  
  1801. ##### Install testssl
  1802. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}testssl${RESET} ~ Testing TLS/SSL encryption"
  1803. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1804. git clone -q https://github.com/drwetter/testssl.sh.git /opt/testssl-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  1805. ln -sf /opt/testssl-git/testssl.sh /usr/local/bin/testssl-git
  1806. chmod +x /opt/testssl-git/testssl.sh
  1807.  
  1808.  
  1809. ##### Install UACScript
  1810. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}UACScript${RESET} ~ UAC Bypass for Windows 7"
  1811. apt-get -y -qq install git windows-binaries || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1812. git clone -q https://github.com/Vozzie/uacscript.git /opt/uacscript-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  1813. ln -sf /usr/share/windows-binaries/uac-win7 /opt/uacscript-git/
  1814.  
  1815.  
  1816. ##### Install MiniReverse_Shell_With_Parameters
  1817. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}MiniReverse_Shell_With_Parameters${RESET} ~ Generate shellcode for a reverse shell"
  1818. apt-get -y -qq install git windows-binaries || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1819. git clone -q https://github.com/xillwillx/MiniReverse_Shell_With_Parameters.git /opt/minireverse-shell-with-parameters-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  1820. ln -sf /usr/share/windows-binaries/MiniReverse /opt/minireverse-shell-with-parameters-git/
  1821.  
  1822.  
  1823. ##### Install axel
  1824. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}axel${RESET} ~ CLI download manager"
  1825. apt-get -y -qq install axel || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1826. #--- Setup alias
  1827. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  1828. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1829. grep -q '^alias axel' "${file}" 2>/dev/null || echo -e '## axel\nalias axel="axel -a"\n' >> "${file}"
  1830. #--- Apply new alias
  1831. if [[ "${SHELL}" == "/bin/zsh" ]]; then source ~/.zshrc else source "${file}"; fi
  1832.  
  1833.  
  1834. ##### Install html2text
  1835. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}html2text${RESET} ~ CLI html rendering"
  1836. apt-get -y -qq install html2text || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1837.  
  1838.  
  1839. ##### Install daemonfs
  1840. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}daemonfs${RESET} ~ GUI file monitor"
  1841. apt-get -y -qq install daemonfs || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1842.  
  1843.  
  1844. ##### Install filezilla (geany gets installed later)
  1845. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}FileZilla${RESET} ~ GUI file transfer"
  1846. apt-get -y -qq install filezilla || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1847. #--- Configure filezilla
  1848. export DISPLAY=:0.0 #[[ -z $SSH_CONNECTION ]] || export DISPLAY=:0.0
  1849. timeout 5 filezilla >/dev/null 2>&1 #filezilla & sleep 5s; killall -q -w filezilla >/dev/null # Start and kill. Files needed for first time run
  1850. mkdir -p ~/.config/filezilla/
  1851. file=~/.config/filezilla/filezilla.xml; [ -e "${file}" ] && cp -n $file{,.bkup}
  1852. sed -i 's#^.*"Default editor".*#\t<Setting name="Default editor">2/usr/bin/geany</Setting>#' "${file}"
  1853.  
  1854.  
  1855. ##### Install remmina
  1856. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}remmina${RESET} ~ GUI remote desktop"
  1857. apt-get -y -qq install remmina remmina-plugin-xdmcp remmina-plugin-rdp remmina-plugin-vnc || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1858.  
  1859.  
  1860. ##### Install lynx
  1861. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}lynx${RESET} ~ CLI web browser"
  1862. apt-get -y -qq install lynx || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1863.  
  1864.  
  1865. ##### Install p7zip
  1866. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}p7zip${RESET} ~ CLI file extractor"
  1867. apt-get -y -qq install p7zip-full || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1868.  
  1869.  
  1870. ##### Install zip & unzip
  1871. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}zip${RESET} & ${GREEN}unzip${RESET} ~ CLI file extractors"
  1872. apt-get -y -qq install zip || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} # Compress
  1873. apt-get -y -qq install unzip || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} # Decompress
  1874.  
  1875.  
  1876. ##### Install file roller
  1877. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}file roller${RESET} ~ GUI file extractor"
  1878. apt-get -y -qq install file-roller || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} # GUI program
  1879. apt-get -y -qq install unace unrar rar unzip zip p7zip p7zip-full p7zip-rar || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} # Supported file compressions types
  1880.  
  1881.  
  1882. ##### Install VPN support
  1883. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}VPN${RESET} support for Network-Manager"
  1884. #*** I know its messy...
  1885. for FILE in network-manager-openvpn network-manager-pptp network-manager-vpnc network-manager-openconnect network-manager-iodine; do
  1886. apt-get -y -qq install "${FILE}" || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1887. done
  1888.  
  1889. ##### Install hashid
  1890. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}hashid${RESET} ~ identify hash types"
  1891. apt-get -y -qq install hashid || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1892.  
  1893.  
  1894. ##### Install httprint
  1895. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}httprint${RESET} ~ GUI web server fingerprint"
  1896. apt-get -y -qq install httprint || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1897.  
  1898.  
  1899. ##### Install lbd
  1900. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}lbd${RESET} ~ load balancing detector"
  1901. apt-get -y -qq install lbd || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1902.  
  1903.  
  1904. ##### Install wafw00f
  1905. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}wafw00f${RESET} ~ WAF detector"
  1906. apt-get -y -qq install git python python-pip || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1907. git clone -q https://github.com/sandrogauci/wafw00f.git /opt/wafw00f-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  1908. pushd /opt/wafw00f-git/ >/dev/null
  1909. git pull -q
  1910. python setup.py install
  1911. popd >/dev/null
  1912.  
  1913.  
  1914. ##### Install waffit
  1915. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}waffit${RESET} ~ WAF detector"
  1916. #apt-get -y -qq install waffit || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1917.  
  1918.  
  1919. ##### Install aircrack-ng
  1920. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Aircrack-ng${RESET} ~ Wi-Fi cracking suite"
  1921. apt-get -y -qq install aircrack-ng curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1922. #--- Setup hardware database
  1923. mkdir -p /etc/aircrack-ng/
  1924. (timeout 600 airodump-ng-oui-update 2>/dev/null) || timeout 600 curl --progress -k -L -f "http://standards.ieee.org/develop/regauth/oui/oui.txt" > /etc/aircrack-ng/oui.txt #***!!! hardcoded path! # || echo -e ' '${RED}'[!]'${RESET}" Issue downloading oui.txt" 1>&2
  1925. [[ -e /etc/aircrack-ng/oui.txt ]] && (\grep "(hex)" /etc/aircrack-ng/oui.txt | sed 's/^[ \t]*//g;s/[ \t]*$//g' > /etc/aircrack-ng/airodump-ng-oui.txt)
  1926. [[ ! -f /etc/aircrack-ng/airodump-ng-oui.txt ]] && echo -e ' '${RED}'[!]'${RESET}" Issue downloading oui.txt" 1>&2
  1927. #--- Setup alias
  1928. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  1929. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  1930. grep -q '^## aircrack-ng' "${file}" 2>/dev/null || echo -e '## aircrack-ng\nalias aircrack-ng="aircrack-ng -z"\n' >> "${file}"
  1931. grep -q '^## airodump-ng' "${file}" 2>/dev/null || echo -e '## airodump-ng \nalias airodump-ng="airodump-ng --manufacturer --wps --uptime"\n' >> "${file}" # aircrack-ng 1.2 rc2
  1932.  
  1933.  
  1934. ##### Install reaver (Community Fork)
  1935. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}reaver (community fork)${RESET} ~ WPS pin brute force + Pixie Attack"
  1936. apt-get -y -qq install reaver pixiewps || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1937.  
  1938.  
  1939. ##### Install bully
  1940. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}bully${RESET} ~ WPS pin brute force"
  1941. apt-get -y -qq install bully || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1942.  
  1943.  
  1944. ##### Install wifite
  1945. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}wifite${RESET} ~ automated Wi-Fi tool"
  1946. apt-get -y -qq install wifite || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1947.  
  1948.  
  1949. ##### Install vulscan script for nmap
  1950. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}vulscan script for nmap${RESET} ~ vulnerability scanner add-on"
  1951. apt-get -y -qq install nmap curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1952. mkdir -p /usr/share/nmap/scripts/vulscan/
  1953. timeout 300 curl --progress -k -L -f "http://www.computec.ch/projekte/vulscan/download/nmap_nse_vulscan-2.0.tar.gz" > /tmp/nmap_nse_vulscan.tar.gz || echo -e ' '${RED}'[!]'${RESET}" Issue downloading file" 1>&2 #***!!! hardcoded version! Need to manually check for updates
  1954. gunzip /tmp/nmap_nse_vulscan.tar.gz
  1955. tar -xf /tmp/nmap_nse_vulscan.tar -C /usr/share/nmap/scripts/
  1956. #--- Fix permissions (by default its 0777)
  1957. chmod -R 0755 /usr/share/nmap/scripts/; find /usr/share/nmap/scripts/ -type f -exec chmod 0644 {} \;
  1958. #--- Remove old temp files
  1959. rm -f /tmp/nmap_nse_vulscan.tar*
  1960.  
  1961.  
  1962. ##### Install unicornscan
  1963. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}unicornscan${RESET} ~ fast port scanner"
  1964. apt-get -y -qq install unicornscan || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1965.  
  1966.  
  1967. ##### Install onetwopunch
  1968. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}onetwopunch${RESET} ~ unicornscan & nmap wrapper"
  1969. apt-get -y -qq install git nmap unicornscan || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1970. git clone -q https://github.com/superkojiman/onetwopunch.git /opt/onetwopunch-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  1971. pushd /opt/onetwopunch-git/ >/dev/null
  1972. git pull -q
  1973. popd >/dev/null
  1974. #--- Add to path
  1975. file=/usr/local/bin/onetwopunch-git
  1976. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  1977. #!/bin/bash
  1978.  
  1979. cd /opt/onetwopunch-git/ && bash onetwopunch.sh "\$@"
  1980. EOF
  1981. chmod +x "${file}"
  1982.  
  1983.  
  1984. ##### Install Gnmap-Parser (Fork)
  1985. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Gnmap-Parser (Fork)${RESET} ~ Parse Nmap exports into various plain-text formats"
  1986. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1987. git clone -q https://github.com/nullmode/gnmap-parser.git /opt/gnmap-parser-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  1988. ln -sf /opt/gnmap-parser-git/Gnmap-Parser.sh /usr/local/bin/gnmap-parser-git
  1989. chmod +x /opt/gnmap-parser-git/Gnmap-Parser.sh
  1990.  
  1991.  
  1992. ##### Install udp-proto-scanner
  1993. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}udp-proto-scanner${RESET} ~ common UDP port scanner"
  1994. apt-get -y -qq install curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  1995. #mkdir -p /usr/share/udp-proto-scanner/
  1996. timeout 300 curl --progress -k -L -f "https://labs.portcullis.co.uk/download/udp-proto-scanner-1.1.tar.gz" -o /tmp/udp-proto-scanner.tar.gz || echo -e ' '${RED}'[!]'${RESET}" Issue downloading udp-proto-scanner.tar.gz" 1>&2
  1997. gunzip /tmp/udp-proto-scanner.tar.gz
  1998. tar -xf /tmp/udp-proto-scanner.tar -C /opt/
  1999. mv -f /opt/udp-proto-scanner{-1.1,}
  2000. file=/usr/local/bin/udp-proto-scanner
  2001. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2002. #!/bin/bash
  2003.  
  2004. cd /opt/udp-proto-scanner/ && perl udp-proto-scanner.pl "\$@"
  2005. EOF
  2006. chmod +x "${file}"
  2007. #--- Remove old temp files
  2008. rm -f /tmp/udp-proto-scanner.tar*
  2009.  
  2010.  
  2011. ##### Install clusterd
  2012. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}clusterd${RESET} ~ clustered attack toolkit (JBoss, ColdFusion, WebLogic, Tomcat etc)"
  2013. apt-get -y -qq install clusterd || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2014.  
  2015.  
  2016. ##### Install webhandler
  2017. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}webhandler${RESET} ~ shell TTY handler"
  2018. apt-get -y -qq install webhandler || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2019. ln -sf /usr/bin/webhandler /usr/local/bin/wh
  2020.  
  2021.  
  2022. ##### Install azazel
  2023. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}azazel${RESET} ~ Linux userland rootkit"
  2024. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2025. git clone -q https://github.com/chokepoint/azazel.git /opt/azazel-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2026. pushd /opt/azazel-git/ >/dev/null
  2027. git pull -q
  2028. popd >/dev/null
  2029.  
  2030.  
  2031. ##### Install Babadook
  2032. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Babadook${RESET} ~ connection-less powershell backdoor"
  2033. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2034. git clone -q https://github.com/jseidl/Babadook.git /opt/babadook-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2035.  
  2036.  
  2037. ##### Install pupy
  2038. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}pupy${RESET} ~ Remote Administration Tool"
  2039. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2040. git clone -q https://github.com/n1nj4sec/pupy.git /opt/pupy-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2041.  
  2042.  
  2043. ##### Install gobuster (https://bugs.kali.org/view.php?id=2438)
  2044. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}gobuster${RESET} ~ Directory/File/DNS busting tool"
  2045. apt-get -y -qq install git golang || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2046. git clone -q https://github.com/OJ/gobuster.git /opt/gobuster-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2047. pushd /opt/gobuster-git/ >/dev/null
  2048. go build
  2049. popd >/dev/null
  2050. #--- Add to path
  2051. file=/usr/local/bin/gobuster-git
  2052. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2053. #!/bin/bash
  2054.  
  2055. cd /opt/gobuster-git/ && ./gobuster "\$@"
  2056. EOF
  2057. chmod +x "${file}"
  2058.  
  2059.  
  2060. ##### Install reGeorg
  2061. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}reGeorg${RESET} ~ pivot via web shells"
  2062. git clone -q https://github.com/sensepost/reGeorg.git /opt/reGeorg-git || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2063. #--- Link to others
  2064. apt-get -y -qq install webshells || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2065. ln -sf /opt/reGeorg-git /usr/share/webshells/reGeorg
  2066.  
  2067.  
  2068.  
  2069. ##### Install bridge-utils
  2070. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}bridge-utils${RESET} ~ bridge network interfaces"
  2071. apt-get -y -qq install bridge-utils || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2072.  
  2073.  
  2074. ##### Install FruityWifi
  2075. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}FruityWifi${RESET} ~ wireless network auditing tool"
  2076. apt-get -y -qq install fruitywifi || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2077. # URL: https://localhost:8443
  2078. if [[ -e /var/www/html/index.nginx-debian.html ]]; then
  2079. grep -q '<title>Welcome to nginx on Debian!</title>' /var/www/html/index.nginx-debian.html && echo 'Permission denied.' > /var/www/html/index.nginx-debian.html
  2080. fi
  2081.  
  2082.  
  2083. ##### Install WPA2-HalfHandshake-Crack
  2084. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}WPA2-HalfHandshake-Crack${RESET} ~ rogue AP to do WPA2 handshakes without AP"
  2085. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2086. git clone -q https://github.com/dxa4481/WPA2-HalfHandshake-Crack.git /opt/wpa2-halfhandshake-crack-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2087. pushd /opt/wpa2-halfhandshake-crack-git/ >/dev/null
  2088. git pull -q
  2089. popd >/dev/null
  2090.  
  2091.  
  2092. ##### Install HT-WPS-Breaker
  2093. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}HT-WPS-Breaker${RESET} ~ Auto WPS tool"
  2094. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2095. git clone -q https://github.com/SilentGhostX/HT-WPS-Breaker.git /opt/ht-wps-breaker-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2096.  
  2097.  
  2098. ##### Install dot11decrypt
  2099. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}dot11decrypt${RESET} ~ On-the-fly WEP/WPA2 decrypter"
  2100. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2101. git clone -q https://github.com/mfontanini/dot11decrypt.git /opt/dot11decrypt-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2102.  
  2103.  
  2104. ##### Install mana toolkit
  2105. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}MANA toolkit${RESET} ~ rogue AP to do MITM Wi-Fi"
  2106. apt-get -y -qq install mana-toolkit || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2107. mkdir -p /usr/share/mana-toolkit/www/facebook/
  2108. #--- Disable profile
  2109. a2dissite 000-mana-toolkit; a2ensite 000-default
  2110. #--- Setup alias
  2111. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  2112. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  2113. grep -q '^## mana-toolkit' "${file}" 2>/dev/null || echo -e '## mana-toolkit\nalias mana-toolkit-start="a2ensite 000-mana-toolkit;a2dissite 000-default;systemctl apache2 restart"\n\nalias mana-toolkit-stop="a2dissite 000-mana-toolkit;a2ensite 000-default;systemctl apache2 restart"\n' >> "${file}"
  2114. #cd /usr/share/mana-toolkit/www/
  2115.  
  2116.  
  2117. ##### Install wifiphisher
  2118. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}wifiphisher${RESET} ~ automated Wi-Fi phishing"
  2119. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2120. git clone -q https://github.com/sophron/wifiphisher.git /opt/wifiphisher-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2121. pushd /opt/wifiphisher-git/ >/dev/null
  2122. git pull -q
  2123. popd >/dev/null
  2124. #--- Add to path
  2125. file=/usr/local/bin/wifiphisher-git
  2126. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2127. #!/bin/bash
  2128.  
  2129. cd /opt/wifiphisher-git/ && python wifiphisher.py "\$@"
  2130. EOF
  2131. chmod +x "${file}"
  2132.  
  2133.  
  2134. ##### Install hostapd-wpe-extended
  2135. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}hostapd-wpe-extended${RESET} ~ rogue AP for WPA-Enterprise"
  2136. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2137. git clone -q https://github.com/NerdyProjects/hostapd-wpe-extended.git /opt/hostapd-wpe-extended-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2138. pushd /opt/hostapd-wpe-extended-git/ >/dev/null
  2139. git pull -q
  2140. popd >/dev/null
  2141.  
  2142.  
  2143. ##### Install proxychains-ng (https://bugs.kali.org/view.php?id=2037)
  2144. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}proxychains-ng${RESET} ~ proxifier"
  2145. apt-get -y -qq install git gcc || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2146. git clone -q https://github.com/rofl0r/proxychains-ng.git /opt/proxychains-ng-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2147. pushd /opt/proxychains-ng-git/ >/dev/null
  2148. git pull -q
  2149. make -s clean
  2150. ./configure --prefix=/usr --sysconfdir=/etc >/dev/null
  2151. make -s 2>/dev/null && make -s install # bad, but it gives errors which might be confusing (still builds)
  2152. popd >/dev/null
  2153. #--- Add to path (with a 'better' name)
  2154. ln -sf /usr/bin/proxychains4 /usr/local/bin/proxychains-ng
  2155.  
  2156.  
  2157. ##### Install httptunnel
  2158. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}httptunnel${RESET} ~ tunnels data streams in HTTP requests"
  2159. apt-get -y -qq install http-tunnel || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2160.  
  2161.  
  2162. ##### Install sshuttle
  2163. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}sshuttle${RESET} ~ VPN over SSH"
  2164. apt-get -y -qq install sshuttle || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2165. #--- Example
  2166. #sshuttle --dns --remote root@123.9.9.9 0/0 -vv
  2167.  
  2168.  
  2169. ##### Install pfi
  2170. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}pfi${RESET} ~ Port Forwarding Interceptor"
  2171. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2172. git clone -q https://github.com/s7ephen/pfi.git /opt/pfi-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2173.  
  2174.  
  2175. ##### Install icmpsh
  2176. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}icmpsh${RESET} ~ reverse ICMP shell"
  2177. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2178. git clone -q https://github.com/inquisb/icmpsh.git /opt/icmpsh-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2179.  
  2180.  
  2181. ##### Install dnsftp
  2182. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}dnsftp${RESET} ~ transfer files over DNS"
  2183. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2184. git clone -q https://github.com/breenmachine/dnsftp.git /opt/dnsftp-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2185.  
  2186.  
  2187. ##### Install iodine
  2188. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}iodine${RESET} ~ DNS tunneling (IP over DNS)"
  2189. apt-get -y -qq install iodine || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2190. #--- Example
  2191. #iodined -f -P password1 10.0.0.1 dns.mydomain.com
  2192. #iodine -f -P password1 123.9.9.9 dns.mydomain.com; ssh -C -D 8081 root@10.0.0.1
  2193.  
  2194.  
  2195. ##### Install dns2tcp
  2196. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}dns2tcp${RESET} ~ DNS tunneling (TCP over DNS)"
  2197. apt-get -y -qq install dns2tcp || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2198. #file=/etc/dns2tcpd.conf; [ -e "${file}" ] && cp -n $file{,.bkup}; echo -e "listen = 0.0.0.0\nport = 53\nuser = nobody\nchroot = /tmp\ndomain = dnstunnel.mydomain.com\nkey = password1\nressources = ssh:127.0.0.1:22" > "${file}"; dns2tcpd -F -d 1 -f /etc/dns2tcpd.conf
  2199. #file=/etc/dns2tcpc.conf; [ -e "${file}" ] && cp -n $file{,.bkup}; echo -e "domain = dnstunnel.mydomain.com\nkey = password1\nresources = ssh\nlocal_port = 8000\ndebug_level=1" > "${file}"; dns2tcpc -f /etc/dns2tcpc.conf 178.62.206.227; ssh -C -D 8081 -p 8000 root@127.0.0.1
  2200.  
  2201.  
  2202. ##### Install ptunnel
  2203. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}ptunnel${RESET} ~ ICMP tunneling"
  2204. apt-get -y -qq install ptunnel || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2205. #--- Example
  2206. #ptunnel -x password1
  2207. #ptunnel -x password1 -p 123.9.9.9 -lp 8000 -da 127.0.0.1 -dp 22; ssh -C -D 8081 -p 8000 root@127.0.0.1
  2208.  
  2209.  
  2210. ##### Install stunnel
  2211. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}stunnel${RESET} ~ SSL wrapper"
  2212. apt-get -y -qq install stunnel || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2213. #--- Remove from start up
  2214. systemctl disable stunnel4
  2215.  
  2216.  
  2217. ##### Install zerofree
  2218. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}zerofree${RESET} ~ CLI nulls free blocks on a HDD"
  2219. apt-get -y -qq install zerofree || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2220. #--- Example
  2221. #fdisk -l
  2222. #zerofree -v /dev/sda1 #for i in $(mount | grep sda | grep ext | cut -b 9); do mount -o remount,ro /dev/sda${i} && zerofree -v /dev/sda${i} && mount -o remount,rw /dev/sda${i}; done
  2223.  
  2224.  
  2225. ##### Install gcc & multilib
  2226. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}gcc${RESET} & ${GREEN}multilibc${RESET} ~ compiling libraries"
  2227. #*** I know its messy...
  2228. for FILE in cc gcc g++ gcc-multilib make automake libc6 libc6-dev libc6-amd64 libc6-dev-amd64 libc6-i386 libc6-dev-i386 libc6-i686 libc6-dev-i686 build-essential dpkg-dev; do
  2229. apt-get -y -qq install "${FILE}" 2>/dev/null
  2230. done
  2231.  
  2232.  
  2233. ##### Install MinGW ~ cross compiling suite
  2234. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}MinGW${RESET} ~ cross compiling suite"
  2235. #*** I know its messy...
  2236. for FILE in mingw-w64 binutils-mingw-w64 gcc-mingw-w64 cmake mingw-w64-dev mingw-w64-tools gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 mingw32; do
  2237. apt-get -y -qq install "${FILE}" 2>/dev/null
  2238. done
  2239.  
  2240.  
  2241. ##### Install WINE
  2242. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}WINE${RESET} ~ run Windows programs on *nix"
  2243. apt-get -y -qq install wine winetricks || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2244. #--- Using x64?
  2245. if [[ "$(uname -m)" == 'x86_64' ]]; then
  2246. echo -e " ${GREEN}[+]${RESET} Configuring ${GREEN}WINE (x64)${RESET}"
  2247. dpkg --add-architecture i386
  2248. apt-get -qq update
  2249. apt-get -y -qq install wine-bin:i386 || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2250. #apt-get -y -qq remove wine64
  2251. apt-get -y -qq install wine32 || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2252. fi
  2253. #--- Mono
  2254. timeout 300 curl --progress -k -L -f "http://winezeug.googlecode.com/svn/trunk/install-addons.sh" | sed 's/^set -x$//' | bash - # || echo -e ' '${RED}'[!]'${RESET}" Issue downloading install-addons.sh" 1>&2
  2255. apt-get -y -qq install mono-vbnc || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} #mono-complete || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2256. #--- Run WINE for the first time
  2257. [ -e /usr/share/windows-binaries/whoami.exe ] && wine /usr/share/windows-binaries/whoami.exe &>/dev/null
  2258. #--- Winetricks: Disable 'axel' support - BUG too many redirects.
  2259. file=/usr/bin/winetricks; #[ -e "${file}" ] && cp -n $file{,.bkup}
  2260. sed -i 's/which axel /which axel_disabled /' "${file}"
  2261. #--- Setup default file association for .exe
  2262. file=~/.local/share/applications/mimeapps.list; [ -e "${file}" ] && cp -n $file{,.bkup}
  2263. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  2264. echo -e 'application/x-ms-dos-executable=wine.desktop' >> "${file}"
  2265.  
  2266.  
  2267. ##### Install MinGW (Windows) ~ cross compiling suite
  2268. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}MinGW (Windows)${RESET} ~ cross compiling suite"
  2269. #curl --progress -k -L -f "http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download" > /tmp/mingw-get-setup.exe || echo -e ' '${RED}'[!]'${RESET}" Issue downloading mingw-get-setup.exe" 1>&2 #***!!! hardcoded path!
  2270. timeout 300 curl --progress -k -L -f "http://sourceforge.net/projects/mingw/files/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip/download" > /tmp/mingw-get.zip || echo -e ' '${RED}'[!]'${RESET}" Issue downloading mingw-get.zip" 1>&2 #***!!! hardcoded path!
  2271. mkdir -p ~/.wine/drive_c/MinGW/bin/
  2272. unzip -q -o -d ~/.wine/drive_c/MinGW/ /tmp/mingw-get.zip
  2273. pushd ~/.wine/drive_c/MinGW/ >/dev/null
  2274. for FILE in mingw32-base mingw32-gcc-g++ mingw32-gcc-objc; do #msys-base
  2275. wine ./bin/mingw-get.exe install "${FILE}"
  2276. done
  2277. popd >/dev/null
  2278. grep '^"PATH"=.*C:\\\\MinGW\\\\bin' ~/.wine/system.reg || sed -i '/^"PATH"=/ s_"$_;C:\\\\MinGW\\\\bin"_' ~/.wine/system.reg
  2279. #wine cmd /c "set path=\"%path%;C:\MinGW\bin\" && reg ADD \"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\" /v Path /t REG_EXPAND_SZ /d %path% /f"
  2280.  
  2281.  
  2282. ##### Install veil framework
  2283. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}veil-evasion framework${RESET} ~ bypassing anti-virus"
  2284. if [[ "$(uname -m)" == 'x86_64' ]]; then
  2285. #dpkg --add-architecture i386 && apt-get -qq update
  2286. #apt-get -y -qq install veil-evasion:i386 || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2287. echo -e ' '${RED}'[!]'${RESET}" veil-evasion has issues with x64. Skipping..." 1>&2 # (https://bugs.kali.org/view.php?id=2673)
  2288. else
  2289. apt-get -y -qq install veil-evasion || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2290. bash /usr/share/veil-evasion/setup/setup.sh --silent
  2291. touch /etc/veil/settings.py
  2292. sed -i 's/TERMINAL_CLEAR=".*"/TERMINAL_CLEAR="false"/' /etc/veil/settings.py
  2293. fi
  2294.  
  2295.  
  2296. ##### Install OP packers
  2297. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}OP packers${RESET} ~ bypassing anti-virus"
  2298. apt-get -y -qq install upx-ucl curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} #wget -q "http://upx.sourceforge.net/download/upx309w.zip" -P /usr/share/packers/ && unzip -q -o -d /usr/share/packers/ /usr/share/packers/upx309w.zip; rm -f /usr/share/packers/upx309w.zip
  2299. mkdir -p /usr/share/packers/
  2300. timeout 300 curl --progress -k -L -f "http://www.eskimo.com/~scottlu/win/cexe.exe" > /usr/share/packers/cexe.exe || echo -e ' '${RED}'[!]'${RESET}" Issue downloading cexe.exe" 1>&2 #***!!! hardcoded path! #***!!! hardcoded version! Need to manually check for updates
  2301. timeout 300 curl --progress -k -L -f "http://www.farbrausch.de/~fg/kkrunchy/kkrunchy_023a2.zip" > /usr/share/packers/kkrunchy.zip && unzip -q -o -d /usr/share/packers/ /usr/share/packers/kkrunchy.zip|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kkrunchy.zip" 1>&2 #***!!! hardcoded version! Need to manually check for updates
  2302. timeout 300 curl --progress -k -L -f "https://pescrambler.googlecode.com/files/PEScrambler_v0_1.zip" > /usr/share/packers/PEScrambler.zip && unzip -q -o -d /usr/share/packers/ /usr/share/packers/PEScrambler.zip|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading PEScrambler.zip" 1>&2 #***!!! hardcoded version! Need to manually check for updates
  2303. #*** Need to make a bash script like hyperion...
  2304. #--- Remove old temp files
  2305. rm -f /usr/share/packers/kkrunchy*.zip
  2306. rm -f /usr/share/packers/PEScrambler*.zip
  2307.  
  2308.  
  2309. ##### Install shellter
  2310. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}shellter${RESET} ~ dynamic shellcode injector"
  2311. apt-get -y -qq install shellter || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2312.  
  2313.  
  2314. ##### Install the backdoor factory
  2315. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Backdoor Factory${RESET} ~ bypassing anti-virus"
  2316. apt-get -y -qq install backdoor-factory || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2317.  
  2318.  
  2319. ##### Install the Backdoor Factory Proxy (BDFProxy)
  2320. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Backdoor Factory Proxy (BDFProxy)${RESET} ~ patches binaries files during a MITM"
  2321. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2322. git clone -q https://github.com/secretsquirrel/BDFProxy.git /opt/bdfproxy-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2323. pushd /opt/bdfproxy-git/ >/dev/null
  2324. git pull -q
  2325. popd >/dev/null
  2326.  
  2327.  
  2328. ##### Install the BetterCap
  2329. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}BetterCap${RESET} ~ MITM framework"
  2330. apt-get -y -qq install git ruby-dev libpcap-dev || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2331. git clone -q https://github.com/evilsocket/bettercap.git /opt/bettercap-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2332. pushd /opt/bettercap-git/ >/dev/null
  2333. git pull -q
  2334. gem build bettercap.gemspec
  2335. gem install bettercap*.gem
  2336. popd >/dev/null
  2337.  
  2338.  
  2339. ##### Install the MITMf (GIT)
  2340. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}MITMf${RESET} (GIT) ~ framework for MITM attacks"
  2341. ##apt-get -y -qq install mitmf || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} # repo version. stable, but dated
  2342. #apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} # git version. bleeding edge
  2343. #git clone -q https://github.com/byt3bl33d3r/MITMf.git /opt/mitmf-git/
  2344. #pushd /opt/mitmf-git/ >/dev/null
  2345. #git pull -q
  2346. #bash kali_setup.sh
  2347. #popd >/dev/null
  2348.  
  2349.  
  2350. ##### Install FuzzDB
  2351. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}FuzzDB${RESET} ~ multiple types of (word)lists (and similar things)"
  2352. #svn -q checkout "http://fuzzdb.googlecode.com/svn/trunk/" /usr/share/fuzzdb-svn/
  2353.  
  2354.  
  2355. ##### Install seclist
  2356. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}seclist${RESET} ~ multiple types of (word)lists (and similar things)"
  2357. apt-get -y -qq install seclists || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2358. [ -e /usr/share/seclists ] && ln -sf /usr/share/seclists /usr/share/wordlists/seclists
  2359.  
  2360.  
  2361. ##### Update wordlists
  2362. echo -e "\n ${GREEN}[+]${RESET} Updating ${GREEN}wordlists${RESET} ~ collection of wordlists"
  2363. apt-get -y -qq install curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2364. #--- Extract rockyou wordlist
  2365. [ -e /usr/share/wordlists/rockyou.txt.gz ] && gzip -dc < /usr/share/wordlists/rockyou.txt.gz > /usr/share/wordlists/rockyou.txt #gunzip rockyou.txt.gz
  2366. #rm -f /usr/share/wordlists/rockyou.txt.gz
  2367. #--- Extract sqlmap wordlist
  2368. #unzip -o -d /usr/share/sqlmap/txt/ /usr/share/sqlmap/txt/wordlist.zip
  2369. #--- Add 10,000 Top/Worst/Common Passwords
  2370. mkdir -p /usr/share/wordlists/
  2371. (curl --progress -k -L -f "http://xato.net/files/10k most common.zip" > /tmp/10kcommon.zip 2>/dev/null || curl --progress -k -L -f "http://download.g0tmi1k.com/wordlists/common-10k_most_common.zip" > /tmp/10kcommon.zip 2>/dev/null) || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 10kcommon.zip" 1>&2
  2372. unzip -q -o -d /usr/share/wordlists/ /tmp/10kcommon.zip 2>/dev/null #***!!! hardcoded version! Need to manually check for updates
  2373. mv -f /usr/share/wordlists/10k{\ most\ ,_most_}common.txt
  2374. #--- Linking to more - folders
  2375. [ -e /usr/share/dirb/wordlists ] && ln -sf /usr/share/dirb/wordlists /usr/share/wordlists/dirb
  2376. #[ -e /usr/share/seclists ] && ln -sf /usr/share/seclists /usr/share/wordlists/seclists
  2377. #--- Linking to more - files
  2378. #ln -sf /usr/share/sqlmap/txt/wordlist.txt /usr/share/wordlists/sqlmap.txt
  2379. ##--- Not enough? Want more? Check below!
  2380. ##apt-cache search wordlist
  2381. ##find / \( -iname '*wordlist*' -or -iname '*passwords*' \) #-exec ls -l {} \;
  2382. #--- Remove old temp files
  2383. rm -f /tmp/10kcommon.zip
  2384.  
  2385.  
  2386. ##### Install apt-file
  2387. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}apt-file${RESET} ~ which package includes a specific file"
  2388. apt-get -y -qq install apt-file || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2389. apt-file update
  2390.  
  2391.  
  2392. ##### Install apt-show-versions
  2393. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}apt-show-versions${RESET} ~ which package version in repo"
  2394. apt-get -y -qq install apt-show-versions || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2395.  
  2396.  
  2397. ##### Install Debian weak SSH keys
  2398. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Debian weak SSH keys${RESET} ~ OpenSSL predictable PRNG"
  2399. #dpkg --remove --force-depends openssh-blacklist
  2400. #grep -q '^PermitBlacklistedKeys yes' /etc/ssh/sshd_config || echo PermitBlacklistedKeys yes >> /etc/ssh/sshd_config
  2401. #apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2402. #git clone -q https://github.com/g0tmi1k/debian-ssh.git /opt/exploit-debianssh-git/
  2403. #pushd /opt/exploit-debianssh/ >/dev/null
  2404. #git pull -q
  2405. #popd >/dev/null
  2406.  
  2407.  
  2408. ##### Install Exploit-DB binaries
  2409. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Installing Exploit-DB binaries${RESET} ~ pre-compiled exploits"
  2410. #apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2411. #git clone -q https://github.com/offensive-security/exploit-database-bin-sploits.git /opt/exploitdb-bin-git/
  2412. #pushd /opt/exploitdb-bin/ >/dev/null
  2413. #git pull -q
  2414. #popd >/dev/null
  2415.  
  2416.  
  2417. ##### Install Babel scripts
  2418. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Babel scripts${RESET} ~ post exploitation scripts"
  2419. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2420. git clone -q https://github.com/attackdebris/babel-sf.git /opt/babel-sf-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2421. pushd /opt/babel-sf-git/ >/dev/null
  2422. git pull -q
  2423. popd >/dev/null
  2424.  
  2425.  
  2426. ##### Install pwntools (https://bugs.kali.org/view.php?id=1236)
  2427. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}pwntools${RESET} ~ handy CTF tools"
  2428. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2429. git clone -q https://github.com/Gallopsled/pwntools.git /opt/pwntools-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2430. pushd /opt/pwntools-git/ >/dev/null
  2431. git pull -q
  2432. popd >/dev/null
  2433.  
  2434.  
  2435. ##### Install nullsecurity tool suite
  2436. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}nullsecurity tool suite${RESET} ~ collection of tools"
  2437. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2438. git clone -q https://github.com/nullsecuritynet/tools.git /opt/nullsecuritynet-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2439. pushd /opt/nullsecuritynet-git/ >/dev/null
  2440. git pull -q
  2441. popd >/dev/null
  2442.  
  2443.  
  2444. ##### Install gdb-peda (https://bugs.kali.org/view.php?id=2327)
  2445. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}gdb-peda${RESET} ~ GDB exploit development assistance"
  2446. apt-get -y -qq install git gdb || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2447. git clone -q https://github.com/longld/peda.git /opt/gdb-peda-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2448. pushd /opt/gdb-peda-git/ >/dev/null
  2449. git pull -q
  2450. popd >/dev/null
  2451. echo "source ~/peda/peda.py" >> ~/.gdbinit
  2452.  
  2453.  
  2454. ##### Install radare2 (https://bugs.kali.org/view.php?id=2169)
  2455. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}radare2${RESET} ~ reverse engineering framework"
  2456. #apt-get -y -qq install git gdb || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2457. #git clone -q https://github.com/radare/radare2.git /opt/radare2-git/
  2458. #pushd /opt/radare2-git/ >/dev/null
  2459. #git pull -q
  2460. #bash sys/install.sh
  2461. #popd >/dev/null
  2462.  
  2463.  
  2464. ##### Install ropeme (https://bugs.kali.org/view.php?id=2328)
  2465. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}ropeme${RESET} ~ generate ROP gadgets and payload"
  2466. apt-get -y -qq install git python-distorm3 libdistorm64-1 libdistorm64-dev binutils || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2467. git clone -q https://github.com/packz/ropeme.git /opt/ropeme-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2468. pushd /opt/ropeme-git/ >/dev/null
  2469. git reset --hard HEAD
  2470. git pull -q
  2471. sed -i 's/distorm/distorm3/g' ropeme/gadgets.py
  2472. popd >/dev/null
  2473. #--- Add to path
  2474. file=/usr/local/bin/ropeme-git
  2475. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2476. #!/bin/bash
  2477.  
  2478. cd /opt/ropeme-git/ && python ropeme/ropshell.py "\$@"
  2479. EOF
  2480. chmod +x "${file}"
  2481.  
  2482.  
  2483. ##### Install ropper (https://bugs.kali.org/view.php?id=2329)
  2484. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}ropper${RESET} ~ generate ROP gadgets and payload"
  2485. apt-get -y -qq install git python-capstone || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2486. git clone -q https://github.com/sashs/Ropper.git /opt/ropper-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2487. pushd /opt/ropper-git/ >/dev/null
  2488. git pull -q
  2489. python setup.py install
  2490. popd >/dev/null
  2491.  
  2492.  
  2493. ##### Install dissy
  2494. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}dissy${RESET} ~ GUI objdump"
  2495. apt-get -y -qq install dissy binutils || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2496.  
  2497.  
  2498. ##### Install shellnoob
  2499. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}shellnoob${RESET} ~ shellcode writing toolkit"
  2500. apt-get -y -qq install shellnoob || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2501.  
  2502.  
  2503. ##### Install checksec
  2504. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}checksec${RESET} ~ check *nix OS for security features"
  2505. apt-get -y -qq install curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2506. mkdir -p /usr/share/checksec/
  2507. file=/usr/share/checksec/checksec.sh
  2508. timeout 300 curl --progress -k -L -f "http://www.trapkit.de/tools/checksec.sh" > "${file}" || echo -e ' '${RED}'[!]'${RESET}" Issue downloading checksec.zip" 1>&2 #***!!! hardcoded patch
  2509. chmod +x "${file}"
  2510.  
  2511.  
  2512. ##### Install shellconv
  2513. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}shellconv${RESET} ~ shellcode disassembler"
  2514. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2515. git clone -q https://github.com/hasherezade/shellconv.git /opt/shellconv-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2516. pushd /opt/shellconv-git/ >/dev/null
  2517. git pull -q
  2518. popd >/dev/null
  2519. #--- Add to path
  2520. file=/usr/local/bin/shellconv-git
  2521. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2522. #!/bin/bash
  2523.  
  2524. cd /opt/shellconv-git/ && python shellconv.py "\$@"
  2525. EOF
  2526. chmod +x "${file}"
  2527.  
  2528.  
  2529. ##### Install bless
  2530. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}bless${RESET} ~ GUI hex editor"
  2531. apt-get -y -qq install bless || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2532.  
  2533.  
  2534. ##### Install dhex
  2535. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}dhex${RESET} ~ CLI hex compare"
  2536. apt-get -y -qq install dhex || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2537.  
  2538.  
  2539. ##### Install firmware-mod-kit
  2540. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}firmware-mod-kit${RESET} ~ customize firmware"
  2541. apt-get -y -qq install firmware-mod-kit || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2542.  
  2543.  
  2544. if [[ "$(uname -m)" == "x86_64" ]]; then
  2545. ##### Install lnav
  2546. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}lnav${RESET} (x64) ~ CLI log veiwer"
  2547. # apt-get -y -qq install git ncurses-dev libsqlite3-dev libgpm-dev || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2548. # git clone -q https://github.com/tstack/lnav.git /usr/local/src/tstack-git/
  2549. # pushd /usr/local/src/tstack-git >/dev/null
  2550. # git pull -q
  2551. # make -s clean
  2552. # bash autogen.sh
  2553. # ./configure
  2554. # make -s && make -s install
  2555. # popd >/dev/null
  2556. curl --progress -k -L -f "https://github.com/tstack/lnav/releases/download/v0.7.3/lnav-0.7.3-linux-64bit.zip" > /tmp/lnav.zip || echo -e ' '${RED}'[!]'${RESET}" Issue downloading lnav.zip" 1>&2 #***!!! hardcoded version! Need to manually check for updates
  2557. unzip -q -o -d /tmp/ /tmp/lnav.zip
  2558. #--- Add to path
  2559. mv -f /tmp/lnav-*/lnav /usr/local/bin/
  2560. fi
  2561.  
  2562.  
  2563. ##### Install sqlmap (GIT)
  2564. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}sqlmap${RESET} (GIT) ~ automatic SQL injection"
  2565. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2566. git clone -q https://github.com/sqlmapproject/sqlmap.git /opt/sqlmap-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2567. pushd /opt/sqlmap-git/ >/dev/null
  2568. git pull -q
  2569. popd >/dev/null
  2570. #--- Add to path
  2571. file=/usr/local/bin/sqlmap-git
  2572. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2573. #!/bin/bash
  2574.  
  2575. cd /opt/sqlmap-git/ && python sqlmap.py "\$@"
  2576. EOF
  2577. chmod +x "${file}"
  2578.  
  2579.  
  2580. ##### Install commix (https://bugs.kali.org/view.php?id=2201)
  2581. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}commix${RESET} ~ automatic command injection"
  2582. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2583. git clone -q https://github.com/stasinopoulos/commix.git /opt/commix-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2584. pushd /opt/commix-git/ >/dev/null
  2585. git pull -q
  2586. popd >/dev/null
  2587. #--- Add to path
  2588. file=/usr/local/bin/commix-git
  2589. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2590. #!/bin/bash
  2591.  
  2592. cd /opt/commix-git/ && python commix.py "\$@"
  2593. EOF
  2594. chmod +x "${file}"
  2595.  
  2596.  
  2597. ##### Install fimap
  2598. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}fimap${RESET} ~ automatic LFI/RFI tool"
  2599. apt-get -y -qq install fimap || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2600.  
  2601.  
  2602. ##### Install smbmap
  2603. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}smbmap${RESET} ~ SMB enumeration tool"
  2604. apt-get -y -qq install smbmap || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2605.  
  2606.  
  2607. ##### Install smbspider
  2608. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}smbspider${RESET} ~ search network shares"
  2609. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2610. git clone -q https://github.com/T-S-A/smbspider.git /opt/smbspider-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2611.  
  2612.  
  2613. ##### Install CrackMapExec
  2614. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}CrackMapExec${RESET} ~ Swiss army knife for Windows environments"
  2615. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2616. git clone -q https://github.com/byt3bl33d3r/CrackMapExec.git /opt/crackmapexec-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2617.  
  2618.  
  2619. ##### Install credcrack
  2620. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}credcrack${RESET} ~ credential harvester via Samba"
  2621. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2622. git clone -q https://github.com/gojhonny/CredCrack.git /opt/credcrack-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2623.  
  2624.  
  2625. ##### Install Empire
  2626. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Empire${RESET} ~ PowerShell post-exploitation"
  2627. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2628. git clone -q https://github.com/PowerShellEmpire/Empire.git /opt/empire-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2629.  
  2630.  
  2631. ##### Install wig (https://bugs.kali.org/view.php?id=1932)
  2632. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}wig${RESET} ~ web application detection"
  2633. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2634. git clone -q https://github.com/jekyc/wig.git /opt/wig-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2635. pushd /opt/wig-git/ >/dev/null
  2636. git pull -q
  2637. popd >/dev/null
  2638. #--- Add to path
  2639. file=/usr/local/bin/wig-git
  2640. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2641. #!/bin/bash
  2642.  
  2643. cd /opt/wig-git/ && python wig.py "\$@"
  2644. EOF
  2645. chmod +x "${file}"
  2646.  
  2647.  
  2648. ##### Install CMSmap
  2649. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}CMSmap${RESET} ~ CMS detection"
  2650. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2651. git clone -q https://github.com/Dionach/CMSmap.git /opt/cmsmap-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2652. pushd /opt/cmsmap-git/ >/dev/null
  2653. git pull -q
  2654. popd >/dev/null
  2655. #--- Add to path
  2656. file=/usr/local/bin/cmsmap-git
  2657. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2658. #!/bin/bash
  2659.  
  2660. cd /opt/cmsmap-git/ && python cmsmap.py "\$@"
  2661. EOF
  2662. chmod +x "${file}"
  2663.  
  2664.  
  2665. ##### Install CMSScanner
  2666. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}CMSScanner${RESET} ~ CMS detection"
  2667. #apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2668. #git clone -q https://github.com/wpscanteam/CMSScanner.git /opt/cmsscanner-git/
  2669. #pushd /opt/cmsscanner-git/ >/dev/null
  2670. #git pull -q
  2671. #bundle install
  2672. #popd >/dev/null
  2673.  
  2674.  
  2675. ##### Install droopescan
  2676. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}DroopeScan${RESET} ~ Drupal vulnerability scanner"
  2677. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2678. git clone -q https://github.com/droope/droopescan.git /opt/droopescan-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2679. pushd /opt/droopescan-git/ >/dev/null
  2680. git pull -q
  2681. popd >/dev/null
  2682. #--- Add to path
  2683. file=/usr/local/bin/droopescan-git
  2684. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2685. #!/bin/bash
  2686.  
  2687. cd /opt/droopescan-git/ && python droopescan "\$@"
  2688. EOF
  2689. chmod +x "${file}"
  2690.  
  2691.  
  2692. ##### Install wpscan (GIT)
  2693. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}WPScan${RESET} (GIT) ~ WordPress vulnerability scanner"
  2694. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2695. git clone -q https://github.com/wpscanteam/wpscan.git /opt/wpscan-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2696. pushd /opt/wpscan-git/ >/dev/null
  2697. git pull -q
  2698. popd >/dev/null
  2699. #--- Add to path
  2700. file=/usr/local/bin/wpscan-git
  2701. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2702. #!/bin/bash
  2703.  
  2704. cd /opt/wpscan-git/ && ruby wpscan.rb "\$@"
  2705. EOF
  2706. chmod +x "${file}"
  2707.  
  2708.  
  2709. ##### Install BeEF XSS
  2710. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}BeEF XSS${RESET} ~ XSS framework"
  2711. apt-get -y -qq install beef-xss || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2712. #--- Configure beef
  2713. file=/usr/share/beef-xss/config.yaml; [ -e "${file}" ] && cp -n $file{,.bkup}
  2714. username="root"
  2715. password="toor"
  2716. sed -i 's/user:.*".*"/user: "'${username}'"/' "${file}"
  2717. sed -i 's/passwd:.*".*"/passwd: "'${password}'"/' "${file}"
  2718. echo -e " ${YELLOW}[i]${RESET} BeEF username: ${username}"
  2719. echo -e " ${YELLOW}[i]${RESET} BeEF password: ${password} ***${BOLD}CHANGE THIS ASAP${RESET}***. Edit: /usr/share/beef-xss/config.yaml"
  2720. #--- Example hook
  2721. #<script src="http://192.168.155.175:3000/hook.js" type="text/javascript"></script>
  2722.  
  2723.  
  2724. ##### Install sonar.js
  2725. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}sonar.js${RESET} ~ Internal network framework"
  2726. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2727. git clone -q https://github.com/mandatoryprogrammer/sonar.js.git /opt/sonar-js-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2728.  
  2729.  
  2730. ##### Install patator (GIT)
  2731. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}patator${RESET} (GIT) ~ brute force"
  2732. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2733. git clone -q https://github.com/lanjelot/patator.git /opt/patator-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2734. pushd /opt/patator-git/ >/dev/null
  2735. git pull -q
  2736. popd >/dev/null
  2737. #--- Add to path
  2738. file=/usr/local/bin/patator-git
  2739. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2740. #!/bin/bash
  2741.  
  2742. cd /opt/patator-git/ && python patator.py "\$@"
  2743. EOF
  2744. chmod +x "${file}"
  2745.  
  2746.  
  2747. ##### Install crowbar
  2748. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}crowbar${RESET} ~ brute force"
  2749. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2750. git clone -q https://github.com/galkan/crowbar.git /opt/crowbar-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2751. pushd /opt/crowbar-git/ >/dev/null
  2752. git pull -q
  2753. popd >/dev/null
  2754. #--- Add to path
  2755. file=/usr/local/bin/crowbar-git
  2756. cat <<EOF > "${file}" || echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2
  2757. #!/bin/bash
  2758.  
  2759. cd /opt/crowbar-git/ && python crowbar.py "\$@"
  2760. EOF
  2761. chmod +x "${file}"
  2762.  
  2763.  
  2764. ##### Install xprobe
  2765. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}xprobe${RESET} ~ os fingerprinting"
  2766. apt-get install -y -qq xprobe || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2767.  
  2768.  
  2769. ##### Install p0f
  2770. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}p0f${RESET} ~ os fingerprinting"
  2771. apt-get install -y -qq p0f || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2772. #p0f -i eth0 -p & curl 192.168.0.1
  2773.  
  2774.  
  2775. ##### Install nbtscan ~ http://unixwiz.net/tools/nbtscan.html vs http://inetcat.org/software/nbtscan.html (see http://sectools.org/tool/nbtscan/)
  2776. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}nbtscan${RESET} (${GREEN}inetcat${RESET} & ${GREEN}unixwiz${RESET}) ~ netbios scanner"
  2777. #--- inetcat - 1.5.x
  2778. apt-get install -y -qq nbtscan || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2779. #nbtscan -r 192.168.0.1/24
  2780. #nbtscan -r 192.168.0.1/24 -v
  2781. #--- unixwiz - 1.0.x
  2782. mkdir -p /usr/local/src/nbtscan-unixwiz/
  2783. timeout 300 curl --progress -k -L -f "http://unixwiz.net/tools/nbtscan-source-1.0.35.tgz" > /usr/local/src/nbtscan-unixwiz/nbtscan.tgz || echo -e ' '${RED}'[!]'${RESET}" Issue downloading nbtscan.tgz" 1>&2 #***!!! hardcoded version! Need to manually check for updates
  2784. tar -zxf /usr/local/src/nbtscan-unixwiz/nbtscan.tgz -C /usr/local/src/nbtscan-unixwiz/
  2785. pushd /usr/local/src/nbtscan-unixwiz/ >/dev/null
  2786. make -s clean; make -s 2>/dev/null # bad, but it gives errors which might be confusing (still builds)
  2787. popd >/dev/null
  2788. ln -sf /usr/local/src/nbtscan-unixwiz/nbtscan /usr/local/bin/nbtscan-uw
  2789. #nbtscan-uw -f 192.168.0.1/24
  2790.  
  2791.  
  2792. ##### Setup tftp client & server
  2793. echo -e "\n ${GREEN}[+]${RESET} Setting up ${GREEN}tftp client${RESET} & ${GREEN}server${RESET} ~ file transfer methods"
  2794. apt-get -y -qq install tftp || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} # tftp client
  2795. apt-get -y -qq install atftpd || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} # tftp server
  2796. #--- Configure atftpd
  2797. file=/etc/default/atftpd; [ -e "${file}" ] && cp -n $file{,.bkup}
  2798. echo -e 'USE_INETD=false\nOPTIONS="--tftpd-timeout 300 --retry-timeout 5 --maxthread 100 --verbose=5 --daemon --port 69 /var/tftp"' > "${file}"
  2799. mkdir -p /var/tftp/
  2800. chown -R nobody\:root /var/tftp/
  2801. chmod -R 0755 /var/tftp/
  2802. #--- Setup alias
  2803. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  2804. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  2805. grep -q '^## tftp' "${file}" 2>/dev/null || echo -e '## tftp\nalias tftproot="cd /var/tftp/"\n' >> "${file}" # systemctl atftpd start
  2806. #--- Remove from start up
  2807. systemctl disable atftpd
  2808. #--- Disabling IPv6 can help
  2809. #echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
  2810. #echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
  2811.  
  2812.  
  2813. ##### Install Pure-FTPd
  2814. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}Pure-FTPd${RESET} ~ FTP server/file transfer method"
  2815. apt-get -y -qq install pure-ftpd || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2816. #--- Setup pure-ftpd
  2817. mkdir -p /var/ftp/
  2818. groupdel ftpgroup 2>/dev/null; groupadd ftpgroup
  2819. userdel ftp 2>/dev/null; useradd -r -M -d /var/ftp/ -s /bin/false -c "FTP user" -g ftpgroup ftp
  2820. chown -R ftp\:ftpgroup /var/ftp/
  2821. chmod -R 0755 /var/ftp/
  2822. pure-pw userdel ftp 2>/dev/null; echo -e '\n' | pure-pw useradd ftp -u ftp -d /var/ftp/
  2823. pure-pw mkdb
  2824. #--- Configure pure-ftpd
  2825. echo "no" > /etc/pure-ftpd/conf/UnixAuthentication
  2826. echo "no" > /etc/pure-ftpd/conf/PAMAuthentication
  2827. echo "yes" > /etc/pure-ftpd/conf/NoChmod
  2828. echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone
  2829. #echo "yes" > /etc/pure-ftpd/conf/AnonymousOnly
  2830. echo "no" > /etc/pure-ftpd/conf/NoAnonymous
  2831. echo "yes" > /etc/pure-ftpd/conf/AnonymousCanCreateDirs
  2832. echo "yes" > /etc/pure-ftpd/conf/AllowAnonymousFXP
  2833. echo "no" > /etc/pure-ftpd/conf/AnonymousCantUpload
  2834. echo "30768 31768" > /etc/pure-ftpd/conf/PassivePortRange #cat /proc/sys/net/ipv4/ip_local_port_range
  2835. echo "/etc/pure-ftpd/welcome.msg" > /etc/pure-ftpd/conf/FortunesFile #/etc/motd
  2836. echo "FTP" > /etc/pure-ftpd/welcome.msg
  2837. #--- 'Better' MOTD
  2838. apt-get install -y -qq cowsay || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2839. echo "Moo" | /usr/games/cowsay > /etc/pure-ftpd/welcome.msg
  2840. #--- SSL
  2841. #mkdir -p /etc/ssl/private/
  2842. #openssl req -x509 -nodes -newkey rsa:4096 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
  2843. #chmod -f 0600 /etc/ssl/private/*.pem
  2844. ln -sf /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/50pure
  2845. #--- Apply settings
  2846. #systemctl restart pure-ftpd
  2847. echo -e " ${YELLOW}[i]${RESET} Pure-FTPd username: anonymous"
  2848. echo -e " ${YELLOW}[i]${RESET} Pure-FTPd password: anonymous"
  2849. #--- Setup alias
  2850. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  2851. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  2852. grep -q '^## ftp' "${file}" 2>/dev/null || echo -e '## ftp\nalias ftproot="cd /var/ftp/"\n' >> "${file}" # systemctl pure-ftpd start
  2853. #--- Remove from start up
  2854. systemctl disable pure-ftpd
  2855.  
  2856.  
  2857. ##### Install samba
  2858. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}samba${RESET} ~ file transfer method"
  2859. #--- Installing samba
  2860. apt-get -y -qq install samba || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2861. apt-get -y -qq install cifs-utils || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2862. #--- Create samba user
  2863. groupdel smbgroup 2>/dev/null; groupadd smbgroup
  2864. userdel samba 2>/dev/null; useradd -r -M -d /nonexistent -s /bin/false -c "Samba user" -g smbgroup samba
  2865. #--- Use the samba user
  2866. file=/etc/samba/smb.conf; [ -e "${file}" ] && cp -n $file{,.bkup}
  2867. sed -i 's/guest account = .*/guest account = samba/' "${file}" 2>/dev/null
  2868. grep -q 'guest account' "${file}" 2>/dev/null || sed -i 's#\[global\]#\[global\]\n guest account = samba#' "${file}"
  2869. #--- Setup samba paths
  2870. grep -q '^\[shared\]' "${file}" 2>/dev/null || cat <<EOF >> "${file}"
  2871.  
  2872. [shared]
  2873. comment = Shared
  2874. path = /var/samba/
  2875. browseable = yes
  2876. guest ok = yes
  2877. #guest only = yes
  2878. read only = no
  2879. writable = yes
  2880. create mask = 0644
  2881. directory mask = 0755
  2882. EOF
  2883. #--- Create samba path and configure it
  2884. mkdir -p /var/samba/
  2885. chown -R samba\:smbgroup /var/samba/
  2886. chmod -R 0755 /var/samba/ #chmod 0777 /var/samba/
  2887. #--- Bug fix
  2888. touch /etc/printcap
  2889. #--- Check result
  2890. #systemctl restart samba
  2891. #smbclient -L \\127.0.0.1 -N
  2892. #mount -t cifs -o guest //192.168.1.2/share /mnt/smb mkdir -p /mnt/smb
  2893. #--- Disable samba at startup
  2894. systemctl stop samba
  2895. systemctl disable samba
  2896. echo -e " ${YELLOW}[i]${RESET} Samba username: guest"
  2897. echo -e " ${YELLOW}[i]${RESET} Samba password: <blank>"
  2898. #--- Setup alias
  2899. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  2900. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  2901. grep -q '^## smb' "${file}" 2>/dev/null || echo -e '## smb\nalias sambaroot="cd /var/samba/"\n#alias smbroot="cd /var/samba/"\n' >> "${file}"
  2902.  
  2903.  
  2904. ##### Install apache2 & php5
  2905. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}apache2${RESET} & ${GREEN}php5${RESET} ~ web server"
  2906. apt-get -y -qq install apache2
  2907. touch /var/www/html/favicon.ico
  2908. if [[ -e /var/www/html/index.html ]]; then
  2909. grep -q '<title>Apache2 Debian Default Page: It works</title>' /var/www/html/index.html && rm -f /var/www/html/index.html && echo '<?php echo "Access denied for " . $_SERVER["REMOTE_ADDR"]; ?>' > /var/www/html/index.php
  2910. fi
  2911. #sed -i 's/^display_errors = .*/display_errors = on/' /etc/php5/apache2/php.ini
  2912. #--- Setup alias
  2913. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  2914. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  2915. grep -q '^## www' "${file}" 2>/dev/null || echo -e '## www\nalias wwwroot="cd /var/www/html/"\n' >> "${file}" # systemctl apache2 start
  2916. #--- php fu
  2917. apt-get -y -qq install php5 php5-cli php5-curl
  2918.  
  2919.  
  2920. ##### Install mysql
  2921. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}MySQL${RESET} ~ database"
  2922. apt-get -y -qq install mysql-server
  2923. echo -e " ${YELLOW}[i]${RESET} MySQL username: root"
  2924. echo -e " ${YELLOW}[i]${RESET} MySQL password: <blank> ***${BOLD}CHANGE THIS ASAP${RESET}***"
  2925. if [[ ! -e ~/.my.cnf ]]; then
  2926. cat <<EOF > ~/.my.cnf
  2927. [client]
  2928. user=root
  2929. host=localhost
  2930. password=
  2931. EOF
  2932. fi
  2933.  
  2934.  
  2935. ##### Install phpmyadmin
  2936. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}phpmyadmin${RESET} ~ database web ui"
  2937. #apt-get -y -qq install phpmyadmin
  2938. #sed -i "s_^// \$cfg\['Servers'\]\[\$i\]\['AllowNoPassword'\] = .*;_\$cfg\['Servers'\]\[\$i\]\['AllowNoPassword'\] = yes;_" /etc/phpmyadmin/config.inc.php
  2939.  
  2940.  
  2941. ##### Install rsh-client
  2942. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}rsh-client${RESET} ~ remote shell connections"
  2943. apt-get -y -qq install rsh-client || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2944.  
  2945.  
  2946. ##### Install sshpass
  2947. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}sshpass${RESET} ~ automating SSH connections"
  2948. apt-get -y -qq install sshpass || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2949.  
  2950.  
  2951. ##### Install DBeaver
  2952. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}DBeaver${RESET} ~ GUI DB manager"
  2953. apt-get -y -qq install curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2954. arch="i386"
  2955. [[ "$(uname -m)" == "x86_64" ]] && arch="amd64"
  2956. timeout 300 curl --progress -k -L -f "http://dbeaver.jkiss.org/files/dbeaver-ce_latest_${arch}.deb" > /tmp/dbeaver.deb || echo -e ' '${RED}'[!]'${RESET}" Issue downloading dbeaver.deb" 1>&2 #***!!! hardcoded version! Need to manually check for updates
  2957. dpkg -i /tmp/dbeaver.deb
  2958. #--- Add to path
  2959. ln -sf /usr/share/dbeaver/dbeaver /usr/local/bin/dbeaver
  2960.  
  2961.  
  2962. ##### Install ashttp
  2963. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}ashttp${RESET} ~ Share your terminal via the web"
  2964. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2965. git clone -q https://github.com/JulienPalard/ashttp.git /opt/ashttp-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2966.  
  2967.  
  2968. ##### Install gotty
  2969. echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}gotty${RESET} ~ Share your terminal via the web"
  2970. apt-get -y -qq install git || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2971. git clone -q https://github.com/yudai/gotty.git /opt/gotty-git/ || echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&2
  2972.  
  2973.  
  2974. ##### Setup a jail ~ http://allanfeid.com/content/creating-chroot-jail-ssh-access
  2975. echo -e "\n ${GREEN}[+]${RESET} Setting up a ${GREEN}jail${RESET} ~ testing environment"
  2976. apt-get -y -qq install debootstrap curl || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2977. #mkdir -p /var/jail/
  2978. #debootstrap wheezy /var/jail/
  2979. #SHELL=/bin/bash
  2980. #chroot /var/jail
  2981. #---
  2982. #mkdir -p /var/jail/{dev,etc,lib,usr,bin}/
  2983. #mkdir -p /var/jail/{,usr/}bin/
  2984. #chown root\:root /var/jail
  2985. #mknod -m 666 /var/jail/dev/null c 1 3
  2986. #cp -f /etc/ld.so.cache /etc/ld.so.cache /etc/ld.so.conf /etc/nsswitch.conf /etc/hosts /var/jail/etc/
  2987. #cp -f /bin/ls /bin/bash /var/jail/bin/
  2988. ##ldd /bin/ls
  2989. #curl --progress -k -L -f "http://www.cyberciti.biz/files/lighttpd/l2chroot.txt" > /usr/sbin/l2chroot || echo -e ' '${RED}'[!]'${RESET}" Issue downloading l2chroot" 1>&2 #***!!! hardcoded path!
  2990. #sed -i 's#^BASE=".*"#BASE="/var/jail"#' /usr/sbin/l2chroot
  2991. #chmod +x /usr/sbin/l2chroot
  2992.  
  2993.  
  2994. ##### Setup SSH
  2995. echo -e "\n ${GREEN}[+]${RESET} Setting up ${GREEN}SSH${RESET} ~ CLI access"
  2996. apt-get -y -qq install openssh-server || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  2997. #--- Wipe current keys
  2998. rm -f /etc/ssh/ssh_host_*
  2999. find ~/.ssh/ -type f ! -name authorized_keys -delete 2>/dev/null #rm -f "~/.ssh/!(authorized_keys)" 2>/dev/null
  3000. #--- Generate new keys
  3001. #ssh-keygen -A # Automatic method - we lose control of amount of bits used
  3002. ssh-keygen -b 4096 -t rsa1 -f /etc/ssh/ssh_host_key -P ""
  3003. ssh-keygen -b 4096 -t rsa -f /etc/ssh/ssh_host_rsa_key -P ""
  3004. ssh-keygen -b 1024 -t dsa -f /etc/ssh/ssh_host_dsa_key -P ""
  3005. ssh-keygen -b 521 -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -P ""
  3006. ssh-keygen -b 4096 -t rsa -f ~/.ssh/id_rsa -P ""
  3007. #--- Change MOTD
  3008. apt-get install -y -qq cowsay || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  3009. echo "Moo" | /usr/games/cowsay > /etc/motd
  3010. #--- Change SSH settings
  3011. file=/etc/ssh/sshd_config; [ -e "${file}" ] && cp -n $file{,.bkup}
  3012. sed -i 's/^PermitRootLogin .*/PermitRootLogin yes/g' "${file}" # Accept password login (overwrite Debian 8's more secuire default option...)
  3013. sed -i 's/^#AuthorizedKeysFile /AuthorizedKeysFile /g' "${file}" # Allow for key based login
  3014. #sed -i 's/^Port .*/Port 2222/g' "${file}"
  3015. #--- Enable ssh at startup
  3016. #systemctl enable ssh
  3017. #--- Setup alias (handy for 'zsh: correct 'ssh' to '.ssh' [nyae]? n')
  3018. file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases
  3019. ([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"
  3020. grep -q '^## ssh' "${file}" 2>/dev/null || echo -e '## ssh\nalias ssh-start="systemctl restart ssh"\nalias ssh-stop="systemctl stop ssh"\n' >> "${file}"
  3021.  
  3022.  
  3023. ###### Setup G/UFW
  3024. #echo -e "\n ${GREEN}[+]${RESET} Installing ${GREEN}G/UFW${RESET} ~ firewall rule generator"
  3025. #apt-get -y -qq install ufw gufw || echo -e ' '${RED}'[!] Issue with apt-get'${RESET} 1>&2
  3026.  
  3027.  
  3028. ##### Custom insert point
  3029.  
  3030.  
  3031. ##### Clean the system
  3032. echo -e "\n ${GREEN}[+]${RESET} ${GREEN}Cleaning${RESET} the system"
  3033. #--- Clean package manager
  3034. for FILE in clean autoremove; do apt-get -y -qq "${FILE}"; done # Clean up - clean remove autoremove autoclean
  3035. apt-get -y -qq purge $(dpkg -l | tail -n +6 | egrep -v '^(h|i)i' | awk '{print $2}') # Purged packages
  3036. #--- Update slocate database
  3037. updatedb
  3038. #--- Reset folder location
  3039. cd ~/ &>/dev/null
  3040. #--- Remove any history files (as they could contain sensitive info)
  3041. [[ "${SHELL}" == "/bin/zsh" ]] || history -c
  3042. for i in $(cut -d: -f6 /etc/passwd | sort -u); do
  3043. [ -e "${i}" ] && find "${i}" -type f -name '.*_history' -delete
  3044. done
  3045.  
  3046. if [ "${freezeDEB}" != "false" ]; then
  3047. ##### Don't ever update these packages (during this install!)
  3048. echo -e "\n ${GREEN}[+]${RESET} ${GREEN}Don't upgrade${RESET} these packages:"
  3049. for x in metasploit-framework; do
  3050. echo -e " ${YELLOW}[i]${RESET} + ${x}"
  3051. echo "${x} install" | dpkg --set-selections
  3052. done
  3053. fi
  3054.  
  3055.  
  3056. ##### Time taken
  3057. finish_time=$(date +%s)
  3058. echo -e "\n ${YELLOW}[i]${RESET} Time (roughly) taken: ${YELLOW}$(( $(( finish_time - start_time )) / 60 )) minutes${RESET}"
  3059.  
  3060.  
  3061. #-Done-----------------------------------------------------------------#
  3062.  
  3063.  
  3064. ##### Done!
  3065. echo -e "\n ${YELLOW}[i]${RESET} Don't forget to:"
  3066. echo -e " ${YELLOW}[i]${RESET} + Check the above output (Did everything install? Any errors? (${RED}HINT: What's in RED${RESET}?)"
  3067. echo -e " ${YELLOW}[i]${RESET} + Manually install: Nessus, Nexpose, and/or Metasploit Community"
  3068. echo -e " ${YELLOW}[i]${RESET} + Agree/Accept to: Maltego, OWASP ZAP, w3af, etc"
  3069. echo -e " ${YELLOW}[i]${RESET} + Setup git: git config --global user.name <name>;git config --global user.email <email>"
  3070. #echo -e " ${YELLOW}[i]${RESET} + ${YELLOW}Change time zone${RESET} & ${YELLOW}keyboard layout${RESET} (...if not ${BOLD}${timezone}${RESET} & ${BOLD}${keyboardLayout}${RESET})"
  3071. echo -e " ${YELLOW}[i]${RESET} + ${YELLOW}Change default passwords${RESET}: PostgreSQL/MSF, MySQL, OpenVAS, BeEF XSS, etc"
  3072. echo -e " ${YELLOW}[i]${RESET} + ${YELLOW}Reboot${RESET}"
  3073. (dmidecode | grep -iq virtual) && echo -e " ${YELLOW}[i]${RESET} + Take a snapshot (Virtual machine detected!)"
  3074.  
  3075. echo -e '\n'${BLUE}'[*]'${RESET}' '${BOLD}'Done!'${RESET}'\n\a'
  3076. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement