【Penetration testing】Information collection and summary

foreword

I have published a lot of articles here and there, but I haven't given a complete summary. Today, I will start with information collection and summarize systematically. On the one hand, it can consolidate one's own foundation and serve as one's own dictionary for easy reference. On the other hand, it hopes to help everyone in their study and work. According to this process, the information collection can basically be completed relatively completely. There are some places that I haven’t used myself, and then I learned from other master’s articles, thank you. I will mark the most commonly used methods and websites below in red.


Subdomain collection

Online Site Collection

Collecting sub-domain names can expand the scope of penetration and obtain more information about the assets of the target company . The second-level domain names under the same domain name belong to the target range . The form of expression: domain name plus prefix, for example: domain name zkaq.cn plus prefix, abc.zkaq. cn .

Online fingerprinting: http://whatweb.bugscaner.com/look/

Online subdomain query: https://phpinfo.me/domain

VirusTotal:https://www.virustotal.com/gui/home/search

Aizhan: http://dns.aizhan.com

dnsdumpster:https://dnsdumpster.com/

Home of the webmaster: http://tool.chinaz.com/

Second-level domain name mining: http://z.zcjun.com/

Second-level domain name mining: http://scan.javasec.cn/

Qianxin Intergraph Platform: https://hunter.qianxin.com/

whois query: https://www.aizhan.com/

Home of the webmaster: https://tool.chinaz.com/

IP reverse domain name https://site.ip138.com/XXX.XXX.XXX.XXX/

Purpose: The email, QQ, phone number, name, and domain name service provider collected above can be used to social work customers or infiltrate domain service providers, take down the domain management console, and then do domain hijacking; The social work library finds out whether there is a leaked password and searches for information such as social accounts through search engines, constructs a password dictionary through information obtained through social and social work, and then blasts or hits mail and oa

Violent enumeration: Layer subdomain excavator, subdomainsBurte, oneforall tool

SSL certificate query: censys.io crt.sh dnsdumpster.com

SSL/TLS Security Assessment Report: https://myssl.com

SPYSE:https://spyse.com/tools/ssl-lookup

censy:https://censys.io/

Certificate Leakage: In Firefox browser, when accessing an https link, a warning window may pop up: "Warning: Facing potential security risks." Click the advanced option to view the details.

search engine lookup

FOFA( https://fofa.so/ ) title="Company Name";

domain="zkaq.cn"

Baidu ( https://www.baidu.com/s ): intitle=company name; site: zkaq.cn

Google ( https://www.google.com/ ): intitle=company name; site: zkaq.cn

Zhong Kui's Eye ( https://www.zoomeye.org/ )

site=domain name; hostname: baidu.com

shodan(https://www.shodan.io/):hostname:"baidu.com"

360 mapping space ( https://quake.360.cn/ )

:domain:"zkaq.cn"

directory file scan

Directory scanning can scan out a lot of important resources, such as directory-type sites, background, sensitive files , such as . .cn plus the suffix zkaq.cn/admin/admin.php .

Directory Scanning Tool

Yujian tools: Graphical usage.

7kbstorm工具:GitHub - 7kbstorm/7kbscan-WebPathBrute: 7kbscan-WebPathBrute Web路径暴力探测工具

dirmap工具:python3 dirmap.py -i https://bbs.zkaq.cn -lcf

dirsearch工具:python3 dirsearch.py -u https://www.zkaq.cn -e php

gobuster工具:gobuster dir -u "https://bbs.zkaq.cn" -w "/root/tools/DirBrute/dirmap/data/fuzz_mode_dir.txt" -n -e -q --wildcard

github搜索

in:name huawei #仓库标题中含有关键字huawei

in:descripton Huawei.com #仓库描述搜索含有关键字huawei

in:readme huawei #Readme文件搜素含有关键字Huawei

smtp 58.com password 3306 #搜索某些系统的密码

google搜索

密码搜索:

site:Github.com sa password

site:Github.com root password

site:Github.com User ID='sa';Password

site:Github.com inurl:sql

SVN 信息收集

site:Github.com svn

site:Github.com svn username

site:Github.com svn password

site:Github.com svn username password

svn 信息泄漏收集(svn_git_scanner,seekret(目录信息搜索),Seay SVN 漏洞利用工具)

综合信息收集

  1. site:Github.com password

  1. site:Github.com ftp ftppassword

  1. site:Github.com 密码

  1. site:Github.com 内部

路径扫描工具

文件扫描工具

DirMap

御剑

在线网站

乌云漏洞库:https://wooyun.website/

凌云搜索 https://www.lingfengyun.com/

盘搜搜:http://www.pansoso.com/

盘搜:http://www.pansou.com/

文件接口工具

1.jsfinderhttps://gitee.com/kn1fes/JSFinder

2.Packer-Fuzzer: https://github.com/rtcatc/Packer-Fuzzer

3.SecretFinder:https://gitee.com/mucn/SecretFinder

IP段信息收集

CDN检测

使用全球ping:不同的地区访问有着不同的IP,这样就确定了该域名使用了cdn了

http://ping.chinaz.com/

https://ping.aizhan.com/

https://www.17ce.com/

绕过CDN

绕过的核心还是hosts绑定,当发现ip后,可以尝试nc端口探测,也可以用nmap进行服务探测,如果像正常的服务器,就可以模糊确定是真实IP。若发现真实ip,可进行hosts绑定,绕过CDN的防御,直接发起渗透,也可以进行IP反查,通过反查的网站来渗透。

全球Ping测试,在线ping工具 - 网络工具 (wepcc.com)

FOFA 全球鹰 360Quake censys 全球DNS搜索引擎 Surfwax元搜索 Way Back Machine(搜索网站过去的样子) Google学术

C段查询,旁站查询

http://s.tool.chinaz.com/same http://www.webscan.cc FOFA语法:ip=“192.168.X.X/24”

旁站和C段

  • 旁站:同一个服务器内的站点。

  • C段:同网段,不同服务器内的站点

a.旁站查询

站长之家http://stool.chinaz.com/same

在线:https://chapangzhan.com/

搜索引擎:fofa: ip="1.1.1.0/24"

b.C段查询

1. webscanhttps://c.webscan.cc/

2. Nmap

3. msscan

端口信息收集

masscan 缺点:很吃带宽

御剑高速端口扫描工具

nmap:

指定域名查询:sudo nmap -O-Pn www.baidu.com

指定ip查询:sudo nmap -O-Pn 192.168.1.1

查询局域网的所有主机和ip,适用于前面的第一个场景:sudo nmap -O-Pn 192.168.0.0/24

端口信息及其攻击点

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

21 ftp

22 SSH

23 Telnet

80 web

80-89 web

161 SNMP

389 LDAP

443 SSL心脏滴血445 SMB

512,513,514 Rexec

873 Rsync未授权

1025,111 NFS

1433 MSSQL

1521 Oracle:(iSqlPlus Port:5560,7778)

2601,2604 zebra路由,默认密码zebra

3306 MySQL

3312/3311 kangle主机管理系统登陆

3389 远程桌面

4440 rundeck

5432 PostgreSQL

5984 CouchDB http://xxx:5984/_utils/

6082 varnish

6379 redis未授权

7001,7002 WebLogic默认弱口令,反序列

7778 Kloxo主机控制面板登录

8000-9090 都是一些常见的web端口,有些运维喜欢把管理后台开在这些非80的端口上

7001,7002 WebLogic默认弱口令,反序列

7778 Kloxo主机控制面板登录

8080 tomcat/WDCP主机管理系统,默认弱口令

8080,8089,9090 JBOSS

8161 activemq未授权访问默认用户名和密码是admin

8888 amh/LuManager 主机管理系统默认端口

9200,9300 elasticsearch

10000 Virtualmin/Webmin 服务器虚拟主机管理系统

11211 memcache未授权访问

27017,27018 Mongodb未授权访问

28017 mongodb统计页面

50000 SAP命令执行

50070,50030 hadoop默认端口未授权访问

企业信息收集

天眼查

企查查

爱企查 爱企查信息收集脚本

微信小程序信息收集姿势

(1)微信小程序搜索:公司名称、系统名称、系统相关、遍历与公司或系统相关的字样进行搜索 微信公众号

(2)小蓝本

(3)极致了

(4)西瓜数据

(5)APP资产: 点点 七麦

备案信息查询

网站备案信息是根据国家法律法规规定,由网站所有者向国家有关部门申请的备案,是国家信息产业部对网站的一种管理途径,是为了防止在网上从事非法网站经营活动,当然主要是针对国内网站。

在备案查询中我们主要关注的是:单位信息例如名称、备案编号、网站负责人、法人、电子邮箱、联系电话等。

常用的备案信息查询网站有以下几个:

ICP/IP地址/域名信息备案管理系统: http://beian.miit.gov.cn/publish/query/indexFirst.action
备案吧吧: https://www.beian88.com/
天眼查: https://www.tianyancha.com/

备案号是网站是否合法注册经营的标志,可随时到国家工业和信息化部网站备案系统上查询该ICP备案的相关详细信息。 网站www.beianbeian.com

url查邮箱

https://phonebook.cz

https://hunter.io

https://www.email-format.com/i/search

利用nmap快速捡洞和检洞

利用nmap五条指令快速捡洞和检洞:

1

2

3

4

5

系统漏洞检测:nmap --script smb-check-vulns.nse -p 192.168.1.1

数据库密码检测:nmap --script=brute 192.168.1.1

收集应用服务信息: nmap -sC 192.168.1.1

检测常见漏洞:nmap --script=vuln 192.168.1.1

检测部分应用的弱口令(负责处理鉴权证书): nmap --script=auth 192.168.1.1

waf识别

wafw00f是一个Web应用防火墙(WAF)指纹识别的工具。

下载地址:https://github.com/EnableSecurity/wafw00f

wafw00f,工作原理:

1. 发送正常的HTTP请求,然后分析响应,这可以识别出很多WAF。
2. 如果不成功,它会发送一些(可能是恶意的)HTTP请求,使用简单的逻辑推断是哪一个WAF。
3. 如果这也不成功,它会分析之前返回的响应,使用其它简单的算法猜测是否有某个WAF或者安全解决方案响应了我们的攻击。

空间搜索引擎

fofa

1

2

3

4

5

6

7

8

9

语法举例:

country="CN" 搜索中国的资产

region="Zhejiang" 搜索指定行政区的资产

city="Hangzhou" 搜索指定城市的ip资产

title="abc" 从标题中搜索abc

查询条件连接:&&

eg:

查询所属城市为杭州、标题为后台登录的页面

city="Hangzhou"&&title="后台登录"

Google hacking语法扩展

site , filetype ,inurl , intitle , intext , 符号

site:

1

2

3

4

5

6

功能: 搜索指定的域名的网页内容,可以用来搜索子域名、跟此域名相关的内容。

示例:

site:zhihu.com 搜索跟zhihu.com相关的网页

"web安全" site:zhihu.com 搜索zhihu.com跟web安全相关的网页

"sql注入" site:csdn.netcsdn.net搜索跟sql注入相关的内容

"教程" site:pan.baidu.com 在百度盘中搜索教程

filetype:

1

2

3

4

5

6

功能: 搜索指定文件类型

示例:

"web安全" filetype:pdf 搜索跟安全书籍相关的pdf文件

nmap filetype:ppt 搜索跟nmap相关的ppt文件

site:csdn.net filetype:pdf 搜索csdn网站中的pdf文件

filetype:pdf site:www.51cto.com 搜索51cto的pdf文件

inurl:

1

2

3

4

5

6

7

8

功能: 搜索url网址存在特定关键字的网页,可以用来搜寻有注入点的网站

示例:

inurl:.php?id= 搜索网址中有"php?id"的网页

inurl:view.php=? 搜索网址中有"view.php="的网页

inurl:.jsp?id= 搜索网址中有"jsp?id"的网页

inurl:.asp?id= 搜索网址中有"asp?id"的网页

inurl: /admin/login.php 搜索网址中有"/admin/login.php"的网页

inurl:login 搜索网址中有"login"等登录网页

intitle:

1

2

3

4

5

6

7

8

9

功能: 搜索标题存在特定关键字的网页

示例:

intitle:后台登录 搜索网页标题是“后台登录”的相关网页

intitle:后台管理 filetype:php 搜索网页标题是“后台管理”的php页面

intitle:index of "keyword" 搜索此关键字相关的索引目录信息

intitle:index of "parent directory" 搜索根目录相关的索引目录信息

intitle:index of "password" 搜索密码相关的索引目录信息

intitle:index of "login" 搜索登录页面信息

intitle:index of "admin" 搜索后台管理页面信息

intext:

1

2

3

4

5

6

功能: 搜索正文存在特定关键字的网页

示例:

intext:Powered by Discuz 搜索Discuz论坛相关的页面

intext:powered by wordpress 搜索wordpress制作的博客网址

intext:Powered by *CMS 搜索*CMS相关的页面

intext:powered by xxx inurl:login 搜索此类网址的后台登录页面

符号:

1

2

3

-keyword 强制结果不要出现此关键字,例如:电影 -黑客

*keyword 模糊搜索,强制结果包含此关键字,例如:电影 一个叫*决定*

"keyword" 强制搜索结果出现此关键字,例如:书籍 "web安全"

示例:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

site:huoxian.cn intext:"忘记密码"

site:huoxian.cn intext:"工号"

site:huoxian.cn intext:"优秀员工"

site:huoxian.cn intext:"身份证号码"

site:huoxian.cn intext:"手机号"

site:huoxian.cn intext:"手册"

site:huoxian.cn intext:"文档"

site:huoxian.cn inurl:token (带token的也许可以未授权进入系统)

可以扩散思维找一些cookie、session、jsession、userid、passwd

分析身份证的构成,身份证是前六位是区域行政编码:

site:edu.cn "450000" +sfz

报告类的

site:edu.cn "审计报告" "SFZH" filetype:pdf

site:edu.cn"财务报告" "SFZH" filetype:pdf

奖金类的:

site:edu.cn "科技奖" "SFZH" filetype:pdf

site:edu.cn "专利发明" "SFZH" filetype:pdf

证书类的:

site:edu.cn "营业执照" "SFZH" filetype:pdf

site:edu.cn "职称证" "SFZH" filetype:pdf

个人类:

site:edu.cn "年月.*" "聘任时间" "SFZH" filetype:pdf -学号 -准考证

site:edu.cn "破格*" "SFZH" filetype:pdf -学号 -准考证

site:edu.cn "汉*" "SFZH" filetype:pdf -学号 -准考证

合同类:

site:edu.cn "同意推荐其参评*" filetype:pdf +SFZH -学号 -准考证

site:edu.cn "*出版合同" filetype:pdf +SFZH -学号 -准考证

site:edu.cn "甲方代表*" filetype:pdf +SFZH -学号 -准考证

site:edu.cn "甲方代表人" filetype:pdf +SFZH -学号 -准考证

site:edu.cn "甲方聘请乙方" filetype:pdf +SFZH -学号 -准考证

site:edu.cn "甲方的权利和义务" filetype:pdf +SFZH -学号 -准考证

总之要多扩展一些关键字

状态码分析

1

2

3

4

5

6

7

8

200 OK //客户端请求成功,响应主题包含请求的结果

400 Bad Request //客户端请求有语法错误,不能被服务器所理解,比如url插入无效的字符

401 Unauthorized //请求未经授权,被允许之前要求进行http身份认证, WWW-Authenticate消息头说明所支持的身份验证类型

403 Forbidden //禁止所有人访问被请求的资源

404 Not Found //请求资源不存在,eg:输入了错误的 URL

405 Method not allowed //用了不支持的请求方法 如:put

503 Server Unavailable //服务器当前不能处理客户端的请求,一段时间后可能恢复正常

敏感信息收集

github,gitee,coding,gitlab语法信息收集:edu.cn password

github 源 代 码 信 息 泄 露 收集(Github_Nuggests , GitHack ,GitPrey-master以及 GitHarvester,gitscan,github 语法信息收集)

DS_Store 泄露(ds_store_exp)。

批量信息泄露扫描:bbscan(可以用小字典快速扫描网站的泄露和它的旁站网段的所有信息泄露)。

hg 源码泄漏:dvcs-ripper-master。

Metagoofil 收集敏感的文档文件

泄露

百度搜 百度网盘搜索引擎 即可

关键字举例: 关键字:XXX公司内部资料 关键字:XXX网密码

GitHub泄密: https://github.com/0xbug/Hawkeye

监控GitHub的代码库,及时发现员工托管公司代码到GitHub的行为并预警,降低代码泄露风险。

GitHub作为开源代码平台,给程序员提供了很多便利,但如果使用不当,比如将包含了账号密码、密钥等配置文件的代码上传了,导致攻击者能发现并进一步利用这些泄露的信息,就是一个典型的GitHub敏感信息泄露漏洞,再如开发人员在开发时,常常会先把源码提交到github,最后再从远程托管网站把源码pull到服务器的web目录下,如果忘记把.git文件删除,就造成此漏洞。利用.git文件恢复网站的源码,而源码里可能会有数据库的信息,详情参见:https://blog.csdn.net/qq_45521281/article/details/105767428

很多网站及系统都会使用pop3和smtp发送来邮件,不少开发者由于安全意识不足会把相关的配置文件信息也放到Github上,所以如果这时候我们动用一下Google搜索语法,就能把这些敏感信息给找出来了。

site:Github.com smtp

site:Github.com smtp @qq.com

site:Github.com smtp @126.com

site:Github.com smtp @163.com

site:Github.com smtp @sina.com.cn

……

数据库信息泄露:

site:Github.com sa password

site:Github.com root password

漏洞库

白阁文库 佩奇文库

操作系统识别

知道目标存活主机的操作系统后,可以依据操作系统来实施针对性的渗透测试。

1.TTL值:Windows(65~128),Linux/Unix(1-64),某些Unix(255)

2.nmap工具:nmap 192.168.1.1 -O

3.xprobe2工具:xprobe2 192.168.1.1

各行业常见漏洞列表

扩展阅读: 一个“登录框”引发的安全问题

1.教育行业:

通用业务模块

业务逻辑漏洞

登录

暴力破解 、 撞库 、验证码爆破和绕过 、账户权限绕过

注册

存储型xss 、 批量注册 、 任意用户注册

密码找回

重置任意用户密码、新密码劫持、短信验证码劫持、用户邮箱劫持篡改

后台管理

管理员用户密码绕过、目录遍历、下载

评论

POST注入、CSRF、存储型xss、上传漏洞、越权发布

传输过程

cookie注入、明文传输、cookie劫持

业务查询

搜索型注入、办理人信息泄露

业务办理

顶替办理、绕过业务办理流程、篡改其他办理人信息、办理人信息泄露

2.互联网行业:

通用业务模块

业务逻辑漏洞

登录

暴力破解 、 撞库 、验证码爆破和绕过 、账户权限绕过

注册

存储型xss 、 批量注册 、 任意用户注册

密码找回

重置任意用户密码、新密码劫持、短信验证码劫持、用户邮箱劫持篡改

后台管理

管理员用户密码绕过、目录遍历、下载

会员系统

用户越权访问、个人资料信息泄露、遍历

评论

POST注入、CSRF、存储型xss、上传漏洞、越权发布

传输过程

cookie注入、明文传输、cookie劫持

3.金融行业:

通用业务模块

业务逻辑漏洞

登录

暴力破解 、 撞库 、验证码爆破和绕过 、账户权限绕过

注册

存储型xss 、 批量注册 、 任意用户注册

密码找回

重置任意用户密码、新密码劫持、短信验证码劫持、用户邮箱劫持篡改

评论

POST注入、CSRF、存储型xss、上传漏洞、越权发布

会员系统

用户越权访问、个人资料信息泄露/遍历

传输过程

cookie注入、明文传输、cookie劫持

购买支付

商品金额篡改、商品数量篡改、交易信息泄露

充值

虚假充值金额、充值数量篡改、篡改充值账户

抽奖/活动

盗取活动奖品、盗刷积分、抽奖作弊

优惠卷/代金卷

批量刷优惠卷/代金卷、更改代金卷金额、更改优惠卷数量

订单

订单信息泄露、用户信息泄露、订单遍历

账户

账户绕过、账户余额盗取、账户绑定手机号绕过

4.电商行业:

通用业务模块

业务逻辑漏洞

登录

暴力破解 、 撞库 、验证码爆破和绕过 、账户权限绕过

注册

存储型xss 、 批量注册 、 任意用户注册

密码找回

重置任意用户密码、新密码劫持、短信验证码劫持、用户邮箱劫持篡改

购买支付

商品金额篡改、商品数量篡改、交易信息泄露

充值

虚假充值金额、充值数量篡改、篡改充值账户

抽奖/活动

盗取活动奖品、盗刷积分、抽奖作弊

优惠卷/代金卷

批量刷优惠卷/代金卷、更改代金卷金额、更改优惠卷数量

订单

订单信息泄露、用户信息泄露、订单遍历

账户

账户绕过、账户余额盗取、账户绑定手机号绕过

评论

POST注入、CSRF、存储型xss、上传漏洞、越权发布

会员系统

用户越权访问、个人资料信息泄露/遍历

传输过程

cookie注入、明文传输、cookie劫持

抢购活动

低价抢购、抢购作弊、刷单

运费

运费绕过、运费修改

第三方商家

盗号、商家信息泄露、商家账户遍历

5.政务行业

通用业务模块

业务逻辑漏洞

登录

暴力破解 、 撞库 、验证码爆破和绕过 、账户权限绕过

注册

存储型xss 、 批量注册 、 任意用户注册

评论

POST注入、CSRF、存储型xss、上传漏洞、越权发布

传输过程

cookie注入、明文传输、cookie劫持

密码找回

重置任意用户密码、新密码劫持、短信验证码劫持、用户邮箱劫持篡改

后台管理

管理员用户密码绕过、目录遍历/下载

业务查询

搜索型注入、办理人信息泄露

业务办理

顶替办理、绕过业务办理流程、篡改其他办理人信息、办理人信息泄露

参考文章

Guess you like

Origin blog.csdn.net/weixin_52450702/article/details/128715042
Recommended