diff --git a/build.sh b/build.sh index 3a433cc..e2e3be0 100755 --- a/build.sh +++ b/build.sh @@ -8,7 +8,9 @@ mkdir -p target/overlay/var/www/html echo "[+] Cloning buildroot" git clone https://github.com/buildroot/buildroot.git target/buildroot echo "[+] Building the keygen" - +mkdir -p conf/usr/sbin +gcc -o conf/usr/sbin/cfgbin keygen/keygen.c +strip conf/usr/sbin/cfgbin echo "[+] Adding customization files" cp -R buildroot/* target/buildroot # copy buildroot configs cp -R conf/* target/overlay # copy target system config files diff --git a/conf/etc/hostapd.conf b/conf/etc/hostapd.conf index 7e48b2f..e00087c 100644 --- a/conf/etc/hostapd.conf +++ b/conf/etc/hostapd.conf @@ -3,12 +3,12 @@ hw_mode=g channel=1 wmm_enabled=1 -ssid=Challenge-A2D0 +ssid={{SSID}} auth_algs=1 wpa=2 wpa_key_mgmt=WPA-PSK rsn_pairwise=CCMP -wpa_passphrase=somepassword +wpa_passphrase={{WPA}} ht_capab=[LDPC][HT40+][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][MAX-AMSDU-7935][DSSS_CCK-40] ctrl_interface=/var/run/hostapd diff --git a/conf/etc/init.d/S10cfgbin b/conf/etc/init.d/S10cfgbin new file mode 100644 index 0000000..6bb31bd --- /dev/null +++ b/conf/etc/init.d/S10cfgbin @@ -0,0 +1,20 @@ +#!/bin/sh + +case "$1" in + start) + printf "Starting cfgbin: " + /usr/sbin/cfgbin + test -f /etc/serial || exit 0 + test -f /etc/ssid || exit 0 + test -f /etc/wpa || exit 0 + $SSID=`cat /etc/ssid` + $WPA=`cat /etc/wpa` + sed -i "s/{{SSID}}/$SSID/g" /etc/hostapd.conf + sed -i "s/{{WPA}}/$WPA/g" /etc/hostapd.conf + ;; + *) + echo "Usage: $0 {start}" + exit 1 +esac + +exit 0 \ No newline at end of file diff --git a/keygen/keygen.c b/keygen/keygen.c index 6a62668..ef0e319 100644 --- a/keygen/keygen.c +++ b/keygen/keygen.c @@ -5,7 +5,7 @@ #include #include -// md5 da rosettacode + typedef union uwb { unsigned w; @@ -235,9 +235,6 @@ int gen_key(char *serial, char *mac) } } - printf("%s\n", md5a); - printf("%s\n", md5b); - strncpy(wstr, md5a, 8); strncpy(xstr, md5a + 8, 8); strncpy(ystr, md5a + 16, 8); diff --git a/webpanel/index.php b/webpanel/index.php index a3c5d23..9c09b05 100644 --- a/webpanel/index.php +++ b/webpanel/index.php @@ -44,7 +44,7 @@ require_once("includes/nav.php");
 			
 			
-