ws-loader works as a staged loader for 64 bit windows operating systems communicating over websockets.
-
Windows API Hashing
-
Custom versions of
GetProcAddress
andGetModuleHandle
-
Automatically
determines the payload type when payload is sent -
System Proxy
aware -
Reflectively load PEs
-
Load
Sliver C2
beacons (--format exe, dll, bin
) -
Load
Havoc C2
beacons (exe, bin
) -
Shellcode execution through windows callbacks
-
EnumPwrSchemes
-
EnumUILanguagesA
-
EnumSystemCodePagesA
-
-
Anti-Debugging
- Check if process was started by debugger (
NtGlobalFlag
)
- Check if process was started by debugger (
-
Anti-Sandbox
- Time based (
QueryPerformanceCounter
)
- Time based (
-
Execution Guard rails
-
Check if hostname djb2 hash matches target (
djb2(GetComputerNameA)
) -
Check for running enemy processes (
Ex: Wireshark, x64dbg
)
-
This will not run "out of the box" you will need to
-
Change
WSL_TARGET
inanti.h
by running./scripts/dj 'YOUR TARGET HOSTNAME'
-
Change
WSL_SLEEP_TIME
-
Change the
home
variable in thewsl_get_ws
function to the ip address of where you run the websocket server
THIS PROGRAM SHOULD NOT BE USED FOR MALICIOUS PURPOSES THIS TOOL WAS NOT CREATED FOR MALICOUS INTENT THIS REPOSITORY SHOULD ONLY BE USED TO LEARN READ THE CODE
I also wrote a small websocket server in
srv
while testing to serve a payload
sudo apt install pipx
pipx install poetry
cd srv/
poetry install
poetry run python3 -B main.py -i [IP] -p [PORT] -b [PAYLOAD]
-B Flag don't write .pyc files on import
https://theartincode.stanis.me/008-djb2/
While I was playing
Wutai
the Red Team lab on Vulnlab by xct, I guess at the time I was playing the loader in the video was already flagged by Avira (Still not sure at this point) since I couldn't get that to work I wrote my own loader and tried to incorporate everything I would need in terms of getting a beacon. It isn't the greatest, it is NOT bypassing any hooks but it gets the job done that's for sure.
This is just a mashup of things I found useful it is NOT supposed to be fancy BUT There are two reasons why I chose to use websockets
-
On Wutai the client computers have an outbound system proxy
(squidproxy)
. Meaning all communication will be through that proxy using HTTP, perfect for our websockets that initiate the conversation using HTTP and switch to raw TCP connection. -
ws-loader
works as a staged loader so I needed some way that abides by the rules of the environment to send what I wanted to execute