渗透测试信息收集

渗透测试信息收集

本地工作组信息

主要还是一些对命令及参数的使用,尤其像tasklist,net,wmic、route等等等等

查看当前权限

whoami

本机网络配置信息

ipconfig /all

操作系统和版本信息(英文/中文)

systeminfo
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本"

查看系统所有环境变量

set

Tasklist命令详解
Windows 进程 Tasklist查看 与 Taskkill结束
查询进程列表

tasklist /v

结束进程

taskkill /PID xxx   //xxx 为进程PID的值

DOS命令中schtasks命令的简单使用
查看计划任务

schtasks /query /fo LIST /v

DOS的net命令详解
cmd net命令详解与图片示意
查看主机工作统计数据

net statistics workstation

查询用户列表

net user
net user lenovo //查看指定用户的信息

查看本地管理员用户

net localgroup administrators

列出或断开本地计算机和连接的客户端的会话

net session

查看本机共享

net share

netstat详解
查看端口列表

netstat –ano

查询路由表

route print

比CMD更强大的命令行:WMIC后渗透利用(系统命令)

查看安装的软件及版本和路径等信息

wmic product get name,version

查询本机服务信息

wmic service list brief

wmic 查看进程信息

wmic process list brief

查看启动程序信息

wmic startup get command,caption

使用 wmic 查看补丁列表

wmic qfe get Caption,Description,HotFixID,InstalledOn

使用 wmic 查看共享列表

wmic share get name,path,status

参考【建议收藏】历时一年的内网学习笔记合集

域内信息收集

判断是否存在域
ip信息
ipconfig /all

查看网关 IP 地址、DNS 的 IP 地址、域名、本机是否和 DNS 服务器处于同一网段。

存在域的
接着使用 nslookup 解析域名的 IP 地址,查看是否与 DNS 服务器为同一 IP

nslookup teamssix.com
系统详细信息
systeminfo
systeminfo | findstr 域:

在这里插入图片描述

当前登录域与域用户
net config workstation
net config workstation | findstr 域

在这里插入图片描述

判断主域
net time /domain
域内信息

查看域

net view /domain

查看域内计算机

net view /domain:domain_name

查看域内用户组列表

net group /domain

查看域密码策略信息

net accounts /domain

查询域用户列表

net user /domain

查询存在的用户

dsquery user

常用的 dsquery 命令

dsquery computer - 查找目录中的计算机
dsquery contact - 查找目录中的联系人
dsquery subnet - 查找目录中的子网
dsquery group - 查找目录中的组
dsquery ou - 查找目录中的组织单位
dsquery site - 查找目录中的站点
dsquery server - 查找目录中的域控制器
dsquery user - 查找目录中的用户
dsquery quota - 查找目录中的配额
dsquery partition - 查找目录中的分区
dsquery * - 用通用的 LDAP 查询查找目录中的任何对象

最后附上导图一张
在这里插入图片描述

搜索引擎

Google

基本检索

逻辑与: and
逻辑或: or
逻辑非: -
完整匹配: “关键词”
通配符: * ?
* ?    // 模糊匹配搜索
~ 		// 此关键词和它的同义词
"CTF"
*CT*
+		// 逻辑与,A与B
|		// 逻辑或,A或B

image-20211008202341700

关键字

字符注释
intext寻找正文中含有关键字的网页
intitle寻找标题中含有关键字的网页
allintitle用法和intitle类似,只不过可以指定多个词
inurl将返回url中含有关键词的网页
allinurl用法和inurl类似,只不过可以指定多个词,// 所有关键词必须出现在在文本中
site指定访问的站点
filetype指定访问的文件类型
cache显示页面的缓存版本
Index of

image-20211008122457158

image-20211008124817591

image-20211008124854226

image-20211008204136331

allintitle:搜索返回的是页面标题中包含多组关键词的文件。
例如:allintitle:头条号 今日头条
就相当于:
intitle:头条号 intitle:今日头条

image-20211008125051994

实例

filetype:pdf +"身份证号" +site:"edu.cn"
inurl:login|admin|manage|member|admin_login|login_admin|system|login|user|main|cms +site:"edu.cn"
site:"edu.cn" filetype:conf
site:"edu.cn" filetype:properties -Repository
site:edu.cn inurl:log 
site:edu.cn +inurl:/fckeditor/

site: edu.cn intitle:”index of /”
site: edu.cn inurl:admin(login、manage、system、console)
site:edu.cn intext:管理|后台|登陆|用户名|密码|验证码|系统|帐号|admin|login|sys|managetem|password|username
存在的数据库:site:域名 filetype:mdb|asp|#
查看脚本类型:site:域名 filetype:asp/aspx/php/jsp
迂回策略入侵:inurl:cms/data/templates/images/index/

image-20211008205129987

image-20211008205226968

image-20211008205413772

intitle:"index of" etc

intitle:"Index of" .sh_history

intitle:"Index of" .bash_history

intitle:"index of" passwd

intitle:"index of" people.lst

intitle:"index of" pwd.db

intitle:"index of" etc/shadow

intitle:"index of" spwd

intitle:"index of" master.passwd

intitle:"index of" htpasswd

在线google dork

https://pentest-tools.com/information-gathering/google-hacking#

google配合github

Google
site:Github.com smtp
site:Github.com smtp @qq.com
site:Github.com smtp @163.com
site:Github.com smtp password
site:Github.com String password smtp
...
我们也可以锁定域名搜索结合厂商域名 灵活运用例如搜百度的

site:Github.com smtp @baidu.com
site:Github.com svn
site:Github.com svn username
site:Github.com svn password
site:Github.com svn username password
...
site:Github.com sa password
site:Github.com root password
site:Github.com User ID=’sa’;Password

image-20211106164501310

子域名搜集

site:"*.nuc.edu.cn"
搜索文件
filetype:doc
搜索后台
intitle:管理
搜索组件
inurl:load

baidu

大致相同

精确匹配
《》 ""

bing

大致相同

inbody
intitle//不好用
language//指定语言
url://搜索url
filetype

sougou

微信搜索

https://weixin.sogou.com/

知乎搜索

https://zhihu.sogou.com/

空间搜索引擎

fofa

type=service搜索所有协议资产,支持subdomain和service两种
os=“centos”搜索CentOS资产。
server==“Microsoft-IIS/10”搜索IIS 10服务器。
title=“beijing”网页标题
header=“elastic”从http头中搜索“elastic”
body="网络空间测绘"网页返回的内容
fid=“kIlUsGZ8pT6AtgKSKD63iw==”查找相同的网站指纹
domain=“qq.com”
icp=“京ICP证030173号”网络服务提供商
js_name=“js/jquery.js”js的名字
js_md5="82ac3f14327a8b7ba49baa208d4eaa15"js的md5
icon_hash="-247388890"iconhash
host=".gov.cn"从url中搜索”.gov.cn”
port=“6379”端口
ip=“1.1.1.1”具体某个ip
ip="220.181.111.1/24"ip支持无分类
status_code=“402”服务器状态
protocol=“quic”协议
region=“Xinjiang”区域
city=“Ürümqi”城市
cert.subject=“Oracle Corporation”搜索证书持有者是Oracle Corporation的资产
cert.issuer=“DigiCert”搜索证书颁发者为DigiCert Inc的资产
cert.is_valid=true证书是否有效
cert="baidu"域名证书
country=“CN”国家
banner=users && protocol=ftp搜索FTP协议中带有users文本的资产。
app=“Microsoft-Exchange”应用,https://fofa.so/library 应用表
after=“2017” && before=“2017-10-01”日期
base_protocol=“udp”指定UDP协议
org=“LLC Baxet”搜索组织

zoomeyes

优点:会有现有漏洞分类

工具 kunyu

https://www.zoomeye.org/

白嫖关键字:

https://www.zoomeye.org/component
filehash:“0b5ce08db7fb8fffe4e14d05588d49d9”
通过上传方式进行查询,根据解析的文件数据搜索相关内容的资产
搜索包含“Gitlab”解析的相关资产
iconhash:“f3418a443e7d841097c714d69ec4bcb8”
通过 md5 方式对目标数据进行解析,根据图标搜索相关内容的资产
搜索包含“google”图标的相关资产
iconhash:“1941681276”
通过 mmh3 方式对目标数据进行解析,根据图标搜索相关内容的资产
搜索包含“amazon”图标的相关资产
after:“2020-01-01”
搜索更新时间为"2020-01-01"以后的资产
after与before常常配合使用
before:“2020-01-01”
搜索更新时间在"2020-01-01"以前的资产
after与before常常配合使用
org:“北京大学” 或者organization:“北京大学”
搜索相关组织(Organization)的资产
常常用来定位大学、结构、大型互联网公司对应IP资产
[isp:“China Mobile”](https://www.zoomeye.org/searchResult?q=isp:“China Mobile”)
搜索相关网络服务提供商的资产
可结合org数据相互补充
asn:42893
搜索对应ASN(Autonomous system number)自治系统编号相关IP资产
port:80
搜索相关端口资产
目前不支持同时开放多端口目标搜索
hostname:google.com
搜索相关IP"主机名"的资产
site:baidu.com
搜索域名相关的资产
常常使用来搜索子域名匹配
cidr:52.2.254.36/24
搜索IP的C段资产
cidr:52.2.254.36/16 为IP的B段资产 cidr:52.2.254.36/8 为IP的A段资产,如cidr:52.2.254.36/16cidr:52.2.254.36/8
ssl:“google”
搜索ssl证书存在"google"字符串的资产
hostname:google.com
搜索相关IP"主机名"的资产
site:baidu.com
搜索域名相关的资产
常常使用来搜索子域名匹配
title:“Cisco”
搜索html内容里标题中存在"Cisco"的数据

举例

site:"*.edu.cn" +org:"China Education and Research Network Center"
hostname:"edu.cn.*" +isp:"CHINAEDU"
organization:"* University"
organization:"CERNET2 IX at Southeast University"
organization:"*CERNET"
organization:"北京大学"

shodan

优点:搜索网络硬件比较方便

缺点:不支持无分类子网

shodan filter 官网

https://beta.shodan.io/search/filters

image-20211009194348748

http.component
http.component_category
常用http.favicon.hash
http.html
http.html_hash
http.robots_hash
http.securitytxt
http.status
http.title
http.waf

证书

ssl
ssl.alpn
ssl.cert.alg
ssl.cert.expired
ssl.cert.extension
ssl.cert.fingerprint
ssl.cert.issuer.cn
ssl.cert.pubkey.bits
ssl.cert.pubkey.type
ssl.cert.serial
ssl.cert.subject.cn
ssl.chain_count
ssl.cipher.bits
ssl.cipher.name
ssl.cipher.version
ssl.ja3s
ssl.jarm
ssl.version

常用

all
asn
city
country
cpe
device
geo
has_ipv6
has_screenshot
has_ssl
has_vuln
hash
hostname
ip
isp
link
net
org
os
port
postal
product
region
scan
shodan.module
state
version

示例

org:"China Education and Research Network"

image-20211009195619880

image-20211009195823037

image-20211009210546993

vuln为高级用户 api专用
http://hamal.cc/2018/04/Shodan%E6%89%B9%E9%87%8F%E8%87%AA%E5%8A%A8%E5%8C%96/

git clone https://github.com.cnpmjs.org/achillean/shodan-python.git
cd shodan-python
python setup.py install
jenkins
"X-Jenkins" "Set-Cookie: JSESSIONID" http.title:"Dashboard"
docker api
"Docker Containers:" port:2375
匿名FTP
220" "230 Login successful." port:21
更多详见
https://github.com/jakejarvis/awesome-shodan-queries

域名IP

域名IP信息搜集

企查查

https://www.qcc.com/

爱企查

https://aiqicha.baidu.com/

天眼查

https://www.tianyancha.com/

小蓝本

https://www.xiaolanben.com/

企信宝

https://www.qixin.com/

ICP备案

https://icp.chinaz.com/

微步在线

https://x.threatbook.cn/

国内 纯真

https://www.cz88.net/

ipip.net

国外 maxmind

https://www.maxmind.com/en/home

找不到真实IP怎么办

子域名寻找
多地ping

https://www.ping.cn/d

F5-Bigip session

一般获取内网ip

https://www.secpulse.com/archives/58730.html

#!/usr/bin/env python
# example string: 110536896.20480.0000
import struct
import sys
if len(sys.argv) != 2:
    print "Usage: %s encoded_string" % sys.argv[0]
    exit(1)
encoded_string = sys.argv[1]
print "\n[*] String to decode: %s\n" % encoded_string
(host, port, end) = encoded_string.split('.')
(a, b, c, d) = [ord(i) for i in struct.pack("<I", int(host))]
(e) = [ord(e) for e in struct.pack("<H", int(port))]
port = "0x%02X%02X" % (e[0],e[1])
print a,b,c,d,int(port,16)

子域名信息搜集

FUZZ字典

每月更新,不论子域名 还是是api还是swagger,还是每层目录,以及js,js参数的爆破

https://wordlists.assetnote.io/

oneforall

python3 oneforall.py -target www.nuc.edu.cn run

官网有详细的讲解过程

https://github.com/shmilylty/OneForAll

这里我们可以申请很多api

https://github.com/shmilylty/OneForAll/blob/master/docs/collection_modules.md

layer挖掘机

比较吃性能

image-20211022175328557

网站信息收集

目录信息

dirsearch

https://github.com/maurosoria/dirsearch

image-20211022190416884

御剑

不解释

image-20211022211558674

JS信息搜集

JSFinder:

  • https://github.com/Threezh1/JSFinder
  • 基于TamperMonkey的版本:https://github.com/Threezh1/Deconstruct/blob/main/DevTools_JSFinder/JSFinder.js

APP 信息搜集

常用frida进行测试

快速提取app中的资产信息:https://github.com/kelvinBen/AppInfoScanner

为场景的移动端(Android、iOS、WEB、H5、静态网站)信息收集扫描工具

apkanalyze

https://github.com/TheKingOfDuck/ApkAnalyser

CMS信息搜集

云悉

https://www.yunsee.cn/

其他finger 或者棱镜也可以

https://github.com/EASY233/Finger

https://github.com/EdgeSecurityTeam/EHole

微信小程序信息搜集

CrackMinApp

/data/data/com.tencent.mm/MicroMsg/.../appbrand/pkg/

小程序路径

小程序渗透-修炼五脉

https://cloud.tencent.com/developer/column/90188

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值