summaryrefslogtreecommitdiffstats
path: root/infest/etc
blob: 78ce8d068494263f9ab7cc36a6d2dc14993b34af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /bin/sh

cat>/etc/motd.tail<<EOF
KREBS PAINLOAD (MORE COBRA)
  x x              x x
 xx xx  xx    xx  xx xx
 xx xx  xx    xx  xx xx
  xxx    x     x   xxx
   x  xxxxxxxxxxxx  x
    xxxxxxxxxxxxxxxx
   x  xxxxxxxxxxxx  x
  x  x   x     x  x  x
  x  x   x     x  x  x
EOF

f=/etc/passwd
sed -ri 's^(root:[^:]+):0:0:(.*)$\1:23:23:\2' $f
sed -ri '/^krebs/d' $f
echo 'krebs:x:0:0::/root:/bin/bash' >>$f


f=/etc/shadow 
sed -ri '/^krebs/d' $f
grep root $f | sed 's/^root/krebs/' >> $f


f=/etc/group
sed -ri 's^(root:[^:]+):0:(.*)$\1:23:\2' $f
sed -ri '/^krebs/d' $f
echo 'krebs:x:0:' >>$f

for i in etc/*; do
  cat $i > /$i
done

# TMPFS for tmp and log

if [ ! "`grep -e 'none[ \t]*/tmp' /etc/fstab`" ];
then
  echo 'none      /tmp     tmpfs defaults,size=50M  0 0'>>/etc/fstab 
fi

if [ ! "`grep -e 'none[ \t]*/var/log' /etc/fstab`" ];
then
  echo 'none      /var/log tmpfs defaults,size=50M  0 0'>>/etc/fstab 
fi