# https://github.com/bitsadmin/wesng# 1. Copy and paste into system.txt in kaliSysteminfo# 2. Update windows exploit suggester. Will generate a .xls file pythonwindows-exploit-suggester.py--update# 3. Start suggesting an exploitpythonwindows-exploit-suggester.py--database<generatedxls>--systeminfosystem.txt
wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB979682"
Windows Vista/2008 6.1.6000 x32,Windows Vista/2008 6.1.6001 x32,Windows 7 6.2.7600 x32,Windows 7/2008 R2 6.2.7600 x64. (no good exploit - unlikely Microsoft Windows Vista/7 - Elevation of Privileges (UAC Bypass))
wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB2393802"
Stored Credentials
wmic os get osarchitecture || echo %PROCESSOR_ARCHITECTURE%
32 or 64bit?
wmic useraccount get name, sid
Get list of user account names and SID
wmic logicaldisk get caption || fsutil fsinfo drives
List drives
Unquoted Service Paths
Privesc by uploading binary payload in service path to be executed eg. By service start/stop or reboot.
How? Suppose we found:
C:\Program Files (x86)\Program Folder\A Subfolder\Executable.exe
If you look at the registry entry for this service with Regedit you can see the ImagePath value is:
C:\Program Files (x86)\Program Folder\A Subfolder\Executable.exe
To be prevent it being exploited, the path should have been:
C:\Program Files (x86)\Program Folder\A Subfolder\Executable.exe When Windows attempts to run this service, it will look at the following paths in order and will run the first EXE that it will find in sequence, hitting our exploit payload.
# With WMICwmic service get name,displayname,pathname,startmode |findstr /i "Auto"|findstr /i /v "C:\Windows\\"|findstr /i /v """ # With powershell/PowerUpGet-ServiceUnquoted
Writable Path (accesschk.exe > upnphost)
(1) Accesschk for any writable path
(2) sc qc to query
(3) method1: adding backdoor user to admin group
(4) method2: adding binary payload