[原創]K8 Cscan 大型內網滲透自定義掃描器html
http://www.javashuo.com/article/p-xhgigpwl-kn.htmlgit
Cscan簡介:
何爲自定義掃描器?其實也是插件化,但Cscan不須要編程一樣可實現自定義功能,這比單純插件化更容易實現插件功能
Cscan旨在爲用戶提供一個高度靈活、簡單易用、多線程、多網段的插件化掃描框架,減小大量重複性工做提升工做效率
3.3及以上版本分爲檢測存活和不檢測存活主機模式 程序採用多線程批量掃描大型內網IP段C段存活主機(支持上萬個C段)
插件含C段旁註掃描、子域名掃描、Ftp密碼爆破、Mysql密碼爆、系統密碼爆破、存活主機掃描、Web信息探測、端口掃描
支持調用任意外部程序或腳本,支持自定義模塊,固然也可用於外網掃描(如子域名、C段旁註、FTP破、MYSQL爆破等)github
Web信息插件模塊:web
Cscan內置Delphi、VC、.NET例子,須要更多功能,請自行添加完善sql
using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Text.RegularExpressions; namespace CscanDLL { public class scan { public static string run(string ip) { if (string.IsNullOrEmpty(ip)) return ""; else { string hostName = ""; //return ip; //return System.Net.Dns.GetHostByAddress(ip).HostName; //192.11.22.10 Microsoft-IIS/10.0 IIS Windows //192.11.22.1 H3C-Miniware-Webs ER3200G2 return ip + "\t" + getURLbanner(ip) + "\t" + GetTitle(getHtml("http://" + ip,2)); //return ip + "\t" + hostName + "\t[" + getURLbanner(ip) + "]\t[" + GetTitle(getHtml("http://" + ip)) + "]"; //return ip + "\t" + System.Net.Dns.GetHostByAddress(ip).HostName; } } private static string getURLbanner(string url) { url = "http://" + url; try { var req = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url)); req.Method = "HEAD"; req.Timeout = 10000; var res = (HttpWebResponse)req.GetResponse(); if (res.StatusCode == HttpStatusCode.OK || res.StatusCode == HttpStatusCode.Forbidden || res.StatusCode == HttpStatusCode.Redirect || res.StatusCode == HttpStatusCode.MovedPermanently) { return res.Server; } //res.Close(); return res.Server; } catch (WebException ex) { return ""; } } private static string GetTitle(string html) { String regex = @"<title>.+</title>"; String title = Regex.Match(html, regex).ToString(); title = Regex.Replace(title, @"[\""]+", ""); return title; } private static string getHtml(string url) { try { if (!url.ToLower().Contains("https://") && !url.ToLower().Contains("http://")) url = "http://" + url; WebClient web = new WebClient(); byte[] buffer = web.DownloadData(url); return Encoding.UTF8.GetString(buffer); } catch (Exception ex) { return ex.Message; } } } }
編譯成netscan.dll後,放置Cscan.exe同目錄便可(netscan.dll優先級最高,無須刪除其它插件)編程
ip.txt填上當前IP段或內網多個IP段,執行Cscan.exe。多線程
Cscan20對應.net 2.0編譯,因此編譯的DLL也要對應版本框架
實戰使用哪一個版本,由目標系統已安裝.net版原本決定。url
結果如圖spa