windows权限提升基础

0x01 获取操作系统信息

  • 识别操作系统名称及版本

    1
    2
    systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
    systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本"
  • 识别系统体系结构

    1
    echo %PROCESSOR_ARCHITECTURE%
  • 查看所有环境变量

    1
    SET
  • 查看在线用户,有时候低权限看不到

    1
    query user
  • 查询终端端口

    1
    REG query HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\WinStations\RDP-Tcp /v PortNumber
  • 查看某特定用户信息

    1
    net user test

0x02 获取网络信息

  • 查看路由表信息

    1
    route print
  • 查看ARP缓存信息

    1
    arp -a
  • 查看网络连接和防火墙规则

    1
    2
    3
    netstat -ano
    netsh firewall show config
    netsh firewall show state

0x03 应用程序及服务信息

  • 查看计划任务

    1
    schtasks /QUERY /fo LIST /v
  • 查看服务进程ID

    1
    tasklist /SVC
  • 查看已经启动Windows 服务

    1
    net start
  • 查看安装驱动

    1
    DRIVERQUERY
  • 查看安装程序和版本信息(漏洞利用线索)

    1
    wmic product list brief
  • 查看服务、进程和启动程序信息

    1
    2
    3
    wmic service list brief
    wmic process list brief
    wmic startup list brief
  • 查看服务权限

    1
    sc qc mysqla
  • 查看安装补丁和时间信息

    1
    wmic qfe get Caption,Description,HotFixID,InstalledOn
  • 查看特定漏洞补丁信息

    1
    wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KBxxxxxxx"

0x04 敏感数据和目录

  • 查找密码文件或其它敏感文件
    1
    2
    3
    4
    5
    cd/
    dir /b/s password.txt # Will search for all password.txt files on the filesystem.
    dir /b/s config.* # Will search for all files starting with 'config' on the filesystem.
    findstr /si password *.xml *.ini *.txt
    findstr /si login *.xml *.ini *.txt

0x05 文件系统

  • 打包

    1
    rar a -k -r -s -m3 c:\1.rar c:\folde
  • 检查文件夹可写状态

    1
    dir /a-r-d /s /b

参考:http://www.goldfire.cc/index.php/archives/660