diff options
author | Momo <momorientes@online.de> | 2011-09-09 15:08:50 +0200 |
---|---|---|
committer | Momo <momorientes@online.de> | 2011-09-09 15:08:50 +0200 |
commit | fbff0557f91eaf99666845b0128f64436af08ac9 (patch) | |
tree | 6da542aab9fdea853eda2461610be05754fd9290 /infest | |
parent | 9d2f77f0ac2b68f280bed7080e40b7e0c122bc89 (diff) | |
parent | 98da300063721871ea36e43a3b34d59311643302 (diff) |
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'infest')
-rw-r--r-- | infest/Makefile | 20 | ||||
-rwxr-xr-x | infest/bin/make-patch | 59 |
2 files changed, 2 insertions, 77 deletions
diff --git a/infest/Makefile b/infest/Makefile index ec5836a3..b96e1d7c 100644 --- a/infest/Makefile +++ b/infest/Makefile @@ -1,18 +1,2 @@ - -ifndef patch_file -patch_file := /etc/Verkrebsung.patch -endif - -ifndef patch_flags -patch_flags := -endif - -.PHONY: infest dry-run -infest: $(patch_file) - unset POSIXLY_CORRECT; patch $(patch_flags) -fNp0 < $< - -$(patch_file): bin/make-patch - $< >$@ - -dry-run: - make patch_file=/tmp/krebs-infest-dry-run.patch patch_flags=--dry-run +%: + @echo '[31;1;5mwhatever you try: you are made of stupid![m' >&2 diff --git a/infest/bin/make-patch b/infest/bin/make-patch deleted file mode 100755 index 1051c1aa..00000000 --- a/infest/bin/make-patch +++ /dev/null @@ -1,59 +0,0 @@ -#! /bin/sh - -t="`mktemp`" -p="`mktemp`" -trap "test -e $t && rm $t; test -e $p && rm $p" EXIT INT - -f=/etc/passwd -cat $f >$t -#sed -ri 's^(root:[^:]+):0:0:(.*)$\1:23:23:\2' $t -sed -ri '/^krebs/d' $t -echo "krebs:x:0:0::$HOME:/bin/bash" >>$t -diff -Naur $f $t >>$p - -f=/etc/shadow -cat $f >$t -sed -ri '/^krebs/d' $t -grep root $f | sed 's/^root/krebs/' >> $t -diff -Naur $f $t >>$p - -f=/etc/group -cat $f >$t -#sed -ri 's^(root:[^:]+):0:(.*)$\1:23:\2' $t -sed -ri '/^krebs/d' $t -echo 'krebs:x:0:' >>$t -diff -Naur $f $t >>$p - -f=/etc/fstab -cat $f >$t -if ! grep -q 'none[ \t]*/tmp' $t; then - echo 'none /tmp tmpfs defaults,size=50M 0 0' >>$t -fi -if ! grep -q 'none[ \t]*/var/log' $t; then - echo 'none /var/log tmpfs defaults,size=50M 0 0' >>$t -fi -diff -Naur $f $t >>$p - -readlink=`readlink -f $0` -dirname=`dirname $readlink` -echo [32m$dirname/../skel[m >&2 -ls -l $dirname/../skel -if cd $dirname/../skel; then - if cd etc; then - find . -mindepth 1 -maxdepth 1 -exec diff -Naur /etc/\{\} \{\} \; >>$p - cd .. - sed -i ' - s:^+++ \./:+++ /etc/: - ' $p - fi - if cd home; then - find . -type f -exec diff -Naur $HOME/\{\} \{\} \; >>$p - cd .. - sed -i ' - s:^+++ \./:+++ '$HOME'/: - ' $p - fi - cd .. -fi - -cat $p |