public static List <string> MultiBannerGrab(string ip, int port, int bufferSize = 512, int timeout = 5000) { List <string> returnList = new List <string>(); ConcurrentBag <string> resultCollection = new ConcurrentBag <string>(); List <string> toTest = new List <string> { "", "Woof\r\n\r\n", "HEAD / HTTP/1.1\r\nHost: " + ip + "\r\n\r\n" }; Parallel.ForEach(toTest, theBanner => resultCollection.Add(BannerGrabThread(ip, port, theBanner, bufferSize = 512, timeout))); returnList.AddRange(resultCollection.ToList()); if (returnList.Any(x => x == "Reecon - Connection reset")) // Something forced a reset { // Console.WriteLine("Testing a reset web grab"); if (Web.BasicHTTPSTest(ip, port)) { returnList.Add("Reecon - HTTPS"); } } return(returnList.ToList()); }
public static List <string> MultiBannerGrab(string ip, int port, int bufferSize = 512, int timeout = 5000) { List <string> returnList = new(); ConcurrentBag <string> resultCollection = new(); List <string> toTest = new() { "", "Woof\r\n\r\n", "HEAD / HTTP/1.1\r\nHost: " + ip + "\r\n\r\n", // TLS // "0x16, 0x03, 0x01, 0x00, 0xa5, 0x01, 0x00, 0x00, 0xa1, 0x03, 0x03, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x20, 0xcc, 0xa8, 0xcc, 0xa9, 0xc0, 0x2f, 0xc0, 0x30, 0xc0, 0x2b, 0xc0, 0x2c, 0xc0, 0x13, 0xc0, 0x09, 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x9c, 0x00, 0x9d, 0x00, 0x2f, 0x00, 0x35, 0xc0, 0x12, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x18, 0x00, 0x16, 0x00, 0x00, 0x13, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x75, 0x6c, 0x66, 0x68, 0x65, 0x69, 0x6d, 0x2e, 0x6e, 0x65, 0x74, 0x00, 0x05, 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x1d, 0x00, 0x17, 0x00, 0x18, 0x00, 0x19, 0x00, 0x0b, 0x00, 0x02, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x12, 0x00, 0x10, 0x04, 0x01, 0x04, 0x03, 0x05, 0x01, 0x05, 0x03, 0x06, 0x01, 0x06, 0x03, 0x02, 0x01, 0x02, 0x03, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x12, 0x00, 0x00" }; Parallel.ForEach(toTest, theBanner => resultCollection.Add(BannerGrabThread(ip, port, theBanner, bufferSize = 512, timeout))); returnList.AddRange(resultCollection.ToList()); if (returnList.Any(x => x == "Reecon - Connection reset")) { if (Web.BasicHTTPSTest(ip, port)) { returnList.Add("Reecon - HTTPS"); } } return(returnList.ToList()); }