Hi Everyone,

I am reading an intro to shell-coding, and the following program is used as a simple example of vulnerable code:

  /* vuln.c */

  int
  main(int argc, char **argv, char **envp)
  {
    char buf[256];
    strcpy(buf, argv[1]);

    return 0;
  }

When I run this code like this:

  18 > vuln
  Segmentation fault (core dumped)

it segfaults, like the tutorial says. In the tutorial this line:

  19 > vuln `perl -e 'print "A"x256 . "BBBB" . "CCCC"'`

also segfaults, but not on my machine. Is this some FreeBSD security feature?

  20 > uname -a
  FreeBSD localhost 5.3-BETA2
  FreeBSD 5.3-BETA2 #0: Mon Sep  6 15:27:56 CDT 2004
  [EMAIL PROTECTED]:/usr/obj/usr/src/sys/CUSTOM  i386

If this doesn't cause a segfault, does it still overflow?

_jason
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to