All Projects → Kara-4search → HellgateLoader_CSharp

Kara-4search / HellgateLoader_CSharp

Licence: other
Load shellcode via HELLGATE, Rewrite hellgate with .net framework for learning purpose.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to HellgateLoader CSharp

NewNtdllBypassInlineHook CSharp
Load a fresh new copy of ntdll.dll via file mapping to bypass API inline hook.
Stars: ✭ 35 (-52.05%)
Mutual labels:  pentest, bypass, bypass-antivirus, shellcode-loader, redteam, bypass-edr
Nac bypass
Script collection to bypass Network Access Control (NAC, 802.1x)
Stars: ✭ 79 (+8.22%)
Mutual labels:  pentest, bypass, redteam
Payloadsallthethings
A list of useful payloads and bypass for Web Application Security and Pentest/CTF
Stars: ✭ 32,909 (+44980.82%)
Mutual labels:  pentest, bypass, redteam
Aboutsecurity
A list of payload and bypass lists for penetration testing and red team infrastructure build.
Stars: ✭ 166 (+127.4%)
Mutual labels:  pentest, bypass, redteam
MsfMania
Python AV Evasion Tools
Stars: ✭ 388 (+431.51%)
Mutual labels:  pentest, bypass-antivirus, redteam
DInvoke shellcodeload CSharp
ShellCodeLoader via DInvoke
Stars: ✭ 41 (-43.84%)
Mutual labels:  bypass, bypass-antivirus, redteam
Macro pack
macro_pack is a tool by @EmericNasi used to automatize obfuscation and generation of Office documents, VB scripts, shortcuts, and other formats for pentest, demo, and social engineering assessments. The goal of macro_pack is to simplify exploitation, antimalware bypass, and automatize the process from malicious macro and script generation to final document generation. It also provides a lot of helpful features useful for redteam or security research.
Stars: ✭ 1,072 (+1368.49%)
Mutual labels:  pentest, redteam
Girsh
Automatically spawn a reverse shell fully interactive for Linux or Windows victim
Stars: ✭ 66 (-9.59%)
Mutual labels:  pentest, redteam
Pentest Guide
Penetration tests guide based on OWASP including test cases, resources and examples.
Stars: ✭ 1,316 (+1702.74%)
Mutual labels:  pentest, bypass
Go Bypass
Golang Bypass Av Generator template
Stars: ✭ 606 (+730.14%)
Mutual labels:  bypass, bypass-antivirus
Diamorphine
LKM rootkit for Linux Kernels 2.6.x/3.x/4.x/5.x (x86/x86_64 and ARM64)
Stars: ✭ 725 (+893.15%)
Mutual labels:  pentest, redteam
Wsmanager
Webshell Manager
Stars: ✭ 99 (+35.62%)
Mutual labels:  pentest, redteam
Passcat
Passwords Recovery Tool
Stars: ✭ 164 (+124.66%)
Mutual labels:  pentest, redteam
Snoop
Snoop — инструмент разведки на основе открытых данных (OSINT world)
Stars: ✭ 886 (+1113.7%)
Mutual labels:  pentest, redteam
1earn
个人维护的安全知识框架,内容包括不仅限于 web安全、工控安全、取证、应急、蓝队设施部署、后渗透、Linux安全、各类靶机writup
Stars: ✭ 776 (+963.01%)
Mutual labels:  pentest, redteam
Chashell
Chashell is a Go reverse shell that communicates over DNS. It can be used to bypass firewalls or tightly restricted networks.
Stars: ✭ 742 (+916.44%)
Mutual labels:  pentest, redteam
Collection Document
Collection of quality safety articles. Awesome articles.
Stars: ✭ 1,387 (+1800%)
Mutual labels:  pentest, redteam
InlineWhispers2
Tool for working with Direct System Calls in Cobalt Strike's Beacon Object Files (BOF) via Syswhispers2
Stars: ✭ 156 (+113.7%)
Mutual labels:  syscalls, redteam
Hershell
Hershell is a simple TCP reverse shell written in Go.
Stars: ✭ 442 (+505.48%)
Mutual labels:  pentest, redteam
Doxycannon
A poorman's proxycannon and botnet, using docker, ovpn files, and a dante socks5 proxy
Stars: ✭ 216 (+195.89%)
Mutual labels:  pentest, redteam

