Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

restringer

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restringer

Deobfuscate Javascript with emphasis on reconstructing strings

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
192
decreased by-29.93%
Maintainers
1
Weekly downloads
 
Created
Source

Restringer

Deobfuscate Javascript and reconstruct strings. Simplify cumbersome logic where possible while adhering to scope limitations.

Try it online @ restringer.tech.

For comments and suggestions feel free to open an issue or find me on Twitter - @ctrl__esc

Table of Contents


Installation

Requires Node 16 or newer.

git clone git@github.com:PerimeterX/restringer.git
cd restringer
npm install

Usage

The restringer.js uses generic deobfuscation methods that reconstruct and restore obfuscated strings and simplifies redundant logic meant only to encumber. REstringer employs the Obfuscation Detector to identify specific types of obfuscation for which there's a need to apply specific deobfuscation methods in order to circumvent anti-debugging mechanisms or other code traps preventing the script from being deobfuscated.

Command-Line Usage

Output deobfuscated result to STDOUT (nothing will print if deobfuscation failed)

node restringer.js script.js

Show debug information and save deobfuscated script to script.js-<obfuscation-type>-deob.js

export DEOBDEBUG=true && node restringer.js script.js

Log level can be adusted via the DEOBDEBUGLEVEL environment variable for more or less granular log output. The default level is an arbitrary 50, simply to leave space for other levels to be added when needed.

export DEOBDEBUG=true && DEOBDEBUGLEVEL=50 && node restringer.js script.js

Level 1 is most verbose, level 2 is a good value to use for debugging.

Use as a Module

const {REstringer} = require('restringer');

const restringer = new REstringer('"RE" + "stringer"');
if (restringer.deobfuscate()) {
  console.log(restringer.script);
} else {
  console.log('Nothing was deobfuscated :/');
}
// Output: 'REstringer';

Read More


TODO

  • Replace environment variables with proper program arguments.
  • Create binary tool that can be installed via npm install -g restringer

Keywords

FAQs

Package last updated on 24 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc