[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

199.0. "Network spy .." by PARVAX::HERNANDEZ () Mon Jan 27 1986 13:34

Ever wanted to know when a user on another node logged on?

Try this simple procedure.
Insert this line in your login.com

	$ spawn/nowait/notify @netwatch nodename username

$ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$ !                                                             !
$ !                      NETWATCH.COM                           !
$ !                                                             !
$ !     DCL procedure to alert you of users as they log on      !
$ !             to any VMS system on the Easynet                !
$ !                                                             !
$ !           ( spawn this in your login.com )                  !
$ !                                                             !
$ !      $ spawn/nowait/notify @netwatch nodenmae username      !
$ !                                                             !
$ !                  By Manny Hernandez                         !
$ !                                                             !
$ !     Any comments please forward to PARVAX::HERNANDEZ        !
$ !                                                             !
$ !                         V1.2                                !
$ !                                                             !
$ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$ ! set nocontrol so spawn won't terminate on normal interrupt
$ !set nocontrol
$ long_node_name = f$logical("sys$node")
$ new_node_name = f$extract(1,10,long_node_name)
$ edit_node_name = f$edit(new_node_name,"trim")
$ node_long = f$len(edit_node_name)
$ node_length = node_long-2
$ node_name = f$extract(0,node_length,edit_node_name)
$ if p1 .eqs. "" then goto begin
$ if p2 .eqs. "" then goto ask_user
$ goto net_watch
$begin:
$ inq p1 "Node of user [''node_name'] "
$ if p1 .eqs. "" then p1  = "''node_name'"
$ask_user:
$ inq p2 "User to watch for "
$ if p2 .eqs. "" then goto ask_user
$net_watch:
$ error_status = %x1001C002
$ open/read/write slave 'p1'::"29="
$ present_status = $status
$ if present_status .eq. error_status then goto down_sys
$ local_user := 'f$logical("sys$node")''f$getjpi("","username")'
$ request_dir[0,8] = 15
$ request_dir = request_dir + local_user
$ write slave request_dir
$ count = 0
$loop:
$ read/end=eof/error=error_on_system slave username
$ if username .eqs. "" then goto done
$ write slave request_dir
$ match = f$extract(16,12,username)
$ trimmed = f$edit(match,"trim")
$ if trimmed .eqs. "''p2'" then goto there
$ goto loop
$done:
$ return[0,8] = 13   
$ return = return + local_user
$ write slave return
$ goto close
$down_sys:
$ write sys$output "
$ write sys$output "  Node ''p1' is not currently reachable "
$ exit
$error_on_system:
$ write sys$output "
$ write sys$output "  NETWATCH-F-LOOKUP, error while attempting link."
$ close net_file
$close:
$ close slave
$ !
$ ! wait 30 seconds before looking again
$ !
$ wait 00:00:30
$ goto net_watch
$there:
$ write sys$output "  User ''trimmed' has logged onto node ''p1' ! "
$ goto net_watch
T.RTitleUserPersonal
Name
DateLines
199.1TURTLE::GILBERTMon Jan 27 1986 17:001
You guessed it!  This is another "let's hack the PHONE protocol" hack.
199.2TRON::ROBERTSTue Jan 28 1986 08:166
If I wanted to understand how the PHONE and MAIL protocol hacks worked, as
opposed to just using them, I'd need to know the protocols. 

Can any one pass me a pointer to the relevant documentation.

Thanks.
199.3AJAX::CALLASWed Jan 29 1986 11:224
Nice, except you assume that a terminal has 24 lines on it. You should use
f$getdvi of TT_PAGE to find the actual number. 

	Jon
199.4protocolsRDGE28::BADMANDo not supress that electric glow.Fri Feb 21 1986 07:056
  re .2 - I would also find a copy of the phone and mail protocols
  handy - it seems silly to use procedures such as the one in .0
  without understanding how it works. How about somebody sending
  in the protocols as a note ...
  
  						Jamie
199.5Microfiche?CLT::COWANKen Cowan, 381-2198Sat Feb 22 1986 21:445
    I'd guess the protocols are documented in the VMS source and
    no where else.   As far as I know, the only thing no on the
    source microfiche is a module that does password checking.
    
    	KC
199.6procedure in .0 with some additionsPRSIS3::DTLParis, FranceSun Feb 23 1986 12:11114
    Small modification to get only ONCE the message, and know when the user
    logged off as well. (plus some fixes) (without permission) :-)
    
$ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$ !                                                             !
$ !                      NETWATCH.COM                           !
$ !                                                             !
$ !     DCL procedure to alert you of users as they log on      !
$ !             to any VMS system on the Easynet                !
$ !                                                             !
$ !           ( spawn this in your login.com )                  !
$ !                                                             !
$ !      $ spawn/nowait/notify @netwatch nodenmae username      !
$ !                                                             !
$ !                  By Manny Hernandez                         !
$ !                                                             !
$ !     Any comments please forward to PARVAX::HERNANDEZ        !
$ !                                                             !
$ !                         V1.2                                !
$ !								!
$! V1.3 23-feb-1986 PRSIS3::DTL modified to display message only!
$!				once, and also at logout.	!
$!				fixed a couple of bugs in the   !
$!				loop causing overflow.		!
$ !                                                             !
$ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$ ! set nocontrol so spawn won't terminate on normal interrupt
$ set nocontrol
$ long_node_name = f$logical("sys$node")
$ new_node_name = f$extract(1,10,long_node_name)
$ edit_node_name = f$edit(new_node_name,"trim")
$ node_long = f$len(edit_node_name)
$ node_length = node_long-2
$ node_name = f$extract(0,node_length,edit_node_name)
$ if p1 .eqs. "" then goto begin
$ if p2 .eqs. "" then goto ask_user
$ goto net_watch
$begin:
$ inq p1 "Node of user [''node_name'] "
$ if p1 .eqs. "" then p1  = "''node_name'"
$ask_user:
$ inq p2 "User to watch for "
$ if p2 .eqs. "" then goto ask_user
$net_watch:
$ error_status = %x1001C002
$ open/read/write slave 'p1'::"29="
$ present_status = $status
$ if present_status .eq. error_status then goto down_sys
$ local_user := 'f$logical("sys$node")''f$getjpi("","username")'
$ request_dir = ""
$ request_dir[0,8] = 15
$ request_dir = request_dir + local_user
$ write slave request_dir
$ count = 0
$loop:
$ read/end=done/error=error_on_system slave username
$ if username .eqs. "" then goto done
$ write slave request_dir
$ match = f$extract(16,12,username)
$ trimmed = f$edit(match,"trim")
$ if "''trimmed'" .eqs. "''p2'" then goto there
$ goto loop
$done:
$ return = ""						!init
$ return[0,8] = 13   
$ return = return + local_user
$ write slave return
$ flag = "''P1'_''P2'$status"				!node_user$status (1/0)
$ set message/nof/nos/noi/not				!disable DCL warning
$ on warning then goto init				!init status if first
$ flag = 'flag'						! time the user logs in
$ set message/f/s/i/t					!restore DCL messages
$ if "''flag'" .eqs. "1" then goto no_more_there	!was here, but no more
$ goto close
$init:
$ set message/f/s/i/t					!restore DCL messages
$ 'P1'_'P2'$status == "0"				!no more logged in
$ goto close
$down_sys:
$ write sys$output "
$ write sys$output "  Node ''p1' is not currently reachable "
$ exit
$error_on_system:
$ write sys$output "
$ write sys$output "  NETWATCH-F-LOOKUP, error while attempting link."
$ close net_file
$close:
$ local_user = ""					!clear username field 
$ close slave
$ !
$ ! wait 30 seconds before looking again
$ !
$ wait 00:00:30
$ goto net_watch
$there:
$ flag = "''P1'_''P2'$status"				!get user status name
$ set message/nof/nos/noi/not				!disable DCL warnings
$ verb = "has"						!tricky French detail
$ on warning then verb = "*is*"				! to correct message..
$ flag = 'flag'						!get user status value
$ set message/f/s/i/t					!restore DCL messages
$ if "''flag'" .eqs. "1" then goto close		!already notified. skip
$ write sys$output -
 " User ''P2' ''verb' logged onto node ''p1' "
