/*----------------------------------------------------------------------*/
/*	AmiExpress Security-Mechanism V4.75 - Coded By Galaxy		*/
/*----------------------------------------------------------------------*/
parse arg node
options results
nodeid = "AERexxControl"node
address value nodeid

/*----------------------------------------------------------------------*/
/*	Set Signals							*/
/*----------------------------------------------------------------------*/
signal on syntax
signal on error
signal on ioerr

/*----------------------------------------------------------------------*/
/*	Tool Definition							*/
/*----------------------------------------------------------------------*/
newu = "NEWUSER"				/*	UPPERCASE	*/
						/*----------------------*/

/*----------------------------------------------------------------------*/
/*	Passwords							*/
/*----------------------------------------------------------------------*/
/*	BEGONIE, PILLEN, POLLEN, KUCHEN, POSITRON, SONIC		*/
/*----------------------------------------------------------------------*/
pass = "YES"					/*	UPPERCASE	*/
nups = "JAPAN"					/*	UPPERCASE	*/
lwps = "POLYGON"				/*      UPPERCASE       */
						/*----------------------*/

/*----------------------------------------------------------------------*/
/*	Defaults							*/
/*----------------------------------------------------------------------*/
noth = "NOTHING!"
stra = "STRANGER!"

/*----------------------------------------------------------------------*/
/*	Change Here Your Nup, SysPw, Systemprmpt, Registrnum, Etc.	*/
/*----------------------------------------------------------------------*/
hand = "[4CEnter your Handle: "
sysp = "[4CSystemPassword: "
user = "[4CEnter LowBaudPassword: "
nupp = "[4CNewUserPassword: "
regi = "00003263921-GAL"
vers = "V4.75"
maxb = 7200
skib = 57600
section = "0"					/*----------------------*/
						/* 1 = lowbaudpw	*/
						/* 2 = syspw		*/
						/* 3 = lowbaud pw       */
						/* 4 = system  pw       */
						/* 5 = newuserpw	*/
						/*----------------------*/

/*----------------------------------------------------------------------*/
/*	Standart Commands						*/
/*----------------------------------------------------------------------*/
tr = transmit;gu = getuser;qu = query;pu = putuser;ps = putustr;sm = sendmessage

/*----------------------------------------------------------------------*/
/*	Result Codes							*/
/*----------------------------------------------------------------------*/
gu 100;usar = result;gu 122;line = result;gu 125;tout = result
gu 144;date = result;gu 505;baud = result;gu 525;ntxt = result

/*----------------------------------------------------------------------*/
/*	Date check							*/
/*----------------------------------------------------------------------*/
tim = word(date,4);day = word(date,3);mon = word(date,2);yea = word(date,5)

/*----------------------------------------------------------------------*/
/*	Integer								*/
/*----------------------------------------------------------------------*/
usar = 0;line = 1;tout = 1;ntxt = 1

/*----------------------------------------------------------------------*/
/*	Set Lines And Drop Time And Kill Cursor				*/
/*----------------------------------------------------------------------*/
ps "1000";pu 122;ps "120";pu 125;tr "[0 p"

/*----------------------------------------------------------------------*/
/*	Check If Normal Door Or New User Door				*/
/*----------------------------------------------------------------------*/
gu 131;answer = upper(result)
if answer = newu then call newuser

/*----------------------------------------------------------------------*/
/*	Normal Door							*/
/*----------------------------------------------------------------------*/
normal:

