private static void Attack(string domain, string directory) { if (CanMakeMoreRequest()) { try { PauseExecution(_requestTimeInterval); var request = httpManager.WebRequestFactory(domain + directory, _proxy, _userAgent, _requestTimeout); var response = request.GetResponse(); controlRequestQuantity++; if (((HttpWebResponse)response).StatusCode == HttpStatusCode.OK) { Util.Util.ChangeConsoleColorToGreen(); WriteMessageAndSkipLine("Directory Listing enabled for directory: " + directory + " ;)", 0); } else { Util.Util.ChangeConsoleColorToRed(); WriteMessageAndSkipLine("Sorry, I failed when I try to access the target directory or the directory is pretty safe :(", 0); } } catch (WebException ex) { if (ex.Message.Contains("(404)")) { Util.Util.ChangeConsoleColorToRed(); WriteMessageAndSkipLine("Sorry, this directory is no longer part of target domain. Response.HttpStatusCode = 404", 0); } else if (ex.Message.Contains("(403)")) { Util.Util.ChangeConsoleColorToRed(); WriteMessageAndSkipLine("This directory is preety safe, I got a (403) response code status :(", 0); } else { Util.Util.ChangeConsoleColorToRed(); WriteMessageAndSkipLine("Sorry, I failed when I try to access the target directory :(", 0); } } catch (Exception ex) { Util.Util.ChangeConsoleColorToRed(); WriteMessageAndSkipLine("Sorry, I failed when I try to access the target directory or the directory is pretty safe :(", 0); } } else { WriteMessageAndSkipLine("Sorry, you have reached the maximum number of requests that you informed as a parameter {r=" + _requestQuantity + "}.", 0); } }
private static void Execute() { Util.Util.ChangeConsoleColorToDefault(); WriteMessageAndSkipLine("-------------------------------------------", 0); WriteMessageAndSkipLine("<<< PROCESSING >>> " + _urlTarget, 0); WriteMessageAndSkipLine("-------------------------------------------", 1); WriteMessageAndSkipLine("Localizing target host...", 1); httpManager = new HttpManager.HttpManager(); if (CanMakeMoreRequest()) { var request = httpManager.WebRequestFactory(_urlTarget, _proxy, _userAgent, _requestTimeout); var response = request.GetResponse(); controlRequestQuantity++; if (((HttpWebResponse)response).StatusCode == HttpStatusCode.OK) { ProcessResponse((HttpWebResponse)response); } else { Util.Util.ChangeConsoleColorToRed(); WriteMessageAndSkipLine("Sorry, I failed when I try to access the target :(", 0); } } else { WriteMessageAndSkipLine("Sorry, you have reached the maximum number of requests that you informed as a parameter {r=" + _requestQuantity + "}.", 0); } }
private static void Execute() { Console.WriteLine("... PROCESSING ..."); Console.WriteLine(); Console.WriteLine("Localizing target host..."); Console.WriteLine(); httpManager = new HttpManager.HttpManager(); WebRequest request = httpManager.WebRequestFactory(_urlTarget, _proxy, string.Empty); WebResponse response = request.GetResponse(); if (((HttpWebResponse)response).StatusCode == HttpStatusCode.OK) ProcessResponse((HttpWebResponse)response); else { Util.Util.ChangeConsoleColorToRed(); Console.WriteLine("Sorry, I failed when I try to access the target :("); } }