文章最后更新时间为:2022 年 04 月 23 日 14:46:53 Loading... ## 0.扫描工具 ``` sx是一款基于命令行接口的网络扫描器 https://github.com/v-byte-cpu/sx ``` ``` ThunderSearch: 【信息搜集】闪电搜索器;GUI图形化渗透测试信息搜集工具 https://github.com/xzajyjs/ThunderSearch ``` ``` SiteScan: 专注一站化解决渗透测试的信息收集任务,功能包括域名ip历史解析、nmap常见端口爆破、子域名信息收集、旁站信息收集、whois信息收集、网站架构分析、cms解析、备案信息收集、CDN信息解析、是否存在waf检测、后台寻找以及生成检测结果html报告表。 https://github.com/xzajyjs/SiteScan ``` ``` 红队作战中的一些工具分享 https://github.com/r0eXpeR/redteam-tools ``` ## **1.whois信息收集** 1.1 域名Whois: ``` 站长之家:http://whois.chinaz.com/ 爱站:https://whois.aizhan.com/ 微步:https://x.threatbook.cn/ Bugscaner:http://whois.bugscaner.com Whois:https://who.is/ whois命令(whois example.com) ``` 1.2 IPWhois: ``` http://ip.webmasterhome.cn/ https://www.whois365.com/ https://tool.chinaz.com/ipwhois ``` ## **2.备案信息收集** ``` 天眼查:https://www.tianyancha.com/ 工信部服务平台:https://beian.miit.gov.cn/ 站长之家:https://icp.chinaz.com/ ``` ## **3.子域名查询** 3.1 谷歌语法: ``` site:example.com VirusTotal:https://www.virustotal.com/#/home/search DNSdumpster:https://dnsdumpster.com/ ``` 3.2 基于SSL证书查询: ``` https://crt.sh/ https://censys.io/ https://developers.facebook.com/tools/ct/ https://google.com/transparencyreport/https/ct/ ``` 3.3 工具: ``` OneForAll:https://github.com/shmilylty/OneForAll Knock:https://github.com/guelfoweb/knock dnssearch:https://github.com/evilsocket/dnssearch Dumb:https://github.com/giovanifss/Dumb Subfinder:https://github.com/projectdiscovery/subfinder ESD:https://github.com/FeeiCN/ESD ``` ## **4.旁站、C段收集** 4.1 同IP网站查询: ``` http://stool.chinaz.com/same https://www.webscan.cc/ Fofa:https://fofa.info/toLogin Hunter:https://hunter.qianxin.com/ ``` 4.2 工具: ``` https://github.com/k8gege/K8CScan ``` ## **5.网站架构探测** #### **5.1 操作系统** ``` 1.Windows:大小写不敏感 Linux:大小写敏感 2.windows下一般是ASP+IIS+access/sqlserver Linux下一般是php+Apache+mysql 3.扫描目标22和3389,粗略估计 4.ping,根据ttl值判断(Linux≈64,Windows≈128) ``` #### **5.2 数据库** ``` sql server mysql access oracle sybase db2 infomix postgresql ``` ##### 判断数据库 ###### mysql: 1.字符串拼接:   这两种方式可以拼接字符串。 2.BENCHMARK函数: MySQL有一个内置的`BENCHMARK()`函数,可以测试某些特定操作的执行速度。 参数可以是需要执行的次数和表达式。 表达式可以是任何的标量表达式,比如返回值是标量的子查询或者函数。请注意:该函数只是简单地返回服务器执行表达式的时间,而不会涉及分析和优化的开销。   如上通过对比,发现`MD5`的效率`SHA1`效率高 在MYSQL当中字符串拼接和BENCHMARK()都是独有的,因此可以通过这些差异来判断 ###### Oracle 通过输入`'`,根据爆出的错误信息来判断 联合 ``` product.jsp?id=' UNION SELECT banner FROM v$version -- ``` 联合查询: ``` ?id=' UNION (SELECT banner FROM v$version) -- ``` ###### SQL Server | 方法名 | Payload | | --- | --- | | 延时注入 | `page.asp?id=';WAITFOR DELAY '00:00:10'; --` | | 默认变量 | `page.asp?id=sql'; SELECT @@SERVERNAME --` | | 触发错误有可能会报出DBMS类型 | `page.asp?id=0/@@SERVERNAME` | ###### Access 1.报错信息 在注入点上加入`'`,返回错误信息中,如果是`Microsoft JET Database Engine错误'80040e14'`的话,则说明网站所用的数据库是Access数据库。 2.逻辑差异 利用SQL和ACCESS的系统表的结构,如下 ``` http://wwww.***.com?id=1 and (select count(*) from sysobjects)>0 //sysobjects 是SQL表 http://www.***.com/id=1 and (select count(*) from msysobjects)>0//msysobjects 是access ``` 如果加`sysobjects`的`SQL`语句后,网页显示正常, 加`sysobject`的`SQL`语句后,网站显示不正常,则说明用的是`SQLServer`数据库。 如果加`sysobjects`和加`msysobjects`的`SQL`语句后,网页显示都不正常,或者加`msysobject`后的网页显示正常,则说明是`ACCESS`数据库。 3.对len()和chr()函数支持 如果目标数据库同时支持`len()`函数和`chr()`函数,且不支持`length()`和`char()`函数,则很可能是Access数据库。 支持`length()`和`char()`函数的很可能是MYSQL数据库 ###### 补充常用函数及SQL语句 ``` Access: asc(字符) SQLServer:unicode(字符) 作用:返回某字符的 ASCII 码 chr(数字) SQLServer:nchar(数字) 作用:与 asc 相反,根据 ASCII 码返回字符 mid(字符串,N,L) SQLServer:substring(字符串,N,L) 作用:返回字符串从 N 个字符起长度为 L 的子字符串,即 N 到 N+L 之间的字符串 abc(数字) SQLServer:abc (数字) 作用:返回数字的绝对值(在猜解汉字的时候会用到) A between B And C SQLServer:A between B And C 作用:判断 A 是否界于 B 与 C 之间 ``` ``` Mysql: version() MySQL 版本 user() 数据库用户名 database() 数据库名 @@datadir 数据库路径 @@version_compile_os 操作系统版本 hex() 把十进制转为十六进制 concat() 连接字符串 ascii() ascii编码 length() 获取长度 substring() mid() 取出字符串 group_concat() 连接一个组的所有字符串 以逗号分隔每一条数据 updatexml()、extractvalue() 用于报错注入 sleep() 休眠 猜数据库 select schema_name from information_schema.schemata 猜某库的数据表 select table_name from information_schema.tables where table_schema=’xxxxx’ 猜某表的所有列 Select column_name from information_schema.columns where table_name=’xxxxx’ 获取某列的内容 Select xx_column from xx_table 列出所有的数据库 select group_concat(schema_name) from information_schema.schemata 列出某个库当中所有的表 select group_concat(table_name) from information_schema.tables where table_schema='xxxxx' 列出当前数据库表名 select group_concat(table_name) from information_schema.tables where table_schema=DATABASE() ``` ``` Oracle 解析IP select utl_inaddr.get_host_address('google.com') from dual; 获取本机IP地址 select utl_inaddr.get_host_address from dual; 根据IP地址反向解析主机名 select utl_inaddr.get_host_name('*.*.*.*') from dual; -- 获取系统信息 select banner from v$version where rownum=1 ; -- oracle versi --获取用户信息 select user from dual; -- current user select username from user_users; -- current user select username from all_users; -- all user , the current user can see... select username from dba_users; -- all user , need pris -- 获取密码hash select name, password, astatus from sys.user$; -- password hash <=10g , need privs select name, password, spare4 from sys.user$; -- password has 11g , need privs -- 数据库 select global_name from global_name; -- current database select sys.database_name from dual; -- current database select name from v$database; -- current database name , need privs select instance_name from v$instance; -- current database name , need privs -- 模式 select distinct owner from all_tables; -- all schema -- 表 select table_name from all_tables where owner='xxx'; -- all table name -- 列 select owner,table_name,column_name from all_tab_columns where table_name='xxx'; select owner,table_name,column_name from all_tab_cols where table_name='xxx'; ``` 通过数据库特性和报错信息,基本可以确定目标数据库类型。 [参考链接](https://blog.dyboy.cn/websecurity/149.html) #### **5.3 Web容器** ``` Apache Nginx IIS Tomcat Weblogic Jboss ``` 工具: ``` 浏览器插件---Wappalyzer 指纹识别网站---https://fp.shuziguanxing.com/ [检查网站使用的 Web 技术 - 网站信息 (w3techs.com)](https://w3techs.com/sites) [lcvvvv/httpfinger: httpfinger(和风)是一款Http指纹管理工具~~~ (github.com)](https://github.com/lcvvvv/httpfinger) ``` ``` 通过`响应头`、`错误页面`等位置也可以判断web容器 ``` #### **5.4 Web服务段语言** ``` PHP JAVA Python .NET JSP ASP ASPX Node.js ``` 判断: ``` 1.查看页面后缀名 2.通过报错信息判断 3.浏览器插件---Wappalyzer 4.[检查网站使用的 Web 技术 - 网站信息 (w3techs.com)](https://w3techs.com/sites) ``` #### **5.5 Web前端语言** ``` Javascript less Typescript ``` #### **5.6 Web后端框架** ``` PHP:ThinkPHP JAVA:Struts2 Python:django、Flask Ruby:Rails ``` #### **5.7 Web前端框架** ``` JQuery Bootstrap HTML5 vue Angular React Highcharts ``` #### **5.8 网站指纹识别** ``` BugScaner:http://whatweb.bugscaner.com/look/ 云悉指纹:http://www.yunsee.cn/finger.html WhatWeb:https://whatweb.net/ 在线指纹识别:http://whatweb.bugscaner.com/look/ 潮汐指纹:http://finger.tidesec.net/ ``` ## **6.敏感目录、文件探测** ``` Git WEB-INF泄露 备份文件 配置文件 ``` ## **7.邮箱收集** ``` [Homepage | The Yellow Pages of Emails | Find That Email](https://findthat.email/) [Taonn/EmailAll: EmailAll is a powerful Email Collect tool — 一款强大的邮箱收集工具 (github.com)](https://github.com/Taonn/EmailAll) ``` ## **8.CDN检测** ``` [多个地点Ping服务器,网站测速 - 站长工具 (chinaz.com)](http://ping.chinaz.com/) [Ping查询_专业的 IP 地址库_IPIP.NET](https://tools.ipip.net/newping.php) ``` 常见CDN服务商 ``` 阿里云 腾讯云 百度云 华为云 网宿科技(ChinanNet Center) 蓝汛 金山云 UCloud 网易云 世纪互联 七牛云 京东云 CloudFlare Akamai(阿卡迈) Limelight Networks(简称LLNW) AWS Cloud(亚马逊) Google(谷歌) Comcast(康卡斯特) ``` ``` 1.如果是多个IP基本是使用了cdn,使用IP去每家cdn服务商检测,查看是否是某家cdn 2.ping域名,看CHAME解析的域名属于哪家cdn服务商 3.nslookup使用不同dns解析,如果解析不一样,可能使用了cdn ``` ## **9.源站IP查找** ``` 1.查询子域名的解析,可能指向源站 2.查询历史DNS记录 [DNSDB](https://www.dnsdb.io/zh-cn/) [ViewDNS.info - Your one source for DNS related tools!](https://viewdns.info/) [域名查iP 域名解析 iP查询网站 iP反查域名 iP反查网站 同一iP网站 同iP网站域名iP查询 (ip138.com)](https://site.ip138.com/) 3.根据邮箱信息查找邮件服务器,很可能是源站 4.通过网站泄露的信息(phpinfo、github源码等) 5.shodan、FOFA、zoomeye、hunter等搜索域名查找 6.如果网站有app,可以抓包查看是否是源IP ``` ## **10.密码生成** ``` 根据域名、公司名生成密码字典 https://github.com/ort4u/PwdBUD [cityofEmbera/CPassword: 社工密码生成 (github.com)](https://github.com/cityofEmbera/CPassword) https://github.com/zgjx6/SocialEngineeringDictionaryGenerator ``` ## **11.Waf探测** ``` [EnableSecurity/wafw00f: WAFW00F allows one to identify and fingerprint Web Application Firewall (WAF) products protecting a website. (github.com)](https://github.com/EnableSecurity/wafw00f) [CSecGroup/wafid:Wafid 识别和指纹 Web 应用程序防火墙 (WAF) 产品。 (github.com)](https://github.com/CSecGroup/wafid) ``` ##### 常见WAF拦截页面 360  d盾  UPUPW安全  阿里云盾  安恒明御WAF  百度云  宝塔  创宇盾  护卫神  华为云  奇安信安域  奇安信网站卫士  腾讯云  腾讯宙斯盾  网防G01  网宿云  安全狗  西数WTS-WAF  玄武盾  铱讯WAF  云锁  长亭SafeLine  智创防火墙  Last modification:April 23, 2022 © Allow specification reprint Support Appreciate the author Like 1 如果觉得我的文章对你有用,请随意赞赏
4 comments
你的博客还支持显示FPS!
OωO