progs/C3.c
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 10 Dec 2013 07:49:48 +0000
changeset 153 af8fff37dd1c
parent 105 40c51038c9e4
child 230 603cbd28e988
permissions -rw-r--r--
added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
#include<stdio.h>
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
#include<string.h>
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
// simple program used for a bufferflow attack
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
//
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
// for installation notes see C0.c
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
//
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
// can be called with 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
//
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
//   ./C3 `./args3`
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
main(int argc, char **argv)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
        char buffer[80];
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
        strcpy(buffer, argv[1]);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
        return 1;
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
}