User Tools

Site Tools


wipeliveserver

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wipeliveserver [2019/03/13 16:53] – created Nicowipeliveserver [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-<note important>WIP</note>Wipe a living server. Tested on Debian 7.x 
  
-<pre> 
-mkdir /tmp/tmproot 
-mount -t tmpfs none /tmp/tmproot 
-mkdir /tmp/tmproot/{bin,sbin,proc,sys,dev,run,usr,var,tmp,etc,root,oldroot} 
-mkdir -p /tmp/tmproot/usr/bin 
-mkdir -p /tmp/tmproot/dev/pts 
-mkdir -p /tmp/tmproot/lib/x86_64-linux-gnu /tmp/tmproot/lib64 /tmp/tmproot/usr/share /tmp/tmproot/usr/lib/x86_64-linux-gnu /tmp/tmproot/var/run/screen 
- 
-#tmux 
-cp -vrp /usr/share/terminfo /tmp/tmproot/usr/share/ 
-cp -vrp /usr/lib/x86_64-linux-gnu/libevent* /tmp/tmproot/usr/lib/x86_64-linux-gnu/ 
-cp -vrp /lib/x86_64-linux-gnu/* /tmp/tmproot/lib/x86_64-linux-gnu/ 
-cp -vrp /lib64/ld-linux-x86-64.so.2 /tmp/tmproot/lib64/ 
-cp -vrp /sbin/* /tmp/tmproot/sbin/ 
-cp -vrp /bin/* /tmp/tmproot/bin/ 
-cp -vrp /usr/bin/shred /usr/bin/ldd /usr/bin/screen /usr/bin/tmux /tmp/tmproot/usr/bin/ 
- 
-#cp -a /dev/zero /dev/random /dev/sda /tmp/tmproot/dev/ 
-cp -a /dev/* /tmp/tmproot/dev/ 
- 
-mount -t proc proc /tmp/tmproot/proc 
-mount --bind /dev/pts /tmp/tmproot/dev/pts 
-chmod g+w /tmp/tmproot/run  
-chmod a+x /tmp/tmproot/tmp 
- 
-apt-get install -y dropbear 
-cp /usr/sbin/dropbear /tmp/tmproot/sbin/ 
-#cp -vrp /etc/dropbear /tmp/tmproot/etc/ 
-#cp -vrp /etc/passwd* /etc/shadow* /etc/group* /etc/shells /tmp/tmproot/etc/ 
-cp -vrp /etc/* /tmp/tmproot/etc/ 
-echo "" > /root/.bash_history 
-echo "TERM=xterm-16color" >>.profile 
-mount --make-rprivate / # necessary for pivot_root to work 
-pivot_root /tmp/tmproot /tmp/tmproot/oldroot 
-/sbin/dropbear -p 666 
- 
-ssh -p 666 root@host 
- 
-tmux -s shred 
-#shred -z -v /dev/sda 
- 
-ssh -p 666 root@host 
-#tmux a -t shred 
-#echo "o" > /proc/sysrq-trigger 
-</pre> 

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki