• Sending a VPS command in C Sharp

    ShikhaTan Member

    I am writing this code in CSharp and I need some help. I started up the code by finding the IP & Port of some application and I gave them strings (IP & Port). Now, I want to send the following command to the VPS server:

    sudo ./exploit -h IP -U -t 1200 -p PORT,PORT

    I cannot figure out how I can send it, if there is even a way to do that?
    I tried bunch of things like:

    VPSERVERIP/exploit?ip={0}&port={1}&password={2}&time={3}"

    But OFC it would not work because I am missing something in the command.

    I added SSH libraries and trying the following:

                //Create a new SSH stream
                new SharpSsh.SshStream("VPS IP", "mrad", "mrad");
    
                //..The SshStream has successfully established the connection.
    
                string command2 = "sudo ./exploit -h {0) -U -t {3} -p {1},{1}";
    
                SharpSsh.SshStream.Write (command2);
    

    I keep getting the following:

    An object reference is required for the non-static field, method, or property 'SharpSsh.SshStream.Write(string)

  • Fierro Member

    You didn’t declare your variable. I assume you meant to do this:

    SshStream sshs = new SharpSsh.SshStream("VPS IP", "mrad", "mrad");
    string command2 = "sudo ./exploit -h {0) -U -t {3} -p {1},{1}";
    sshs.SshStream.Write (command2);
    
Viewing 1 reply thread
  • You must be logged in to reply to this topic.
en_USEnglish