Fix Carriage Return

This commit is contained in:
Giulio 2020-05-21 16:44:20 +02:00
parent d0b6b58313
commit 11ea9972b6
13 changed files with 197 additions and 197 deletions

View File

@ -1,20 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# for dependencies # for dependencies
# apt install -t build-essential libncurses-dev bison flex libssl-dev libelf-dev # apt install -t build-essential libncurses-dev bison flex libssl-dev libelf-dev
echo "[+] Starting build script..." echo "[+] Starting build script..."
mkdir target/overlay/var/www/html mkdir target/overlay/var/www/html
echo "[+] Cloning buildroot" echo "[+] Cloning buildroot"
git clone https://github.com/buildroot/buildroot.git target git clone https://github.com/buildroot/buildroot.git target
echo "[+] Building the keygen" echo "[+] Building the keygen"
echo "[+] Adding customization files" echo "[+] Adding customization files"
cp -R buildroot/* target/buildroot # copy buildroot configs cp -R buildroot/* target/buildroot # copy buildroot configs
cp -R conf/* target/ovarlay # copy target system config files cp -R conf/* target/ovarlay # copy target system config files
cp -R webpanel/* target/overlay/var/www/html # copy the webpanel cp -R webpanel/* target/overlay/var/www/html # copy the webpanel
cp -R update/* target/ovarlay #copy the update script and certificate cp -R update/* target/ovarlay #copy the update script and certificate
echo "[+] Building the image" echo "[+] Building the image"
N=`grep -c '^processor' /proc/cpuinfo` N=`grep -c '^processor' /proc/cpuinfo`
cd target/buildroot cd target/buildroot
make -j$N make -j$N

View File

@ -1,23 +1,23 @@
#!/bin/sh #!/bin/sh
case "$1" in case "$1" in
start) start)
printf "Starting hostapd: " printf "Starting hostapd: "
start-stop-daemon -S -x /usr/sbin/hostapd -- -B /etc/hostapd.conf start-stop-daemon -S -x /usr/sbin/hostapd -- -B /etc/hostapd.conf
[ $? = 0 ] && echo "OK" || echo "FAIL" [ $? = 0 ] && echo "OK" || echo "FAIL"
;; ;;
stop) stop)
printf "Stopping hostapd: " printf "Stopping hostapd: "
start-stop-daemon -K -q -x /usr/sbin/hostapd start-stop-daemon -K -q -x /usr/sbin/hostapd
[ $? = 0 ] && echo "OK" || echo "FAIL" [ $? = 0 ] && echo "OK" || echo "FAIL"
;; ;;
restart|reload) restart|reload)
$0 stop $0 stop
$0 start $0 start
;; ;;
*) *)
echo "Usage: $0 {start|stop|restart}" echo "Usage: $0 {start|stop|restart}"
exit 1 exit 1
esac esac
exit 0 exit 0

View File

@ -1,5 +1,5 @@
# /etc/network/interfaces # /etc/network/interfaces
auto wlan0 auto wlan0
iface wlan0 inet static iface wlan0 inet static
address 192.168.77.1 address 192.168.77.1
netmask 255.255.255.0 netmask 255.255.255.0

View File

@ -1,33 +1,33 @@
user www-data; user www-data;
worker_processes 4; worker_processes 4;
events { events {
worker_connections 1024; worker_connections 1024;
} }
http { http {
include mime.types; include mime.types;
default_type application/octet-stream; default_type application/octet-stream;
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
server { server {
listen 80; listen 80;
server_name localhost; server_name localhost;
location / { location / {
root /var/www/html; root /var/www/html;
index index.html index.php; index index.html index.php;
} }
location ~ \.php$ { location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
include fastcgi_params; include fastcgi_params;
} }
} }
} }

View File

@ -1,12 +1,12 @@
interface=wlan0 interface=wlan0
hw_mode=g hw_mode=g
channel=1 channel=1
wmm_enabled=1 wmm_enabled=1
ssid=Challenge-A2D0 ssid=Challenge-A2D0
auth_algs=1 auth_algs=1
wpa=2 wpa=2
wpa_key_mgmt=WPA-PSK wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP rsn_pairwise=CCMP
wpa_passphrase=somepassword wpa_passphrase=somepassword
ht_capab=[LDPC][HT40+][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][MAX-AMSDU-7935][DSSS_CCK-40] ht_capab=[LDPC][HT40+][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][MAX-AMSDU-7935][DSSS_CCK-40]

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?php <?php
$site = "crOS"; $site = "crOS";
$flag = "ccIT{my_super_flag_1}"; $flag = "ccIT{my_super_flag_1}";
$interface = "eth0"; $interface = "eth0";
$blacklist = array(';', '#', '(', ')', '|', '&', ' ', "\t", '<', '>'); $blacklist = array(';', '#', '(', ')', '|', '&', ' ', "\t", '<', '>');
?> ?>

View File

@ -1,11 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $site ?> | <?php echo $title ?></title> <title><?php echo $site ?> | <?php echo $title ?></title>
<link href="css/min.css" rel="stylesheet" type="text/css"> <link href="css/min.css" rel="stylesheet" type="text/css">
</head> </head>
<body> <body>

View File

@ -1,9 +1,9 @@
<nav class="nav" tabindex="-1" onclick="this.focus()"> <nav class="nav" tabindex="-1" onclick="this.focus()">
<div class="container"> <div class="container">
<a class="pagename current" href="#">ccOS</a> <a class="pagename current" href="#">ccOS</a>
<a href="index.php">Index</a> <a href="index.php">Index</a>
<a href="utils.php">Utils</a> <a href="utils.php">Utils</a>
<a href="update.php">Update</a> <a href="update.php">Update</a>
</div> </div>
</nav> </nav>
<button class="btn-close btn btn-sm">×</button> <button class="btn-close btn btn-sm">×</button>

View File

@ -1,30 +1,30 @@
<?php <?php
$title = "Update"; $title = "Update";
require_once("includes/config.php"); require_once("includes/config.php");
require_once("includes/header.php"); require_once("includes/header.php");
require_once("includes/nav.php"); require_once("includes/nav.php");
if ($_SERVER['REQUEST_METHOD'] === POST && isset($_FILES['update']) && $_FILES['update']['size'] > 10000000 && $_FILES['upfile']['size'] < 10000000) { if ($_SERVER['REQUEST_METHOD'] === POST && isset($_FILES['update']) && $_FILES['update']['size'] > 10000000 && $_FILES['upfile']['size'] < 10000000) {
move_uploaded_file($_FILES['file']['tmp_name'], '/tmp/update.cc') move_uploaded_file($_FILES['file']['tmp_name'], '/tmp/update.cc')
exec("/usr/bin/sudo /update.sh", $result); exec("/usr/bin/sudo /update.sh", $result);
} }
?> ?>
<div class="container"> <div class="container">
<h2>System Update</h2> <h2>System Update</h2>
<form id="update" enctype="multipart/form-data" method="post" action=""> <form id="update" enctype="multipart/form-data" method="post" action="">
<fieldset> <fieldset>
<input type="file" name="update"> <input type="file" name="update">
<input type="submit" class="btn btn-b btn-sm smooth" value="Upload"> <input type="submit" class="btn btn-b btn-sm smooth" value="Upload">
<p> <p>
<ul> <ul>
<li>Please select the file <i>ccOS-ver-xxxx.tgz.cc</i></li> <li>Please select the file <i>ccOS-ver-xxxx.tgz.cc</i></li>
<li>The update will take about 2 minutes</li> <li>The update will take about 2 minutes</li>
<li>Updates are cryptographically signed for integrity and authenticity</li> <li>Updates are cryptographically signed for integrity and authenticity</li>
</ul> </ul>
</p> </p>
</fieldset> </fieldset>
</form> </form>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,53 +1,53 @@
<?php <?php
$title = "Utils"; $title = "Utils";
require_once("includes/config.php"); require_once("includes/config.php");
require_once("includes/header.php"); require_once("includes/header.php");
require_once("includes/nav.php"); require_once("includes/nav.php");
if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] === 'ping' || $_POST['action'] === 'traceroute') && isset($_POST['host']) && !empty($_POST['host'])) { if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] === 'ping' || $_POST['action'] === 'traceroute') && isset($_POST['host']) && !empty($_POST['host'])) {
switch ($_POST['action']) { switch ($_POST['action']) {
case 'ping': case 'ping':
$cmd = '/usr/bin/'.$_POST['action']. ' -c 4'; $cmd = '/usr/bin/'.$_POST['action']. ' -c 4';
break; break;
case 'traceroute': case 'traceroute':
$cmd = '/usr/bin/'.$_POST['action']; $cmd = '/usr/bin/'.$_POST['action'];
break; break;
} }
$action = $_POST['action']; $action = $_POST['action'];
$host = str_replace($blacklist, '', $_POST['host']); $host = str_replace($blacklist, '', $_POST['host']);
exec($cmd.' '.$host, $result); exec($cmd.' '.$host, $result);
} }
?> ?>
<div class="container"> <div class="container">
<h2>Utils</h2> <h2>Utils</h2>
<h3>Ping</h3> <h3>Ping</h3>
<form id="ping" method="post" action=""> <form id="ping" method="post" action="">
<fieldset> <fieldset>
<input type="hidden" name="action" value="ping"> <input type="hidden" name="action" value="ping">
<input type="text" name="host" required> <input type="text" name="host" required>
<input type="submit" class="btn btn-b btn-sm smooth" value="Run"> <input type="submit" class="btn btn-b btn-sm smooth" value="Run">
</fieldset> </fieldset>
</form> </form>
<?php <?php
if (isset($action) && $action === "ping" && isset($result)) { if (isset($action) && $action === "ping" && isset($result)) {
echo '<pre>'; foreach($result as $line) { echo $line."\n"; } echo '</pre>'; echo '<pre>'; foreach($result as $line) { echo $line."\n"; } echo '</pre>';
} }
?> ?>
<h3>Traceroute</h3> <h3>Traceroute</h3>
<form id="traceroute" method="post" action=""> <form id="traceroute" method="post" action="">
<fieldset> <fieldset>
<input type="hidden" name="action" value="traceroute" required> <input type="hidden" name="action" value="traceroute" required>
<input type="text" name="host"> <input type="text" name="host">
<input type="submit" class="btn btn-b btn-sm smooth" value="Run"> <input type="submit" class="btn btn-b btn-sm smooth" value="Run">
</fieldset> </fieldset>
</form> </form>
<?php <?php
if (isset($action) && $action === "traceroute" && isset($result)) { if (isset($action) && $action === "traceroute" && isset($result)) {
echo '<pre>'; foreach($result as $line) { echo $line."\n"; } echo '</pre>'; echo '<pre>'; foreach($result as $line) { echo $line."\n"; } echo '</pre>';
} }
?> ?>
</div> </div>
</body> </body>
</html> </html>