HellgateLoader_CSharp

Blog link: working on it

  • Rewrite hellgate with .net framework for learning purpose

  • Base on the original Hellgate project down below:

    1. https://github.com/am0nsec/SharpHellsGate
    2. https://github.com/am0nsec/HellsGate
  • And my other project down below:

    1. SysCall_ShellcodeLoader
    2. HookDetection
    3. DInvoke_ShellcodeLoader
    4. NewNtdllBypassInlineHook
  • I make this project for learning purpose, use it at you own risk.

  • Only tested it on Win10/x64 works fine.

  • For better understanding, you really need to read the PDF(https://vxug.fakedoma.in/papers/VXUG/Exclusive/HellsGate.pdf) from the original author.

  • Thanks to them I do learn a lot, during coding this project.

  • Also, there is a little different here, Instead of read the syscall id from the memory, I read 24 bytes as the syscall, so you don‘t need to concat them again. I think that would be more convenient for me.

  • (From the PDF)This general usage code base self-resolves syscalls without the need for static elements. Additionally, this general usage code base makes zero function invocations to aggregate the syscalls themselves.

  • About how it works:

    1. Read the ntdll.dll via IO.stream from disk as MemoryStream.
    2. Find the RVA of function address.
    3. Convert the rva to file offset(RVA - IMAGE_SECTION_HEADER_instance.VirtualAddress + IMAGE_SECTION_HEADER_instance.PointerToRawData;).
    4. Use the offset to find to function offset in MemoryStream.
    5. Read 24 bytes as syscall from MemoryStream with the right offset.
    6. Execute the syscall via delegate.
  • The picture down below helps you to understand file offset. avatar

  • The code from the original project is elegant as hell, guess that is why is called HELLGATE :) :) ~

  • You could even modify the code to like injection or something else.

Usage

  1. Set the APIs name that you need in "SyscallTable.cs" ,In this case is:
  • v1.Name = "NtAllocateVirtualMemory";
  • v2.Name = "NtCreateThreadEx";
  • v3.Name = "NtWaitForSingleObject"; avatar
  1. Set the shellcode in Program.cs, the default shellcode is a Calc. avatar

TO-DO list

  • Works on both x64/x86
  • Restructure the code

Update history

  • Fix bugs: cannot run normally after compile as release - 20211204
  • Fix bugs: pMethod's address print with wrong format - 20220121

Reference link:

1. https://github.com/am0nsec/HellsGate
2. https://github.com/am0nsec/SharpHellsGate
3. https://vxug.fakedoma.in/papers/VXUG/Exclusive/HellsGate.pdf 
4. https://docs.microsoft.com/zh-cn/dotnet/api/system.reflection.bindingflags?view=net-5.0
5. https://docs.microsoft.com/zh-cn/dotnet/api/system.runtime.compilerservices.runtimehelpers.preparemethod?view=net-5.0
6. https://docs.microsoft.com/zh-cn/dotnet/api/system.runtime.compilerservices.runtimehelpers.preparemethod?redirectedfrom=MSDN&view=net-5.0#System_Runtime_CompilerServices_RuntimeHelpers_PrepareMethod_System_RuntimeMethodHandle_System_RuntimeTypeHandle___
7. https://docs.microsoft.com/zh-cn/dotnet/api/system.runtime.interopservices.marshal.allochglobal?view=net-5.0
8. https://www.cnblogs.com/qintangtao/archive/2013/01/11/2857180.html
9. https://blog.csdn.net/StriveScript/article/details/6279488
10. https://www.cnblogs.com/wyping/p/3643243.html
11. https://blog.csdn.net/e295166319/article/details/52702461
12. https://blog.csdn.net/qiqi5045/article/details/7736576
13. https://blog.csdn.net/tianxiayijia1998/article/details/50119435
14. https://www.runoob.com/csharp/csharp-generic.html
15. https://www.csharpcodi.com/csharp-examples/System.RuntimeMethodHandle.GetFunctionPointer()/
16. https://cloud.tencent.com/developer/article/1015264
17. https://a1ex.online/2020/07/26/PE-to-LoadLibrary-md/
18. https://www.displayfusion.com/Discussions/View/converting-c-data-types-to-c/?ID=38db6001-45e5-41a3-ab39-8004450204b3
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].