home *** CD-ROM | disk | FTP | other *** search
/ Hacker Chronicles 1 / HACKER1.ISO / phrk3 / ph306.txt < prev    next >
Text File  |  1992-09-26  |  6KB  |  135 lines

  1.                                 ==Phrack Inc.==
  2.  
  3.                      Volume Three, Issue 30, File #6 of 12
  4.  
  5.                    Decnet Hackola : Remote Turist TTY (RTT)
  6.                    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7.  
  8.                            A Late-Night Creation Of
  9.  
  10.                                    *Hobbit*
  11.  
  12. This VMS network frob is yet another "tell"-type thing.  This one has an
  13. uncommon feature though:  recursion (i.e. you can be connected to some host
  14. and open *another* connection to a third host and it will [attempt to!] "do the
  15. right thing").  Also, you can ^Y out and if you run it again, it will return to
  16. the open connection instead of starting a new one.
  17.  
  18. _H*
  19.  
  20.  
  21. *************************************************************************
  22. $! RTT -- Remote Turist TTY interface.  Do @RTT hostname or @RTT area.node
  23. $! to start; this file must exist in the remote machine's default area.
  24. $! You can ^Y out and the network channel will stick around; invoking RTT
  25. $! again will resume the extant process and ignore arguments.
  26. $! If we are a network object, play server, if not, we must be the client.
  27. $! If we are called while already playing server, recurse to the end host.
  28. $! This recursion in theory can happen infinite times.  Make damn sure
  29. $! what you call this file and the "task=" spec jive, and that they are the
  30. $! same file, or you will fall victim to very vicious timing screws.
  31. $!
  32. $! Another result of *Hobbit* abusing network file jobs until well past dawn.
  33. $!
  34. $! _H*
  35. $set noon
  36. $if f$mode().eqs."NETWORK".and.p1.eqs."" then $goto srv
  37. $! Talking to a luser, go find the net job
  38. $magic=0                        ! assume top level
  39. $if f$trnlnm("nf",,,,,"table_name").nes."" then $goto lread
  40. $sl=f$len(p1)
  41. $dot=f$locate(".",p1)           ! area.node
  42. $if sl.eq.dot then $goto nopen  ! no dot, treat normally
  43. $q=f$loc("""",p1)               ! access control??
  44. $node=f$ext(0,dot,p1)           ! area
  45. $dot=dot+1                      ! point past it now
  46. $node=node*1024+f$ext(dot,q-dot,p1)  ! and pull out the complete node
  47. $rest=""""+f$ext(q,80,p1)+""""  ! superquotify the quotes [yeccchh!]
  48. $p1="''node'''rest'"            ! add remains in stringwise [ack barf]
  49. $! We were called with an argument; but if we're network mode, we're *already*
  50. $! a server, so do special things.
  51. $nopen: $if f$mode().eqs."NETWORK" then $magic=1
  52. $! Top-level user process or recursed here: client connect
  53. $open/read/write/err=yuk nf 'p1'::"0=rtt"
  54. $read/time=5/err=yuk nf hprm    ! let other end tell us where we got
  55. $prm==hprm                      ! global prompt str so we resume correctly
  56. $write sys$output "Connection open"
  57. $if magic then $goto m_setup
  58. $lread: $read/prompt="''prm'$ "/end=lclose sys$command line
  59. $write nf line                  ! send the sucker and go get the stuff
  60. $ltype: $read/time=8/err=tmo/end=lclose nf line
  61. $if line.eqs."%%eoc%%" then $goto lread
  62. $if line.eqs."%%magic%%" then $goto newprm
  63. $write sys$output line
  64. $goto ltype
  65. $newprm: $read nf hprm          ! new prompt gets piped in from servers
  66. $prm==hprm                      ! let us find it
  67. $read nf line                   ! garbola %%eoc%% -- avoid timing fuckup
  68. $if line.nes."%%eoc%%" then $goto hpe  !! oops !!
  69. $goto lread
  70. $tmo: $write sys$output "[Timed out]"   ! supposed to bail out on a fuckup
  71. $goto lread                             ! it doesn't always work, though.
  72. $!
  73. $! Do a special dance when we're recursing
  74. $m_setup: $write nnn "%%magic%%"
  75. $write nnn prm                  ! notify client end of new connection
  76. $signal                         ! flush the inbetweens
  77. $goto rread                     ! and drop to magic server
  78. $!
  79. $srv:                           ! Normal remote task half
  80. $! This is an unbelievable kludge.  You can't just open sys$net: and then
  81. $! have program output go there as well as the control thingies, but you
  82. $! *can* pipe everything to your sys$net-opened-device: and it *works*!
  83. $open/read/write/err=yuk nnn sys$net:
  84. $close sys$output               ! netserver.log?
  85. $close sys$error
  86. $magic=0                        ! not recursing yet
  87. $! Some handy symbols for the far end
  88. $rtt:==@sys$login:rtt           ! make further connects easier
  89. $ncp:==$ncp                     ! for hacking the network
  90. $signal:==write nnn """%%eoc%%""" ! magic sync string
  91. $write nnn f$trnl("sys$node","lnm$system_table")        ! HELO...
  92. $def/pr sys$output nnn:         ! the awful kludge is invoked
  93. $def/pr sys$error nnn:          ! for error handling too
  94. $!
  95. $! Server loop
  96. $rread: $read/end=rclose nnn line
  97. $if magic then $goto passing
  98. $'line'
  99. $m_cmd_end: $signal             ! signal for all completions
  100. $goto rread
  101. $! If we're magically in the middle, handle differently
  102. $passing: $write nf line
  103. $mtype: $read/time=5/err=mclose/end=mclose nf line
  104. $if line.eqs."%%eoc%%" then $goto m_cmd_end
  105. $write nnn line
  106. $goto mtype
  107. $!
  108. $! Closure and error handlers
  109. $! General protocol error catch
  110. $yuk: $write sys$output "Couldn't open network!"
  111. $exit
  112. $! Here if the luser typed ^Z
  113. $lclose: $close nf              ! should signal eof at far end
  114. $exit
  115. $! Here if we got hung up on by the client
  116. $rclose: $if magic then $close nf
  117. $close nnn
  118. $stop/id=0
  119. $! Here if we're magic and our remote server exited: tell client whats flying
  120. $mclose: $close nf
  121. $magic=0
  122. $write nnn "%%magic%%"
  123. $write nnn f$trnl("sys$node","lnm$system_table")
  124. $signal
  125. $goto rread
  126. $! Here if we recursed down the line there and didn't see the right things
  127. $hpe: $write sys$output "!!Hairy protocol error!!"
  128. $close nf
  129. $exit
  130. _______________________________________________________________________________
  131.  
  132. 
  133.  
  134. Downloaded From P-80 International Information Systems 304-744-2253 12yrs+
  135.