home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / free_security / languard / languardnss7.exe / ftp_full_path_expose.vbs13 < prev    next >
Encoding:
Text File  |  2003-10-09  |  1.8 KB  |  57 lines

  1. 'Anonymous Ftp Guest Account
  2.  
  3. Function Main
  4.  
  5. Dim strRequest As String
  6. Dim  strResponse As String
  7. Dim SocketObject As Object
  8. Dim regexp As Object
  9. Dim result As Boolean
  10.  
  11.  
  12.     result = false
  13.     ip = getparameter("ComputerIP")
  14.     port = "21"
  15.     cr = Chr(13) +  Chr(10)
  16.     rem _ip
  17.     Socket.SetTimeout 5000,5000
  18.     Set regexp = CreateObject("Vbscript.regexp")
  19.     Set SocketObject = Socket.OpenTCP (ip,port)
  20.     If Not SocketObject is Nothing Then 
  21.         strResponse = SocketObject.recv(1024)
  22.      If Len(strResponse) > 0 Then
  23.           If InStr(1, strResponse,"220") > 0 Then
  24.                    SocketObject.send("user anonymous" + cr)
  25.                     strResponse = SocketObject.recv(1024)
  26.                     If Len(strResponse) > 0 Then 
  27.                           If InStr(1, strResponse,"331") > 0 Then 
  28.                                  SocketObject.send("pass lnss@gfi.com" + cr)
  29.                                  strResponse = SocketObject.recv(1024)
  30.                                  If Len(strResponse) > 0 Then
  31.                                         If InStr(1, strResponse,"230") > 0 Then
  32.                                            SocketObject.send("xpwd" + cr)
  33.                                            strResponse = SocketObject.recv(1024)
  34.                                            If Len(strResponse) > 0 Then
  35.                                                   If InStr(1, strResponse,"257") > 0 Then
  36.                                                 regexp.pattern = "[A-Za-z]:(\\[A-Za-z0-9_.-])*"                                          
  37.                                                          If regexp.test(strResponse) Then
  38.                                                           result = 1
  39.                                                   End  If
  40.                                                   End If
  41.                                            End If
  42.                                         End If
  43.                                  End If
  44.                           End If
  45.                    End If
  46.              End If
  47.          End If
  48.          SocketObject.Close
  49.     End If
  50. '    If result = True Then
  51. '        echo "Ftp at "+CStr(IP)+" on port: "+CStr(Port)+" Exposes Full Paths" + cr
  52. '    Else
  53. '        echo "Ftp at "+CStr(IP)+" on port: "+CStr(Port) +" Does not expose Full Paths"+ cr
  54. '    End If
  55.     main = result
  56.  
  57. End Function