$ 'P1'_'P2'$status == "1"				!set status user logged
$ goto close						! in
$no_more_there:
$ flag = "''P1'_''P2'$status"
$ flag = 'flag'
$ if "''flag'" .eqs. "0" then goto close
$ write sys$output -
 " >> User ''P2' has logged off node ''p1' << "
$ 'P1'_'P2'$status == "0"
$ goto close
199.72LITTL::RASPUZZIMichael RaspuzziMon Feb 24 1986 19:276
    If anyone is interested, I have a MACRO program that will do the
    same thing. MACRO as in MACRO-20. It will run under TOPS-20 V6.1
    on a 2065 that has DECnet phase IV running. If anyone is interested,
    send mail to the address listed above.
    
    Mike
199.8DOing the dir not really neededCOGNAC::ADOERFERHit KP7 to select.Wed Sep 03 1986 21:5362
$ !one-shot "are they there?" test
$ !adapted from so many procedures it's adoption papers would be
$ !longer than the procedure
$ !
$ !Insert anti-hacking measures at will
$ !
$ null_byte[0,8] = 0		!Set up phone protocol values
$ id_rmt_user[0,8] = 7		!Text = id of remote user, status rtn
$ slave_exit[0,8] = 13		!Command to slave
$ !
$ status_unknown = 0		!Unknown problem
$ status_success = 1		!The operation was completed successfully.
$ status_isyntax = 2		!Invalid user syntax
$ status_nocomm = 3		!Slave could not communicate with user
$ status_missunam = 4		!<node::user> missing user name
$ status_nopriv = 5		!The slave does not have necessary privileges.
$ status_noexist = 6		!The specified Target user does not exist.
$ status_badterm = 7		!The Target's terminal cannot be used by PHONE.
$ status_logoff = 8		!The Target logged off during the procedure.
$ status_offhook = 9		!Target phone off hook (e.g., /NOBROADCAST set).
$ !
$ remote_user = p1
$ if remote_user .eqs. "" then read sys$command remote_user -
    /error=error/end=exit/prompt="User to inquire about: "
$ remote_user = f$edit(remote_user,"trim,upcase,uncomment")
$ remote_node = f$parse(remote_user,,,"node") - "_"
$ remote_user = remote_user - remote_node
$ if remote_user .eqs. "" then goto exit
$ if remote_node .eqs. "" then remote_node = f$logi("sys$node") - "_"
$ local_user = ""
$ local_user = local_user + null_byte
$ open/read/write link 'remote_node'"29="
$ write /error=error link id_rmt_user,local_user,remote_user
$ read link ans /end=error/error=error
$ if f$cvui(0,8,ans) .eq. status_noexist then goto not_there
$ if f$cvui(0,8,ans) .eq. status_success then goto there
$BAD_STATUS:
$ write sys$output f$fao("Bad status received = !2ZB.",f$cvui(0,8,ans))
$ERROR:
$ write sys$output "An error has occured."
$ goto exit
$THERE:
$write sys$output remote_user," is there!"
$!
$!Action to be taken when there goes here
$!*could even be "just" a directory
$!
$goto exit
$NOT_THERE:
$write sys$output remote_user," is not there!"
$!
$!Action to be taken when not there goes here
$!
$!NOTE:  LINK is NOT disconnected yet.  Watch loops
$!could have input a time to wait, disconnected, and looped
$!but for now
$goto exit
$EXIT:
$ write link slave_exit,local_user
$ close link
$ exit