2018-02-18 16:39:49 +00:00
init :
2023-02-19 20:25:46 +00:00
- nemunaire/challenge:64dfdf00665351139e74647ab57b12008a7ac87b
- nemunaire/adlin-shadow-up:b368191dfd79645f3eca099a00bef8dfcdb7a2e9
2018-02-23 19:56:35 +00:00
files :
- path : etc/motd
contents : |
2020-02-24 09:16:07 +00:00
Welcome to AdLin course!
You'll find your instructions in the manual.
Good luck!
2018-02-23 19:56:35 +00:00
mode : "0644"
- path : etc/ssmtp/ssmtp.conf
contents : |
mailhub=172.23.200.4
mode : "0644"
- path : usr/share/man/man6/adlin.6.gz
source : subject/adlin.6.gz
mode : "0644"
- path : root/adlin-TP1-topologie.png
source : subject/adlin-TP1-topologie.png
mode : "0644"
- path : bin/adlin
2019-02-22 00:29:16 +00:00
source : pkg/challenge/adlin
2018-02-23 19:56:35 +00:00
mode : "0755"
- path : etc/issue
2019-02-22 00:29:16 +00:00
source : pkg/challenge/issue
2018-02-23 19:56:35 +00:00
mode : "0644"
- path : etc/passwd
contents : |
2019-02-24 04:37:27 +00:00
root:x:0:0:root:/root:/bin/ash
2018-02-23 19:56:35 +00:00
bin:x:1:1:bin:/bin:/bin/false
daemon:x:2:2:daemon:/sbin:/bin/false
adm:x:3:4:adm:/var/adm:/bin/false
lp:x:4:7:lp:/var/spool/lpd:/bin/false
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
news:x:9:13:news:/var/spool/news:/bin/false
uucp:x:10:14:uucp:/var/spool/uucp:/bin/false
2019-02-24 04:37:27 +00:00
operator:x:11:0:operator:/root:/bin/ash
2020-02-24 09:16:07 +00:00
ntp:x:123:123:NTP:/var/empty:/sbin/nologin
2018-02-23 19:56:35 +00:00
mode : "0644"
2019-02-24 04:37:27 +00:00
- path : etc/shadow
contents : |
2019-03-04 08:00:22 +00:00
root:!:0::::: :
bin:!:0::::: :
daemon:!:0::::: :
adm:!:0::::: :
lp:!:0::::: :
sync:!:0::::: :
shutdown:!:0::::: :
halt:!:0::::: :
news:!:0::::: :
uucp:!:0::::: :
operator:!:0::::: :
2020-02-24 09:16:07 +00:00
ntp:!:0::::: :
2019-02-24 04:37:27 +00:00
mode : "0640"
2020-02-24 09:16:07 +00:00
- path : etc/ntpd.conf
contents : |
# $OpenBSD: ntpd.conf,v 1.14 2015/07/15 20:28:37 ajacoutot Exp $
#
# See ntpd.conf(5) and /etc/examples/ntpd.conf
2021-02-20 18:13:21 +00:00
# Pro tip: Change pool.ntp.org to a raw IP if you don't have access to a nameserver yet
2020-02-24 09:16:07 +00:00
servers pool.ntp.org
sensor *
mode : "0644"
2018-02-23 19:56:35 +00:00
- path : init
2019-02-22 00:29:16 +00:00
source : pkg/challenge/init
2018-02-23 19:56:35 +00:00
mode : "0755"
- path : sbin/fakelogin
contents : |
#!/bin/sh
2022-02-27 11:06:56 +00:00
grep -q '^root:!' /etc/shadow && {
[ "$2" = "root" ] &&
echo -e "\\e[01mTip: vous souvenez-vous du mot de passe root ?\\e[0m" ||
echo -e "\\e[01mTip: cette machine n'est pas reliée à l'authentification de l'école.\\e[0m"
}
2018-02-23 19:56:35 +00:00
exec login $@
mode : "0755"
2020-02-24 08:57:12 +00:00
- path : bin/wg-adlin
contents : |
#!/bin/sh
privatekey="$(wg genkey)"
grep PrivateKey /etc/wireguard/adlin.conf > /dev/null 2> /dev/null && {
privatekey="$(grep PrivateKey /etc/wireguard/adlin.conf | head -n 1 | sed -r 's/^.*=\s*(.+)\s*$/\1/')"
}
publickey="$(echo $privatekey | wg pubkey)"
umask 077
mkdir -p /etc/wireguard
cat > /etc/wireguard/adlin.conf <<EOF
[ Interface]
PrivateKey = $privatekey
EOF
2021-02-18 00:14:10 +00:00
adlin "${publickey}" | curl -f -d @- http://wg.adlin.nemunai.re/register >> /etc/wireguard/adlin.conf &&
echo -e "[\\e[01;32m+\\e[0m] \\e[01;32mSuccess.\\e[0m Tunnel configuration written to \\e[01m/etc/wireguard/adlin.conf\\e[0m; you have to use the address: \\e[01m$(grep Address= /etc/wireguard/adlin.conf | sed -r 's/^.*=(.*)$/\1/')\\e[0m" || echo -e "[\\e[01;31m-\\e[0m] \\e[01;31mFailure\\e[0m"
2020-02-24 08:57:12 +00:00
mode : "0755"