Penetration of Intranet

Table of contents

Intranet penetration

Native Information Collection

Domain environment and non-domain environment

Some information collection commands about this machine


Intranet penetration

When the penetration test reaches the penetration stage, we have obtained the permission of the host on the public network and can access the host on the intranet through the proxy. At this time, if we want to get the permission of the intranet host, then we will start to infiltrate the intranet. So, how to start intranet penetration?

Native Information Collection

First of all, after entering the intranet, our first step is to collect information. Lincoln famously said that if I had six hours to fell a tree, I would spend three hours sharpening my axe. The amount of information collected largely determines the direction of our subsequent infiltration.

Domain environment and non-domain environment

1. Net time /domain query

The intranet is divided into domain environment and non-domain environment, so how to check whether the current host is in the domain environment?

net time /domain

Execute this statement, and the domain user in the domain environment will display that the query is successful and the domain name of the domain is attached. A local user query in a domain environment will show Access Denied. A workgroup environment query would show that no domain controllers were found.

2. ipconfig /all query

ipconfig /all

The primary DNS suffix of the workgroup environment is empty, and the primary DNS suffix of the domain environment query is the domain name.

3: systeminfo query 

systeminfo

In the workgroup environment, the systeminfo query domain is WORKGROUP, and in the domain environment, the domain query is the domain name.

Some information collection commands about this machine

For this machine is a Windows system

systeminfo                                                #查看系统信息      
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"      #查看系统及版本,英文系统      
systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本"          #查看系统及版本,中文系统      
echo %PROCESSOR_ARCHITECTURE%                             #查看系统架构,一般为AMD64      
set                                                       #查看系统环境变量      
wmic qfe get Caption,Description,HotFixID,InstalledOn     #查看系统补丁信息      
wmic bios                                                 #查看bios信息      
nbtstat -A ip                                             #netbios查询      
fsutil fsinfo drives                                      #查看所有的盘符      
gpupdate /force                                           #更新计算机策略       
安装的软件版本信息      
wmic product get name,version                             #查看安装的软件及版本      
powershell "get-wmiobject -class Win32_product | select-Object -property name,version"   #查看安装的软件及版本       
网络      
ipconfig /all                                             #查看ip详细信息      
route print                                               #查看路由      
arp -a                                                    #查看arp缓存表      
net view                                                  #查询机器列表      
type C:\Windows\System32\drivers\etc\hosts                #查看hosts文件       
用户账号密码      
net user                                                  #只显示本机的用户,不显示域用户      
net user qianfu                                           #查看用户qianfu的具体信息      
wmic useraccount get /ALL                                 #查看本机用户详细信息      
net localgroup                                            #查看组      
net localgroup administrators                             #显示本机的administrators管理员组。除了显示本机中用户,还会显示域用户(前提是该域用户在本机的Administrators组内)      
query user | qwinsta                                      #查询当前在线用户      
whoami /all                                               #查询当前用户权限等      
net accounts                                              #查看本地密码策略      
qwinsta                                                   #查看登录情况      
qwinsta /SERVER:IP                                        #查看远程登录情况       
端口      
netstat -ano                                              #查看端口开放情况、      
netstat -ano|findstr 80                                   #查看80端口对应的PID       
服务      
net start                                                 #查询当前运行的服务      
wmic service list brief                                   #查看服务name、进程ID、状态等       
进程      
tasklist                                                  #查看进程列表      
tasklist  /svc                                            #查看进程,显示进程使用者名称      
tasklist | findstr 80                                     #查看80端口对应的进程      
taskkill /f /t /im xx.exe                                 #杀死xx.exe进程      
taskkill /F -pid 520                                      #杀死pid为520的进程      
wmic process list brief                                   #查看进程       
共享      
net use                                                   #查看连接      
net share                                                 #查看共享      
wmic share get name,path,status                           #查看共享      
net session                                               #查看会话      
net view \ip                                              #查询指定IP共享       
启动程序信息                       
wmic startup get command,caption                          #查看启动项信息       
计划任务      
schtasks /query /fo LIST /v                               #查看计划任务       
开机时间      
net statistics workstation                                #查看机器开机时间       
查询IE浏览器的代理信息      
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"        
查询RDP端口号      
reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TCP" /V portNumber

For this machine is a Linux system

1. 获取内核,操作系统和设备信息

版本信息

uname -a 所有版本
uname -r 内核版本信息
uname -n 系统主机名字
uname -m Linux内核架构
内核信息 cat /proc/version
CPU信息 cat /proc/cpuinfo

发布信息

cat /etc/*-release
cat /etc/issue
主机名 hostname
文件系统 df -a

2. 用户和组

列出系统所有用户 cat /etc/passwd
列出系统所有组 cat /etc/group
列出所有用户hash(root)``cat /etc/shadow``

用户

查询用户的基本信息 finger
当前登录的用户 users who -a
目前登录的用户 w
登入过的用户信息 last
显示系统中所有用户最近一次登录信息 lastlog

3. 用户和权限信息

当前用户 whoami
当前用户信息 id
可以使用sudo提升到root的用户(root) cat /etc/sudoers
列出目前用户可执行与无法执行的指令 sudo -l

4. 环境信息

打印系统环境信息 env
打印系统环境信息 set
环境变量中的路径信息 echo  $PATH
打印历史命令 history
显示当前路径 pwd
显示默认系统遍历 cat /etc/profile
显示可用的shell cat /etc/shells

5. 服务信息

查看进程信息 ps aux
由inetd管理的服务列表 cat /etc/inetd.conf
由xinetd管理的服务列表 cat /etc/xinetd.conf
nfs服务器的配置 cat /etc/exports
6. 作业和任务

显示指定用户的计划作业(root) crontab -l -u %user%
计划任务 ls -la /etc/cron*
7. 网络、路由和通信

列出网络接口信息 /sbin/ifconfig -a
列出网络接口信息 cat /etc/network/interfaces
查看系统arp表 arp -a
打印路由信息 route
查看dns配置信息 cat /etc/resolv.conf
打印本地端口开放信息 netstat -an
列出iptable的配置规则 iptables -L
查看端口服务映射 cat /etc/services
var code = "e317e657-c386-498e-8336-7d2023a075fd"

Guess you like

Origin blog.csdn.net/qq_64973687/article/details/127823267#comments_28327156