tr "[0;0H[J[34m          .-.------------------------------------------------------.-.[0m"
tr "          [34m|_|[36m      Copyright [37mGALAXY[36m Systems Inc. 1993-"yea"[2;68H[34m|_|[0m"
tr "           [34m|[36m   Welcome To [34mAmiExpress[37m([32mTM[37m)[36m Security-Mechanism "vers".[3;69H[34m|[0m"
tr "           [34m|[36m           Reg.-# [35mGAT-MPL0."regi"[36m.[4;69H[34m|[0m"
tr "           [34m`--------------------------------------------------------'[0m"
tr "                  Detected Connect Is: [37m"day"[0m-[37m"mon"[0m-[37m"yea"  "tim"[0m."
tr "    [35m__[0m                Connected On Node [37m"node"[0m At [37m"baud"[0m Baud."
tr "[34m.---[35m\/[34m------------------------------------------------------------------------.[0m"
tr "[34m|[0m[36m Th[35mi[36ms system [35mi[36ms for the use of author[35mi[36mzed users only. Ind[35mi[36mv[35mi[36mduals us[35mi[36mng th[35mi[36ms [34m|[0m"
tr "[34m|[0m[36m computer  system  w[35mi[36mthout  author[35mi[36mty, or  [35mi[36mn access of the[35mi[36mr author[35mi[36mty, are [34m|[0m"
tr "[34m|[0m[36m subject  to  hav[35mi[36mng  all of  the[35mi[36mr  act[35mi[36mv[35mi[36mt[35mi[36mes on th[35mi[36ms system mon[35mi[36mtored and [34m|[0m"
tr "[34m|[0m[36m recorded  by  system  personnel.  In  the  course of mon[35mi[36mtor[35mi[36mng [35mi[36mnd[35mi[36mv[35mi[36mduals [34m|[0m"
tr "[34m|[0m[36m [35mi[36mmproperly us[35mi[36mng  th[35mi[36ms  system, or [35mi[36mn the course of system ma[35mi[36mntenance, the [34m|[0m"
tr "[34m|[0m[36m act[35mi[36mv[35mi[36mt[35mi[36mes  of author[35mi[36mzed  users  may  also be mon[35mi[36mtored.  Anyone us[35mi[36mng the [34m|[0m"
tr "[34m|[0m[36m system  expressly  consents to  such  mon[35mi[36mtor[35mi[36mng  and  [35mi[36ms adv[35mi[36msed that such [34m|[0m"
tr "[34m|[0m[36m mon[35mi[36mtor[35mi[36mng reveals poss[35mi[36mble ev[35mi[36mdence of cr[35mi[36mm[35mi[36mnal act[35mi[36mv[35mi[36mty, system personnel [34m|[0m"
tr "[34m|[0m[36m may prov[35mi[36mde the ev[35mi[36mdence of such mon[35mi[36mtor[35mi[36mng to law enforcement off[35mi[36mc[35mi[36mals.   [34m|[0m"
tr "[34m`-----------------------------------------------------------------------------'[0m"
tr ""

if baud > skib then call skip
if baud > maxb then call letin

tr "[19;0H[34m.-----------------------------------------------------------------------------.[0m"
tr "[34m|[0m[36m You  connected  on  an  unusual baudrate to th[35mi[36ms system.  Maybe [35mi[36mt could be [34m|[0m"
tr "[34m|[0m[36m hardware   dependant  problems.  Anyhow  the  personal  allow  only  a  few [34m|[0m"
tr "[34m|[0m[36m author[35mi[36mzed users to connect at th[35mi[36ms baudrate.  [35m__[0m                           [34m|[0m"
tr "[34m`------------------------------------------------[35m\/[34m---------------------------'[0m"
tr ""

/*----------------------------------------------------------------------*/
/*	LowBaud Part							*/
/*----------------------------------------------------------------------*/
lowbaud:

call questionaire

qu user;answer = upper(result)
if answer = lwps then call correct
if answer = nups then call lamer
if answer = "" then answer = noth

tr "[2A"
call questionaire

qu hand;handle = upper(result)
if handle = "" then handle = stra

tr "[3;0H[J           [34m`--------------------------------------------------------'[0m"
tr "          [35m__[0m   Detected Disconnect Is: [37m"day"[0m-[37m"mon"[0m-[37m"yea"  "tim"[0m."
tr "[34m.---------[35m\/[34m------------------------------------------------------------------.[0m"
tr "[34m|[0m[36m Well '[32m"handle"[36m', you entered '[32m"answer"[36m'[0m[6;79H[34m|[0m"
tr "[34m|[0m[36m Th[35mi[36ms  [35mi[36ms not the requ[35mi[36mred LowBaudPassword, wh[35mi[36mch [35mi[36ms needed to get access on [34m|[0m"
tr "[34m|[0m[36m th[35mi[36ms  system.  The  system managment have no use of you w[35mi[36mth th[35mi[36ms baudrate. [34m|[0m"
tr "[34m|[0m[36m Please  keep  th[35mi[36ms system  [35mi[36mn  m[35mi[36mnd  and  call  back,  when  you  have  the [34m|[0m"
tr "[34m|[0m[36m requ[35mi[36mrements or we the requ[35mi[36mred hardware!                                   [34m|[0m"
tr "[34m|[0m[36m                                                                             [34m|[0m"
tr "[34m|[0m[36m Your attempt to enter th[35mi[36ms system w[35mi[36mll be added to the BBS callerslog F[35mi[36mle! [34m|[0m"
tr "[34m|[0m[36m                                                                            [34m_|[0m"
tr "[34m|[0m[36m GoodBye!                                                         [35m__[0m       [34m| |[0m"
tr "[34m`------------------------------------------------------------------[35m\/[34m-------^-'[0m"
tr ""
tr "[0mNO CARRIER"

section = "1"
call callerslog

/*----------------------------------------------------------------------*/
/*	Normal Modem Part						*/
/*----------------------------------------------------------------------*/
letin:

call questionaire

qu sysp;answer = upper(result)
if answer = pass then call correct
if answer = nups then call elite
if answer = "" then answer = noth

tr "[2A"
call questionaire

qu hand;handle = upper(result)
if handle = "" then handle = stra

