Skip to content

Commit

Permalink
Import Version 100
Browse files Browse the repository at this point in the history
  • Loading branch information
psct committed Dec 30, 2019
0 parents commit eb4b1b8
Show file tree
Hide file tree
Showing 72 changed files with 8,219 additions and 0 deletions.
2 changes: 2 additions & 0 deletions debconf/iptables-persistent
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
iptables-persistent iptables-persistent/autosave_v6 boolean false
iptables-persistent iptables-persistent/autosave_v4 boolean false
18 changes: 18 additions & 0 deletions debconf/keyboard-configuration
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
keyboard-configuration keyboard-configuration/model select Generic 105-key PC (intl.)
keyboard-configuration keyboard-configuration/compose select No compose key
keyboard-configuration keyboard-configuration/toggle select No toggling
keyboard-configuration keyboard-configuration/store_defaults_in_debconf_db boolean true
keyboard-configuration keyboard-configuration/unsupported_config_options boolean true
keyboard-configuration keyboard-configuration/xkb-keymap select gb
keyboard-configuration keyboard-configuration/optionscode string
keyboard-configuration keyboard-configuration/switch select No temporary switch
keyboard-configuration keyboard-configuration/layout select German
keyboard-configuration keyboard-configuration/altgr select The default for the keyboard layout
keyboard-configuration keyboard-configuration/modelcode string pc105
keyboard-configuration keyboard-configuration/unsupported_options boolean true
keyboard-configuration keyboard-configuration/unsupported_layout boolean true
keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean false
keyboard-configuration keyboard-configuration/unsupported_config_layout boolean true
keyboard-configuration keyboard-configuration/variant select German
keyboard-configuration keyboard-configuration/layoutcode string de
keyboard-configuration keyboard-configuration/variantcode string
14 changes: 14 additions & 0 deletions debconf/tzdata
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
tzdata tzdata/Zones/Europe select Berlin
tzdata tzdata/Zones/Indian select
tzdata tzdata/Zones/Pacific select
tzdata tzdata/Zones/Atlantic select
tzdata tzdata/Zones/Africa select
tzdata tzdata/Zones/Asia select
tzdata tzdata/Zones/Etc select UTC
tzdata tzdata/Zones/SystemV select
tzdata tzdata/Zones/Arctic select
tzdata tzdata/Zones/US select
tzdata tzdata/Zones/Australia select
tzdata tzdata/Areas select Europe
tzdata tzdata/Zones/America select
tzdata tzdata/Zones/Antarctica select
1 change: 1 addition & 0 deletions debconf/wireshark
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wireshark-common wireshark-common/install-setuid boolean true
Binary file added debs/apt-ntop_1.0.190416-469_all.deb
Binary file not shown.
Binary file added debs/libgtk-3-0_3.24.5-1_armhf.deb
Binary file not shown.
Binary file added debs/libgtk-3-bin_3.24.5-1_armhf.deb
Binary file not shown.
Binary file added debs/libgtk-3-common_3.24.5-1_all.deb
Binary file not shown.
Binary file added debs/raspion-keyring_2019_all.deb
Binary file not shown.
Binary file added debs/wireshark-gtk_2.6.8-1.1_armhf.deb
Binary file not shown.
8 changes: 8 additions & 0 deletions files/10-dir-listing.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dir-listing.encoding = "utf-8"
$HTTP["url"] =~ "^/~pi/caps($|/)" {
dir-listing.activate = "enable"
}
$HTTP["url"] =~ "^/~pi/scans($|/)" {
dir-listing.activate = "enable"
}

15 changes: 15 additions & 0 deletions files/20-extport.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$SERVER["socket"] == ":81" {
server.document-root = "/home/pi/public_html"
dir-listing.encoding = "utf-8"
$HTTP["url"] =~ "^/caps($|/)" {
dir-listing.activate = "enable"
}
$HTTP["url"] =~ "^/scans($|/)" {
dir-listing.activate = "enable"
}
$HTTP["url"] =~ "^/admin" {
proxy.server = ( "" => (( "host" => "192.168.24.1", "port" => "80")) )
}
}


7 changes: 7 additions & 0 deletions files/bootstrap.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions files/bootstrap.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions files/broadwayd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=broadwayd
After=network.target

[Service]
Type=simple
User=pi
ExecStart=/usr/bin/broadwayd --port 10000
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Binary file added files/caps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions files/commands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
$json = file_get_contents('php://input');
$data = json_decode($json);

switch ($data[0]) {
case 'mitmstart':
executeCommand('sudo mitmon.sh');
break;

case 'mitmstop':
executeCommand('sudo mitmoff.sh');
break;

case 'contcapstart':
$filename = preg_replace('/[^\w-]/', '_', $data[1]);
if ($filename == "") {
$filename = date('d_m_Y-h_i_s', time());
}
$time = filter_var($data[2], FILTER_SANITIZE_NUMBER_INT);
if ((int) $time !== $time) {
$time = 600;
};
executeCommand("sudo contcap.sh " . $filename . " " . $time);
break;

case 'contcapstop':
executeCommand("sudo killall dumpcap");
break;

case 'systemdstart':
$service = sanitizeSystemdService($data[1]);
executeCommand("sudo systemctl start " . $service);
break;

case 'systemdstop':
$service = sanitizeSystemdService($data[1]);
executeCommand("sudo systemctl stop " . $service);
break;

case 'systemdrestart':
$service = sanitizeSystemdService($data[1]);
executeCommand("sudo systemctl restart " . $service);
break;

case 'poweroff':
executeCommand("sudo systemctl poweroff");
break;

default:
http_response_code(404);
echo "Unbekannter Befehl.";
break;
}
95 changes: 95 additions & 0 deletions files/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php

//Array of linked services
$services = array(
array(
'id' => 'pihole',
'url' => '/admin',
'title' => 'Pi-hole',
'description' => 'DNS-Anfragen zeigen<br>Einstellungen ändern'
),

array(
'id' => 'ntopng',
'url' => ':3000',
'title' => 'ntopng',
'description' => 'Live-Netzwerkverkehr anzeigen'
),

array(
'id' => 'wireshark',
'url' => ':10000',
'title' => 'Wireshark',
'description' => 'Mitschnitt und Analyse'
),

array(
'id' => 'mitm',
'url' => ':9090',
'title' => 'mitmproxy',
'description' => 'HTTP(S)-Verkehr einsehen<br><a href=#tools>ein/ausschalten</a>'
),

array(
'id' => 'caps',
'url' => '/caps',
'title' => 'pcap-Dateien',
'description' => 'Gespeicherte Mitschnitte'
),

array(
'id' => 'console',
'url' => ':4200',
'title' => 'Konsole',
'description' => 'Kommandozeile öffnen'
),

);

$interfaces = array(array('eth0', 'Uplink zum Internet'), array('br0', 'Testnetzwerk'));

//array of controllable systemd services
$systemd_services = array('hostapd', 'wireshark', 'broadwayd', 'mitmweb', 'shellinabox');

//array of integrated tools
$tools = array(
array(
'id' => 'mitmon',
'title' => 'mitm-Proxy aktivieren',
'description' => 'Firewall-Regeln für Umleitung von Webzugriffen (Port 80 und 443) auf mitmproxy',
'parameters' => array(),
'buttons' => array(
//id, class, title
array('mitmstart', 'btn-success mr-3', 'Aktivieren'),
array('mitmstop', 'btn-danger', 'Deaktivieren'),
),
),

array(
'id' => 'contcap',
'title' => 'Schnüffeln im Hintergrund',
'description' => 'Paketmitschnitt anstoßen',
'parameters' => array(
//title, text, default value
array('Dateiname', 'text', date('d_m_Y-h_i_s', time())),
array('Laufzeit', 'number', 600)
),
'buttons' => array(
array('contcapstart', 'btn-success mr-3', 'Starten'),
array('contcapstop', 'btn-danger', 'Abbrechen'),
),
),
array(
'id' => 'systemd',
'title' => 'Dienste beeinflussen',
'description' => 'Vorübergehend beenden oder neu starten',
'parameters' => array(
array('Dienst', 'select', $systemd_services)
),
'buttons' => array(
array('systemdstart', 'btn-success mr-3', 'Start'),
array('systemdstop', 'btn-danger mr-3', 'Stop'),
array('systemdrestart', 'btn-warning', 'Neustart'),
),
),
);
5 changes: 5 additions & 0 deletions files/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
block_global: False
console_focus_follow: True
ssl_insecure: True
stream_websockets: True

Binary file added files/console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/favicon.ico
Binary file not shown.
77 changes: 77 additions & 0 deletions files/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
// parse output of ip commands for given network device to get ip-addresses
function getIPAddresses($device)
{
exec('ip -o -4 a | awk \'$2 == "' . $device . '" { gsub(/\/.*/, "", $4); print $4 }\'', $ipv4_addr);
exec('ip -o -6 a | awk \'$2 == "' . $device . '" { gsub(/\/.*/, "", $4); print $4 }\'', $ipv6_addr);

$ipv4_addr = '<th class="thead-light">IPv4:</th><td>' . implode('</td><td>', $ipv4_addr) . '</td>';
$ipv6_addr = '<th class="thead-light">IPv6:</th><td>' . implode('</td><td>', $ipv6_addr) . '</td>';
return '<table class="table table-bordered"><tbody><tr>' . $ipv4_addr . '</tr><tr>' . $ipv6_addr . '</tr></tbody></table>';
}

// echo divs that cause breaks in the card groups for certain screen widths
function responsiveCardBreaks($i, $w = 'small')
{
if ($w == 'small') {
echo '<div class="w-100 d-block d-sm-none d-md-none d-lg-none"></div>';
if (($i + 1) % 2 == 0) {
echo '<div class="w-100 d-none d-sm-block d-md-none d-lg-none"></div>';
}
if (($i + 1) % 3 == 0) {
echo '<div class="w-100 d-none d-sm-none d-md-block d-lg-none"></div>';
}
if (($i + 1) % 4 == 0) {
echo '<div class="w-100 d-block d-sm-none d-md-none d-lg-block d-xl-block"></div>';
}
};
if ($w == 'wide') {
echo '<div class="w-100 d-block d-sm-block d-md-block d-lg-none"></div>';
if (($i + 1) % 2 == 0) {
echo '<div class="w-100 d-none d-sm-none d-md-none d-lg-block"></div>';
}
};
if ($w == 'full') {
echo '<div class="w-100 d-block"></div>';
};
}

//create a select form from given data
function buildSelect($title, $id, $options)
{
$html_select = '<div class="form-group">
<label>%s</label>
<select class="form-control parameter" id="%s">
%s
</select>
</div>';
$options_html = "";
for ($i = 0; $i < count($options); ++$i) {
$options_html .= '<option value="' . $options[$i] . '">
' . $options[$i] . '
</option>';
};

return sprintf($html_select, $title, $id, $options_html);
};

function sanitizeSystemdService($string)
{
global $systemd_services;
$sservice = preg_replace('/[^a-z_\-0-9]/i', '', $string);
if (in_array($sservice, $systemd_services)) {
return $sservice;
}
}

function executeCommand($command)
{
exec($command, $output, $return);
if ($return != 0) {
http_response_code(500);
echo "Fehler beim Ausführen von: " . $command;
} else {
http_response_code(200);
};
echo (implode("<br/>", $output));
}
10 changes: 10 additions & 0 deletions files/hostapd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
interface=wlan0
bridge=br0
ssid=raspion
country_code=DE
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
channel=5

1 change: 1 addition & 0 deletions files/hostname
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
raspion
6 changes: 6 additions & 0 deletions files/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.1 raspion
31 changes: 31 additions & 0 deletions files/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
a.btn {
cursor: pointer;
}
.card-deck.card-full-width .card {
max-width: calc(100% - 30px);
}

#footerlink {
font-size:9px;
}

@media (min-width: 576px) {
.card-deck.card-small-width) .card {
max-width: calc(50% - 30px);
}
}

@media (min-width: 768px) {
.card-deck.card-small-width .card {
max-width: calc(33.333% - 30px);
}
}

@media (min-width: 992px) {
.card-deck.card-small-width .card {
max-width: calc(25% - 30px);
}
.card-deck.card-double-width .card {
max-width: calc(50% - 30px);
}
}
Loading

0 comments on commit eb4b1b8

Please sign in to comment.