linuxhanz
01.09.03, 16:07
Für Admins die keine festen Homeverzeichnisse vergeben wollen,
dachte ich das eine gute Sache wäre die PID des Logins
in tmp als Homeverzeichnis abzulegen:
Was haltet ihr davon? ist noch nicht so gut durchdacht, bin für
VerbesserungsVorschläge /bereits existente Softwarelösungen offen.
#!/bin/sh
DATE=`date --date=yesterday +%Y.%m.%d`
#TIMEOUT=`24h`
echo "pid->home"
echo "created temp.login"
# print user
USER=`ps aux |grep [l]ogin |grep -v \ "-- root" |awk '{ print $13 }'`
# print pid
PID=`ps aux |grep [l]ogin |grep -v \ "-- root" |awk '{ print $2 }'`
#PID=`pidof login` ;
#PID =`pidof $USER` ;
mkdir -p /tmp/$PID;
echo "at $DATE user $USER
was allowed to login"
echo "using PID $PID for home: /tmp/"
#echo "hint: will be deleted after Timeout $TIMEOUT"
/bin/bash
exit 0
#sleep $TIMEOUT; rm -rfv /tmp/$PID;
#echo "temp. login deleted greetz your local B.O.A.F."
naja dann noch das Skript in /etc/shells eintragen und dem User in die Passwd.
+ setuid bitsetzen.
Und nochwas:
Wer die FreeBSD Mailingliste mitliest, da ist eine coole Toolsammlung für die Zeit
nach dem Einbruch.
tct tool --intrusion links
http://www.fish.com/tct/help-when-broken-into
http://www.porcupine.org/forensics/tct.html
Auch ne Idee: Für Leute auf deren Rechner keine Software installiert wird,
die aber auch keinen Bock auf LIDS udgl. haben.
find / -type f | xargs md5(sum) > md5sums.txt -> auf cdbrennen _> drinnen lassen
cron job einrichten der immer um 24 Uhr CD-md5s mit System-md5s vergleicht.
Da md5 nicht mehr so sicher ist, kann das nur eine vorläufige Lösung sein.
Hier mit geänderter md5Summe.
linux:~ # mount |grep floppy || echo "mount first" && sleep 1 && mount /floppy; cd /floppy ; zdiff md5files.gz /root/md5files.gz;
mount first
56c56
< 77a108a4ba550bd2018f4565249e4190 /bin/ping6
---
> 77a108a4ba523bd2018f23ccc24e4190 /bin/ping6
..
Man kann den Befehl dann in die Crontab schreiben, die wird nat. jeder lesen:
14 0 * * * mount |grep floppy || echo "mount first" && sleep 2 && mount /floppy; cd /floppy ; zdiff md5files.gz /root/md5files.gz; exit 0
dachte ich das eine gute Sache wäre die PID des Logins
in tmp als Homeverzeichnis abzulegen:
Was haltet ihr davon? ist noch nicht so gut durchdacht, bin für
VerbesserungsVorschläge /bereits existente Softwarelösungen offen.
#!/bin/sh
DATE=`date --date=yesterday +%Y.%m.%d`
#TIMEOUT=`24h`
echo "pid->home"
echo "created temp.login"
# print user
USER=`ps aux |grep [l]ogin |grep -v \ "-- root" |awk '{ print $13 }'`
# print pid
PID=`ps aux |grep [l]ogin |grep -v \ "-- root" |awk '{ print $2 }'`
#PID=`pidof login` ;
#PID =`pidof $USER` ;
mkdir -p /tmp/$PID;
echo "at $DATE user $USER
was allowed to login"
echo "using PID $PID for home: /tmp/"
#echo "hint: will be deleted after Timeout $TIMEOUT"
/bin/bash
exit 0
#sleep $TIMEOUT; rm -rfv /tmp/$PID;
#echo "temp. login deleted greetz your local B.O.A.F."
naja dann noch das Skript in /etc/shells eintragen und dem User in die Passwd.
+ setuid bitsetzen.
Und nochwas:
Wer die FreeBSD Mailingliste mitliest, da ist eine coole Toolsammlung für die Zeit
nach dem Einbruch.
tct tool --intrusion links
http://www.fish.com/tct/help-when-broken-into
http://www.porcupine.org/forensics/tct.html
Auch ne Idee: Für Leute auf deren Rechner keine Software installiert wird,
die aber auch keinen Bock auf LIDS udgl. haben.
find / -type f | xargs md5(sum) > md5sums.txt -> auf cdbrennen _> drinnen lassen
cron job einrichten der immer um 24 Uhr CD-md5s mit System-md5s vergleicht.
Da md5 nicht mehr so sicher ist, kann das nur eine vorläufige Lösung sein.
Hier mit geänderter md5Summe.
linux:~ # mount |grep floppy || echo "mount first" && sleep 1 && mount /floppy; cd /floppy ; zdiff md5files.gz /root/md5files.gz;
mount first
56c56
< 77a108a4ba550bd2018f4565249e4190 /bin/ping6
---
> 77a108a4ba523bd2018f23ccc24e4190 /bin/ping6
..
Man kann den Befehl dann in die Crontab schreiben, die wird nat. jeder lesen:
14 0 * * * mount |grep floppy || echo "mount first" && sleep 2 && mount /floppy; cd /floppy ; zdiff md5files.gz /root/md5files.gz; exit 0