tr "[3;0H[J           [34m`--------------------------------------------------------'[0m"
tr "  [35m__[0m           Detected Disconnect Is: [37m"day"[0m-[37m"mon"[0m-[37m"yea"  "tim"[0m."
tr "[34m.-[35m\/[34m--------------------------------------------------------------------------.[0m"
tr "[34m|[0m[36m Well '[32m"handle"[36m', you entered '[32m"answer"[36m'[0m[6;79H[34m|[0m"
tr "[34m|[0m[36m Th[35mi[36ms  [35mi[36ms  not the requ[35mi[36mred SystemPassword, wh[35mi[36mch [35mi[36ms needed to get access on [34m|[0m"
tr "[34m|[0m[36m th[35mi[36ms system.                                                                [34m|[0m"
tr "[34m|[0m[36m                                                                             [34m|[0m"
tr "[34m|[0m[36m Your attempt to enter th[35mi[36ms system w[35mi[36mll be added to the BBS callerslog F[35mi[36mle! [34m|[0m"
tr "[34m|[0m[36m                                                                            [34m_|[0m"
tr "[34m|[0m[36m GoodBye!     [35m__[0m                                                           [34m| |[0m"
tr "[34m`--------------[35m\/[34m-----------------------------------------------------------^-'[0m"
tr ""
tr "[0mNO CARRIER"

section = "2"
call callerslog

/*----------------------------------------------------------------------*/
/*	LowBaudPw Sucker						*/
/*----------------------------------------------------------------------*/
lamer:

decious="LowBaudPassword"
section = "3"
call positron

/*----------------------------------------------------------------------*/
/*	SystemPw Sucker							*/
/*----------------------------------------------------------------------*/
elite:

decious=" SystemPassword"
section = "4"
call positron

/*----------------------------------------------------------------------*/
/*	Show Info Get Handle And Fuck Off				*/
/*----------------------------------------------------------------------*/
positron:

tr "[2A"
call questionaire

qu hand;handle = upper(result)
if handle = "" then handle = stra

tr "[3;0H[J           [34m`--------------------------------------------------------'[0m"
tr "        [35m__[0m     Detected Disconnect Is: [37m"day"[0m-[37m"mon"[0m-[37m"yea"  "tim"[0m."
tr "[34m.-------[35m\/[34m--------------------------------------------------------------------.[0m"
tr "[34m|[0m[36m Well '[32m"handle"[36m', you entered '[32m"answer"[36m'[0m[6;79H[34m|[0m"
tr "[34m|[0m[36m Yeah  dude!  Someone  who can read, w[35mi[36mll be [35mi[36mn better pos[35mi[36mt[35mi[36mon at all!  Try [34m|[0m"
tr "[34m|[0m[36m f[35mi[36mnd[35mi[36mng the d[35mi[36mfference  between "decious" and NewUserPassword. So far [34m|[0m"
tr "[34m|[0m[36m maybe  you  try [35mi[36mt aga[35mi[36mn later.  Btw: There are not much standard Syspws at [34m|[0m"
tr "[34m|[0m[36m all!  Try one of them next t[35mi[36mme! You shalt be luck[35mi[36mer!!!                    [34m|[0m"
tr "[34m|[0m[36m                                                                             [34m|[0m"
tr "[34m|[0m[36m Your attempt to enter th[35mi[36ms system w[35mi[36mll be added to the BBS callerslog F[35mi[36mle! [34m|[0m"
tr "[34m|[0m[36m                                                                            [34m_|[0m"
tr "[34m|[0m[36m GoodBye!                                                               [35m__[0m [34m| |[0m"
tr "[34m`------------------------------------------------------------------------[35m\/[34m-^-'[0m"
tr ""
tr "[0mNO CARRIER"

call callerslog

/*----------------------------------------------------------------------*/
/*	Isdn Part							*/
/*----------------------------------------------------------------------*/
skip:

tr "[19;0H[34m.-.-------------------------------------------------------------------------.-.[0m"
tr "[34m|_|[0m[36m          Incom[35mi[36mng [35mI[36mSDN Call Detected bypass[35mi[36mng SystemPassword!   [35m__[0m     [34m|_|[0m"
tr " [34m`-------------------------------------------------------------------[35m\/[34m------'[0m"
tr ""

