#!/usr/bin/perl
# DataPAC Minicom BruteForce Scanning Script - semen@0x90.org || Sun Jul 4 23:36:11 EDT 2004
# This script is provided for educational usage only. It will run on anything with perl. 
# It is only useful in conjunction with `seyon` (2 rev. 20c) for Linux. 
# Having say that. Go scan a range of NUA's that haven't been already and submit them to 
# theclone (theclone@hackcanada.com)
# Running me, perl gen-nua.pl RANGE > NUASCRIPT- RANGE is limited to 3 digit prefix from an 8 digit NUA
# (+5 sequential just gets ridiculously large) and NUASCRIPT is to feed into minocom
# Replace the phonenumber with your local DATAPAC line and the DATAPAC NUA spitback listed below
$yourNUA = $ARGV[0];
my $nua;
print "verbose on\n";
print "expect {\n\"CONNECT 38400\"\n}\n";
print "\nsend \".\"\n";
print "sleep 1\n";
print "expect {\n\"DATAPAC: 4200 0019\"\n}\n";
print "sleep 1\n";
for ($i=0;$i<10;$i++){
$nua = $yourNUA . "0000" . $i;
print "send \"$nua\"\n";
print "print $nua\n";
print "expect {\n\"DATAPAC: call cleared\"\n}\n";
print "sleep 1\n";
}
for ($i=10;$i<100;$i++){
$nua = $yourNUA . "000" . $i;
print "send \"$nua\"\n";
print "print $nua\n";
print "expect {\n\"DATAPAC: call cleared\"\n}\n";
print "sleep 1\n";
}
for ($i=100;$i<1000;$i++){
$nua = $yourNUA . "00" . $i;
print "send \"$nua\"\n";
print "print $nua\n";
print "expect {\n\"DATAPAC: call cleared\"\n}\n";
print "sleep 1\n";
}
for ($i=1000;$i<10000;$i++){
$nua = $yourNUA . "0" . $i;
print "send \"$nua\"\n";
print "print $nua\n";
print "expect {\n\"DATAPAC: call cleared\"\n}\n";
print "sleep 1\n";
}
for ($i=10000;$i<100000;$i++){
$nua = $yourNUA . $i;
print "send \"$nua\"\n";
print "print $nua\n";
print "expect {\n\"DATAPAC: call cleared\"\n}\n";
print "sleep 1\n";
}

