• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    C#
  • Created over 7 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CScriptShell, a Powershell Host running within cscript.exe

CScriptShell, a Powershell Host running within cscript.exe

This code let's you Bypass Application Whitelisting and Powershell.exe restrictions and gives you a shell that almost looks and feels like a normal Powershell session (Get-Credential, PSSessions -> Works).

Basicly the same code as MSBuildShell (https://github.com/Cn33liz/MSBuildShell), but now using a recent technique found by @SubTee which lets you run .NET code inside JScript or VbScript.

License: BSD 3-Clause

Save These Files And Execute The Following Command:

Create Your Strong Name Key (using PowerShell):
$key = 'BwIAAAAkAABSU0EyAAQAAAEAAQBhXtvkSeH85E31z64cAX+X2PWGc6DHP9VaoD13CljtYau9SesUzKVLJdHphY5ppg5clHIGaL7nZbp6qukLH0lLEq/vW979GWzVAgSZaGVCFpuk6p1y69cSr3STlzljJrY76JIjeS4+RhbdWHp99y8QhwRllOC0qu/WxZaffHS2te/PKzIiTuFfcP46qxQoLR8s3QZhAJBnn9TGJkbix8MTgEt7hD1DC2hXv7dKaC531ZWqGXB54OnuvFbD5P2t+vyvZuHNmAy3pX0BDXqwEfoZZ+hiIk1YUDSNOE79zwnpVP1+BN0PK5QCPCS+6zujfRlQpJ+nfHLLicweJ9uT7OG3g/P+JpXGN0/+Hitolufo7Ucjh+WvZAU//dzrGny5stQtTmLxdhZbOsNDJpsqnzwEUfL5+o8OhujBHDm/ZQ0361mVsSVWrmgDPKHGGRx+7FbdgpBEq3m15/4zzg343V9NBwt1+qZU+TSVPU0wRvkWiZRerjmDdehJIboWsx4V8aiWx8FPPngEmNz89tBAQ8zbIrJFfmtYnj1fFmkNu3lglOefcacyYEHPX/tqcBuBIg/cpcDHps/6SGCCciX3tufnEeDMAQjmLku8X4zHcgJx6FpVK7qeEuvyV0OGKvNor9b/WKQHIHjkzG+z6nWHMoMYV5VMTZ0jLM5aZQ6ypwmFZaNmtL6KDzKv8L1YN2TkKjXEoWulXNliBpelsSJyuICplrCTPGGSxPGihT3rpZ9tbLZUefrFnLNiHfVjNi53Yg4='
$Content = [System.Convert]::FromBase64String($key)
Set-Content key.snk -Value $Content -Encoding Byte

Compile DLL within PowerShell or cmd.exe:
C:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe /r:System.EnterpriseServices.dll,System.Management.Automation.dll /target:library /out:CScriptShell.dll /keyfile:key.snk CScriptShell.cs

To load the CScriptShell from the Commandline:
cscript.exe CScriptShell.js

More info on this Bypass can be found in the following Blogpost from @SubTee: http://subt0x10.blogspot.nl/2017/04/extending-jscript-with.html

Powershell Host Code: Original from Microsoft (MSDN), modified by Cn33liz, Twitter: @Cneelis

Note: This will only work on if .NET 3.5 is installed. The System.Management.Automation.dll is only needed to compile the CScriptShell source code. You don't need it to run the shell.

More Repositories

1

p0wnedShell

PowerShell Runspace Post Exploitation Toolkit
C#
1,519
star
2

StarFighters

A JavaScript and VBScript Based Empire Launcher, which runs within their own embedded PowerShell Host.
Visual Basic
319
star
3

MSBuildShell

MSBuildShell, a Powershell Host running within MSBuild.exe
283
star
4

JSMeter

JavaScript Reversed TCP Meterpreter Stager
JavaScript
136
star
5

TpmInitUACBypass

Bypassing User Account Control (UAC) using TpmInit.exe
C++
125
star
6

VBSMeter

VBS Reversed TCP Meterpreter Stager
Visual Basic
87
star
7

SmashedPotato

C#
83
star
8

p0wnedLoader

C#
72
star
9

p0shKiller

C++
62
star
10

HSEVD-StackOverflowX64

HackSys Extreme Vulnerable Driver - Windows 10 x64 StackOverflow Exploit with SMEP Bypass
C
62
star
11

MacroMeter

VBA Reversed TCP Meterpreter Stager
Visual Basic
62
star
12

MS17-012

MS17-012 - COM Session Moniker EoP Exploit running within MSBuild.exe
59
star
13

SharpCat

SharpCat - A Simple Reversed Command Shell which can be started using InstallUtil (Bypassing AppLocker)
C#
46
star
14

EasySystem

Quick and dirty System (Power)Shell using NamedPipe impersonation.
C
43
star
15

TpmInitUACAnniversaryBypass

Bypassing User Account Control (UAC) using TpmInit.exe
C++
42
star
16

HSEVD-ArbitraryOverwriteGDI

HackSys Extreme Vulnerable Driver - ArbitraryOverwrite Exploit using GDI
C
40
star
17

HSEVD-StackOverflow

HackSys Extreme Vulnerable Driver - StackOverflow Exploit
C
30
star
18

p0wnedReverse

PowerShell Runspace Connect-Back Shell
C#
27
star
19

HSEVD-ArbitraryOverwrite

HackSys Extreme Vulnerable Driver - ArbitraryOverwrite Exploit
C
25
star
20

HSEVD-VariousExploits

HackSys Extreme Vulnerable Driver - Various Windows 7 x86 Kernel Exploits
C
21
star
21

HSEVD-StackCookieBypass

HackSys Extreme Vulnerable Driver - StackOverflow with Stack Cookie Bypass Exploit
C
19
star
22

HSEVD-StackOverflowGDI

HackSys Extreme Vulnerable Driver - Windows 10 x64 StackOverflow Exploit using GDI
C
18
star
23

HackTheBox-Jail

HTB Jail Remote Exploit By Cneeliz - 2017
Python
15
star
24

HSEVD-ArbitraryOverwriteLowIL

HackSys Extreme Vulnerable Driver - ArbitraryOverwrite Exploit using GDI -> Low Integrity to System
C
14
star
25

HackTheBox-Smasher

Python
8
star
26

FortiParse

Fortigate Configuration Parser
Python
4
star