do for 5;sm "[20;23H[35mI[36mSDN";end	/*	I	*/
do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HISD[35mN[36m";end	/*	N	*/

do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23H[35mI[36mSDN";end	/*	I	*/

do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HISD[35mN[36m";end	/*	N	*/

do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23H[35mI[36mSDN";end	/*	I	*/

do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HISD[35mN[36m";end	/*	N	*/

do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23H[35mI[36mSDN";end	/*	I	*/

do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HISD[35mN[36m";end	/*	N	*/

do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23H[35mI[36mSDN";end	/*	I	*/

do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HISD[35mN[36m";end	/*	N	*/

do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23H[35mI[36mSDN";end	/*	I	*/

do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HISD[35mN[36m";end	/*	N	*/

do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23H[35mI[36mSDN";end	/*	I	*/

do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HISD[35mN[36m";end	/*	N	*/

do for 5;sm "[20;23HIS[35mD[36mN";end	/*	D	*/
do for 5;sm "[20;23HI[35mS[36mDN";end	/*	S	*/
do for 5;sm "[20;23H[35mI[36mSDN";end	/*	I	*/

do for 5;sm "[20;23H[35mISDN[36m";end	/*	ISDN	*/

tr "[22;0H[0m"

shutdown;exit;end

/*----------------------------------------------------------------------*/
/*	New User Door							*/
/*----------------------------------------------------------------------*/
newuser:

tr "[0;0H[J[34m          .-.------------------------------------------------------.-.[0m"
tr "          [34m|_|[36m      Copyright [37mGALAXY[36m Systems Inc. 1993-"yea"[2;68H[34m|_|[0m"
tr "           [34m`--------------------------------------------------------'[0m"
tr "                     [35m__[0m "
tr "[34m.-.------------------[35m\/[34m-----------------------------------------------------.-.[0m"
tr "[34m|_|[0m[36m You are forced to enter the NewUserPassword [0m([35mYou have only one chance[0m)[35m__[0m[34m|_|[0m"
tr " [34m`------------------------------------------------------------------------[35m\/[34m-'[0m"
tr ""

call questionaire

qu nupp;answer = upper(result)
if answer = nups then call correct
if answer = "" then answer = noth

tr "[2A"
call questionaire

gu 100;handle = upper(result)
if handle = "" then handle = stra

tr "[4;0H[J            [35m__[0m Detected Disconnect Is: [37m"day"[0m-[37m"mon"[0m-[37m"yea"  "tim"[0m."
tr "[34m.-----------[35m\/[34m----------------------------------------------------------------.[0m"
tr "[34m|[0m[36m Well '[32m"handle"[36m', you entered '[32m"answer"[36m'[0m[6;79H[34m|[0m"
tr "[34m|[0m[36m Th[35mi[36ms [35mi[36ms not the requ[35mi[36mred NewUserPassword,  wh[35mi[36mch [35mi[36ms needed to get access on [34m|[0m"
tr "[34m|[0m[36m th[35mi[36ms system.                                                                [34m|[0m"
tr "[34m|[0m[36m                                                                             [34m|[0m"
tr "[34m|[0m[36m Your attempt to enter th[35mi[36ms system w[35mi[36mll be added to the BBS callerslog F[35mi[36mle! [34m|[0m"
tr "[34m|[0m[36m                                                                            [34m_|[0m"
tr "[34m|[0m[36m GoodBye!                                            [35m__[0m                    [34m| |[0m"
tr "[34m`-----------------------------------------------------[35m\/[34m--------------------^-'[0m"
tr ""
tr "[0mNO CARRIER"

section = "5"
call callerslog

/*----------------------------------------------------------------------*/
/*	Questionaire Border						*/
/*----------------------------------------------------------------------*/
questionaire:

tr "[1A[34m.-.-------------------------------------------------------------------------.-.[0m"
tr "[34m|_|                                                                [35m__[0m       [34m|_|[0m"
tr " [34m`-----------------------------------------------------------------[35m\/[34m--------'[0m"
tr "[3A"

return

/*----------------------------------------------------------------------*/
/*	Type This If Correct						*/
/*----------------------------------------------------------------------*/
correct:

tr "[1A[4CCorrect! Thanx for using AmiExpress[37m([32mTM[37m)[0m Security-Mechanism![0m"

do for 5000;end

tr "[2A[J"

shutdown;exit;end

/*----------------------------------------------------------------------*/
/*	Write Text To CallersLog					*/
/*----------------------------------------------------------------------*/
callerslog:

call open(callerslog,"Bbs:Node"node"/CallersLog",'a')
call writeln(callerslog,"**************************************************************")
call writeln(callerslog,"	This happened on section "section"!      - Signed Security-Mechanism")
call writeln(callerslog,"	access to this BBS! But he failed due the wrong Shit he entered!")
call writeln(callerslog,"	A user with the handle '"handle"' entered '"answer"' to get")
call writeln(callerslog,"	On "day"-"mon"-"yea" at "tim" on Node "node" with "baud" Baud.")
call close(callerslog)

ps node;pu 511;shutdown;exit;end

/*----------------------------------------------------------------------*/
/*	Show Errors							*/
/*----------------------------------------------------------------------*/
syntax:
error:
ioerr:

tr ""
tr "Error in Line #"Sigl" : exiting ..."
tr errortext(Sigl)

shutdown;exit;end
