peass-ng / PEASS-ng

PEASS - Privilege Escalation Awesome Scripts SUITE (with colors)
https://book.hacktricks.xyz
Other
15.73k stars 3.05k forks source link

Unable to load DLL 'wlanapi.dll' #176

Closed heyquentin closed 2 years ago

heyquentin commented 3 years ago

Hello, I'm running Winpeas x64 on a Server 2019 Standard machine and receiving an error. I've also seen this error on other newer Windows machines. I'm running 'winpeas.exe log' and receiving this error:

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'wlanapi.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at winPEAS.Native.WlanApi.WlanCloseHandle(IntPtr clientHandle, IntPtr pReserved)
   at winPEAS.Wifi.NativeWifiApi.WlanClient.Finalize()

Systeminfo from the machine

OS Name:                   Microsoft Windows Server 2019 Standard
OS Version:                10.0.17763 N/A Build 17763
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Server
OS Build Type:             Multiprocessor Free
Registered Owner:          Windows User
Registered Organization:
Product ID:                00429-70000-00000-AA062
Original Install Date:     5/13/2019, 2:07:53 AM
System Boot Time:          4/19/2020, 1:21:20 PM
System Manufacturer:       VMware, Inc.
System Model:              VMware Virtual Platform
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 79 Stepping 1 GenuineIntel ~2300 Mhz
makikvues commented 2 years ago

hello @heyquentin, thanks for reporting the issue. for wlan enumeration, we are currently using wlanapi.dll and after some investigation I found it might not be supported on every Windows version / release / type. I have not found a way around this, because of that I fixed the bug by using "netsh" command if wlanapi.dll API fails. Please check again after the PR with fix is merged, hopefully we can close the issue then :) thx