Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. POST /form-submit HTTP/1.1
  2. Accept: */*
  3. Authorization: Basic UG9seWNvbTo0NTY=
  4. Content-Type: application/x-www-form-urlencoded
  5. Referer: https://192.168.88.5/index.htm
  6. Accept-Language: en-US,en;q=0.5
  7. User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like
  8. Gecko
  9. Host: 192.168.88.5
  10. Content-Length: 32
  11. DNT: 1
  12. Connection: close
  13. Cache-Control: no-cache
  14. Cookie: Authorization=Basic UG9seWNvbTo0NTY=
  15.  
  16. 15=XYZ
  17.  
  18. System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
  19.  
  20. ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications);
  21. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
  22.  
  23.  
  24.  
  25. var requ = (HttpWebRequest)WebRequest.Create("https://192.168.88.5/form-submit");
  26. requ.Method = "POST";
  27. requ.Credentials = new NetworkCredential("Polycom", "456");
  28.  
  29. requ.SetRawHeader("Accept", "*/*");
  30. requ.ServicePoint.Expect100Continue = false;
  31. requ.Headers.Add("Authorization", "Basic " + "UG9seWNvbTo0NTY=");
  32. requ.ContentType = "application/x-www-form-urlencoded";
  33. requ.Referer = "https://192.168.88.5/index.htm";
  34. requ.SetRawHeader("Accept-Language", "en-US,en;q=0.5");
  35. requ.UserAgent = " Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko";
  36. requ.SetRawHeader("Host", "192.168.88.5");
  37. requ.SetRawHeader("Content-Length", "6");
  38.  
  39. // String encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes("Basic=" + ":" + "UG9seWNvbTo0NTY="));
  40.  
  41. requ.SetRawHeader("DNT", "1");
  42.  
  43. requ.Headers.Add("Cache-Control", "no - cache");
  44.  
  45. requ.SetRawHeader("Cookie", "Authorization = Basic UG9seWNvbTo0NTY=");
  46. ASCIIEncoding encoding = new ASCIIEncoding();
  47. byte[] byte1 = encoding.GetBytes("15=ZOMBIE");
  48.  
  49. // Set the content type of the data being posted.
  50. requ.ContentType = "application/x-www-form-urlencoded";
  51.  
  52. // Set the content length of the string being posted.
  53. requ.ContentLength = byte1.Length;
  54.  
  55. using (StreamWriter writer = new StreamWriter(requ.GetRequestStream()))
  56. {
  57. writer.Write("15=ZOMBIE");
  58. }
  59.  
  60.  
  61. var resp = (HttpWebResponse)requ.GetResponse();
  62. // Create a request using a URL that can receive a post.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement