Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CookieCollection cookies = new CookieCollection();
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://stresser.network/?p=login");
- request.CookieContainer = new CookieContainer();
- request.CookieContainer.Add(cookies);
- //Get the response from the server and save the cookies from the first request..
- HttpWebResponse response = (HttpWebResponse)request.GetResponse();
- cookies = response.Cookies;
- string getUrl = "https://stresser.network/inc/ajax/login.php";
- string postData = String.Format("username={0}&password={1}", "username", "password");
- HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(getUrl);
- getRequest.CookieContainer = new CookieContainer();
- getRequest.CookieContainer.Add(cookies);
- getRequest.Method = WebRequestMethods.Http.Post;
- getRequest.UserAgent = request.UserAgent;//"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2";
- getRequest.AllowWriteStreamBuffering = true;
- getRequest.ProtocolVersion = HttpVersion.Version11;
- getRequest.AllowAutoRedirect = true;
- getRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
- byte[] byteArray = Encoding.ASCII.GetBytes(postData);
- getRequest.ContentLength = byteArray.Length;
- Stream newStream = getRequest.GetRequestStream();
- newStream.Write(byteArray, 0, byteArray.Length);
- newStream.Close();
- HttpWebResponse getResponse = (HttpWebResponse)getRequest.GetResponse();
- using (StreamReader sr = new StreamReader(getResponse.GetResponseStream())) {
- string sourceCode = sr.ReadToEnd();
- Console.Write(sourceCode);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement