小白的信息搜集

好好写一下信息收集

一、主机发现

nmap

安装系统及命令:
Mac os: brew install nmap
Centos: yum install nmap
Ubuntu: apt一get install nmap
扫描方式
常见的七种扫描方式:
ТСР: -sT
SYN: -sS
ACK: -sA
UDP: -sU
RPC: -sR
ICMP: -sP
Disable Port Scan: -sn

具体参数 直接上图
在这里插入图片描述

Masscan

项目地址:https://github.com/robertdavidgraham/masscan

安装:
$ sudo apt-get install git gcc make libpcap一dev
$ git clone https://github. com/ rober tdavidgr aham/ masscan
$ cd masscan
$ make

该工具兼容Nmap的参数高级选项

采用了异步传输方式,无状态的扫描方式 巨快

命令:
sudo masscan --ports 1-10000 192.168.86.166 --adapter-ip 192.168.86.136
-adapter-ip 指定发包的IP地址
-adapter-port 指定发包的源端口
-adapter-mac 指定发包的源MAC地址
-router-mac 指定网关的MAC地址
-exclude IP地址范围黑名单,防止masscan扫描
-excludefile 指定IP地址范围黑名单文件
-includefile,-iL 读取一个范围列表进行扫描
-wait 指定发送完包之后的等待时间,默认为10
命令:
masscan -e eth0 -p 1-65535 --rate 1000 192.168.86.166
//在网络环境慢的情况下,快速扫描出存在端口与nmap配合

Nbtscan

Nbtscan
kali系统自带nbtscan,以及查看帮助说明

root@localhost:~# nbtscan                                                    

NBTscan version 1.6.
This is a free software and it comes with absolutely no warranty.
You can use, distribute and modify it under terms of GNU GPL 2+.

Usage:
nbtscan [-v] [-d] [-e] [-l] [-t timeout] [-b bandwidth] [-r] [-q] [-s separator] [-m retransmits] (-f filename)|(<scan_range>) 
	-v		verbose output. Print all names received
			from each host
	-d		dump packets. Print whole packet contents.
	-e		Format output in /etc/hosts format.
	-l		Format output in lmhosts format.
			Cannot be used with -v, -s or -h options.
	-t timeout	wait timeout milliseconds for response.
			Default 1000.
	-b bandwidth	Output throttling. Slow down output
			so that it uses no more that bandwidth bps.
			Useful on slow links, so that ougoing queries
			don't get dropped.
	-r		use local port 137 for scans. Win95 boxes
			respond to this only.
			You need to be root to use this option on Unix.
	-q		Suppress banners and error messages,
	-s separator	Script-friendly output. Don't print
			column and record headers, separate fields with separator.
	-h		Print human-readable names for services.
			Can only be used with -v option.
	-m retransmits	Number of retransmits. Default 0.
	-f filename	Take IP addresses to scan from file filename.
			-f - makes nbtscan take IP addresses from stdin.
	<scan_range>	what to scan. Can either be single IP
			like 192.168.1.1 or
			range of addresses in one of two forms: 
			xxx.xxx.xxx.xxx/xx or xxx.xxx.xxx.xxx-xxx.
Examples:
	nbtscan -r 192.168.1.0/24
		Scans the whole C-class network.
	nbtscan 192.168.1.25-137
		Scans a range from 192.168.1.25 to 192.168.1.137
	nbtscan -v -s : 192.168.1.0/24
		Scans C-class network. Prints results in script-friendly
		format using colon as field separator.
		Produces output like that:
		192.168.0.1:NT_SERVER:00U
		192.168.0.1:MY_DOMAIN:00G
		192.168.0.1:ADMINISTRATOR:03U
		192.168.0.2:OTHER_BOX:00U
		...
	nbtscan -f iplist
		Scans IP addresses specified in file iplist.
  • nbtscan扫描可以发现主机名、MAC addr等信息…
nbtscan -r 192.168.1.0/24
  • 扫描整个C段
nbtscan 192.168.1.1-100
  • 扫描一个范围(以:分割显示结果)
nbtscan -v -s : 192.168.1.0/24

hping3

hping3主要测试防火墙的拦截规则,对网络设备进行测试

常用模式
-0 -rawip IP原始报文
-1 -icmp ICMP模式
-2 -udp UDP模式
-8 -scan 扫描模式
-9 -listen 监听模式

二、关联信息生成

字典生成:pydictor

安装:

git clone https://github.com/LandGrey/pydictor

在这里插入图片描述

生成字典

python pydictor.py --sedb
set cname liwei
set sname lw Lwei
set ename zwell
set birth 19880916
set usedpwd liwei123456. liwei@19880916 lw19880916_123
set phone 18852006666
set uphone 15500998080
set hphone 76500100 61599000 01061599000
set email 33125500@qq.com
set email 13561207878@163.com
set email weiweili@gmail.com
set email wei010wei@hotmail.com
set postcode 663321 962210
set nickname zlili
set idcard 152726198809160571
set jobnum 20051230 100563
set otherdate 19591004 19621012
set otherdate 19870906 19880208
set usedchar tiger gof gamesthrones 176003 m0n5ter ppdog

常用的组合命令:

//合并去重

python pydictor.py -tool uniqbiner /my/all/dict/
多字典文件组合工具

python pydictor.py -tool hybrider heads.txt some_others.txt tails.txt

参考详细:https://github.com/LandGrey/pydictor/blob/master/docs/doc/usage.md

三、开放漏洞情报

常用网站

CVE:https://cve.mitre.org/
Exploit-DB:https://www.exploit-db.com/
CX Security:https://cxsecurity.com/
CNVD:https://www.cnvd.org.cn/
securitytracker:https://www.securitytracker.com/

Searchsploit

在这里插入图片描述

四、开源情报信息搜集(OSINT)

搜索引擎语法
百度:https://www.baidu.com
谷歌:https://www.google.com
必应:https://cn.bing.com

在线接口

http://ce.baidu.com/index/getrelatedsites?site_address=baidu.com
http://www.webscan.cc/
http://sbd.ximcx.cn/  --在线子域名查询-接口光速版
https://censys.io/certificates?q=.example.com
https://crt.sh/?q=%25.example.com
https://github.com/c0ny1/workscripts/tree/master/get-subdomain-from-baidu
https://dnsdumpster.com/  --查询DNS记录、侦查、研究
https://www.threatcrowd.org/searchApi/v2/domain/report/?domain=baidu.com  --和第一个一样
https://findsubdomains.com/
https://dnslytics.com/search?g=www.baidu.com   --DNSlyrics
https://pentest-tools.com/information-gathering/find-subdomains-of-domain   --DNS攻击面2次免费
https://viewdns.info/   --功能很多
https://www.ipneighbour.com/#/lookup/114.114.114.114      --邻居发现
https://securitytrails.com/list/apex_domain/baidu.com
https://url.fht.im/
http://api.hackertarget.com/hostsearch/?q=baidu.com
http://www.yunsee.cn/finger.html     --云悉(限制挺大)

相关工具

https://github.com/rshipp/awesome-malware-analysis/blob/master/恶意软件分析大合集.md

这个 确实棒 学到很多 推荐

五、谷歌语法

用法

Intitle 			包含标题 
Intext  			包含内容 
filetype 			文件类型 
Info 				基本信息 
site 				指定网站 
inurl 				包含某个url
link 				包含指定链接的网页 
cache 				显示页面的缓存版本
numberange			搜索一个数字

六、内网渗透之信息收集

Windows(工作者和域)

  • 检查当前shell权限
whoami /user & whoami /priv
  • 查看系统信息
systeminfo
//任务:收集信息主机名->扮演角色
  • Tcp/udp 网络连接状态信息
netstat -ano
//任务:获取内网IP分布状态-服务(redis)
  • 查看机器名
hostname
  • 查看当前操作系统
wmic OS get Caption,CSDVersion,OSArchitecture,Version 
ver
  • 查杀软
WMIC	/Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List
  • 查看当前安装的程序
wmic product get name,version
  • 查看在线用户
quser   							windwos7命令
net config workstation				windwos10命令/查看当前域
  • 查看网络配置
ipconfig /all
注意:有 Primary Dns Suff就说明是域内空的则当前机器应该在工作组
  • 查看进程
tasklist /v
注意:有些进程可能是域用户启的->通过管理员权限凭证窃取->窃取域用户的凭证
  • 查看当前登陆域
net config workstation
  • 远程桌面链接历史记录
cmdkey /l
注意:可以把凭证取下来->本地密码
  • 查看本机上的用户账户列表
net user 
  • 查看本机用户xx的信息
net user xxx
  • 查看本机用户xxx的信息
net user /domain 				显示所在域的用户名单
net user 域用户 /domain			获取某个域用户的详细信息 
net user /domain xxx 12345678 	修改域用户密码,需要域管理员权限

Linux

  • 查看当前权限
whoami
  • 查看网卡配置
ifconfig
  • 查看端口状态(开启了哪些服务,内网IP连接等
netstat -anpt
  • 查看进程状态(开启了哪些服务等)
ps -ef
  • 查看管理员的历史输入命令(获取密码,网站目录,内网资产等信息)
cat /root/.bash_history
  • 查找某个文件(寻找配置文件等)
find / -name *.cfg

七、wmic命令的一些使用方法

前言

wmic和cmd一样在所有的windows版本中都存在

但是wmic有很多cmd下不方便使用的部分

关于wmic

WMI命令行(WMIC)实用程序为WMI提供了命令行界面。WMIC与现有的Shell和实用程序命令兼容。在WMIC出现之前,如果要管理WMI系统,必须使用一些专门的WMI应用,例如SMS,或者使用WMI的脚本编程API,或者使用象CIM Studio之类的工具。如果不熟悉C++之类的编程语言或VBScript之类的脚本语言,或者不掌握WMI名称空间的基本知识,要用WMI管理系统是很困难的,WMIC改变了这种情况

wmic的简单使用

以win7的靶机进行演示

在cmd命令行输入wmic进入交互式页面

  • 查看WMIC命令的全局选项以及命令属性等
/?				
  • 进程管理的帮助
process /?		
  • 属性获取操作帮助
process get /?   

根据实际的需要去对相关的信息进行读取

以属性进程为例展现wmic的使用

查看进程

process get caption,executablepath,processid
  • 获取系统当前正在运行的进程等信息
wmic service where (state="running") get name ,processid ,pathname ,startmode ,caption
  • 查看服务进程详细信息
wmic /namespace:\\root\securitycenter2 path antivirusproduct GET displayName,productState, pathToSignedProductExe
  • 查看安装的杀软进程运行情况
wmic onboarddevice get Description, DeviceType, Enabled, Status /format:list
  • 查看存在状态
wmic product get name
  • 系统安装软件情况
wmic environment get Description, VariableValue
  • 系统环境变量
wmic computersystem get Name, Domain, Manufacturer, Model, Username, Roles/format:list
wmic sysdriver get Caption, Name, PathName, ServiceType, State, Status /format:list

更多信息看这里:https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/wmic

八、内网横向常见端口

Port. 445

SMB( Server Message Block) Windows协议族,主要功能为文件打印共享服务,简单来讲就是共享文件夹

该端口也是近年来内网横向扩展中比较火的端口,大名鼎鼎的永恒之蓝漏洞就是利用该端口,操作为扫描其是否存在MS17-010漏洞。正常情况下,其命令主要是建立IPC服务中

空会话

net use \\192.168.1.x
远程本地认证

net use \\192.168.1.2 /user:a\username password

注:a/username 中 a 为工作组情况下的机器命名,可以为任意字符,例如work/username

域 test.local 远程认证

net use \\192.168.1.2 /user:test\username password

Port:137、138、139

NetBios端口,137、138为UDP端口,主要用于内网传输文件,而NetBios/SMB服务的获取主要是通过139端口

Port: 135

该端口主要使用DCOMRPC(Remote Procedure Call)服务,我们利用这个端口主要做WMI(Windows Management Instrumentation)管理工具的远程操作

使用时需要开启wmic服务!!

几乎所有的命令都是管理员权限
如果出现 "Invalid Globa| Switch",需要使用双引号把该加的地方都加上 
远程系统的本地安全策略的“网络访问:本地帐户的共享和安全模式"应设为“经典-本地用户以自己的身份验证"
防火墙最好是关闭状态

该端口还可以验证是否开启 Exchange Servert

Port: 53

该端口为DNS服务端口,只要提供域名解析服务使用,该端口在渗透过程中可以寻找一下DNS域传送漏洞,在内网中可以使用DNS协议进行通信传输,隐蔽性更加好
参考文章 :

dns隧道之dns2tcp

https://blog.csdn.net/gsls200808/article/details/50318947
https://blog.csdn.net/deng_xj/article/details/88834124

dns隧道之unseat2

https://www.cnblogs.com/bonelee/p/7927706.html
https://blog.csdn.net/ddr12231/article/details/102306989

Port: 389

用于LADP(轻量级目录访问协议),属于TCP/IP协议,在域过程中一般出现在域控上出现该端口,进行权限认证服务,如果拥有对该域的用户,且担心net或者其他爆破方法不可行的情况,可以尝试使用LADP端口进行爆破

工具可以使用类似于hydra等开源项目

Port: 88

该端口主要开启Kerberos服务,属于TCP/IP协议,主要任务是监听KDC的票据请求,该协议在渗透过程中可以进行黄金票据和白银票据的伪造,以横向扩展某些服务

Port: 5985

该端口主要介绍WinRM服务,WinRM是Windows对WS-Management的实现,WinRM允许远程用户使用工具和脚本对Windows服务器进行管理并获取数据。并且WinRM服务自Windows Vista开始成为Windows的默认组件

条件:
Windows Vista上必须手动启动,而Windows Server 2008 中服务是默认开启的 
服务在后台开启,但是端口还没有开启监听,所以需要开启端口 
使用 winrm quickconfig 对winRM进行配置,开启HTTP和HTTPSS监听,且需要开启防火墙
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值