ผู้แต่ง: Sean Pesce
สคริปต์ NodeJS สำหรับการวิเคราะห์ (minified/obfuscated) JavaScript เครื่องมือทั้งหมดรองรับการประมวลผลไฟล์ท้องถิ่นไฟล์ระยะไกลผ่าน URL HTTP (S) หรือข้อมูลจากอินพุตมาตรฐาน
เครื่องมือเหล่านี้ยังอยู่ภายใต้การพัฒนาที่หนักหน่วงดังนั้นความคิดและการมีส่วนร่วมยินดีต้อนรับ
แพ็คเกจระบบ:
curlnodejs (18.3+)โมดูลโหนด:
escodegenesprimaestraversesource-map หมายเหตุ: เครื่องมือเหล่านี้จัดส่งด้วย esrefactor เวอร์ชันอัปเดตโดย Nick Larosa เวอร์ชันของนิคแก้ไขปัญหาสำคัญบางอย่างกับเวอร์ชันของไลบรารีใน NPM (ดูคำขอดึงที่นี่) รุ่น PR สามารถติดตั้งได้โดยตรงด้วย npm install ariya/esrefactor#pull/9/head แต่ฉันได้รวมไว้ที่นี่เพื่อความสะดวก
jsretk-strings สคริปต์นี้แยกตัวอักษรสตริงจากรหัส JavaScript ซึ่งมีผลลัพธ์ที่คล้ายกันกับการเรียกใช้ strings กับการปฏิบัติการไบนารีที่รวบรวมได้ นอกจากนี้ยังรองรับตัวเลือกในการแยกความคิดเห็น JavaScript และตัวอักษร Regex
$ node jsretk-strings.js --help
Usage:
node jsretk-strings.js [OPTIONS] <JS_FILE_1> [[JS_FILE_2] ...]
Options:
[-h|--help] Print usage and exit
[-P|--stdin] Pipe data from stdin
[-c|--comments] Include JavaScript comments in output
[-C|--comments-only] Find ONLY JavaScript comments (no string/RegEx literals; overrides "-c")
[-r|--regex] Include Regular Expression (RegEx) literals in output
[-R|--regex-only] Find ONLY RegEx literals (no comments/string literals; overrides "-r")
[-T|--templates-only] Find ONLY template strings (no static string/RegEx literals or comments)
[-m|--min] Find strings of this length or longer (inclusive)
[-M|--max] Find strings of this length or shorter (inclusive)
[-x|--match-regex] <ex> Find strings that match the given Regular Expression
[-k|--insecure] Don't verify TLS/SSL certificates for connections when fetching remotely-hosted JS files
[-p|--curl-path] <path> Non-standard path/name for the curl command
[-B|--max-buffer] <n> Maximum size (in bytes) for remotely-fetched JS files (default: 50MB)
[-E|--encoding] <enc> Text encoding for local input/output files (default: "utf8")
[-i|--interactive] Enter interactive NodeJS prompt after completion
jsretk-unminifyคำเตือน: สคริปต์นี้ไม่เสถียรและไม่ได้มีประสิทธิภาพในสถานะปัจจุบัน
สคริปต์นี้พยายามที่จะยกเลิกรหัส JavaScript โดย:
โปรดทราบว่าการใช้งานในปัจจุบันอาจใช้เวลานานมากในการดำเนินการที่ไม่เหมือนใครดังนั้นการใช้ -v|--verbose การตั้งค่าสถานะ VERBOSE จึงขอแนะนำให้ใช้สำหรับการติดตามความคืบหน้า สำหรับรหัสบางส่วน (เช่นการปรับใช้แบบดั้งเดิมบางส่วน) การทดลอง -L|--per-line สามารถลดเวลาเสร็จสิ้นได้อย่างทวีคูณ
$ node jsretk-unminify.js --help
Usage:
node jsretk-unminify.js [OPTIONS] <JS_FILE_1> [[JS_FILE_2] ...]
Options:
[-h|--help] Print usage and exit
[-P|--stdin] Pipe data from stdin
[-v|--verbose] Enable verbose output
[-o|--output-dir] <dir> Output directory (default: "jsretk-out")
[-O|--overwrite] If output file(s) exist, automatically overwrite
[-t|--tab] Use tab characters ("t") instead of spaces for indenting formatted code
[-I|--indent] <n> Number of spaces (or tabs) used for indenting formatted code (default: 4 spaces or 1 tab)
[-r|--rename-len] <n> Rename variables if names are shorter than or equal to this value (default: 2 characters)
[-R|--no-rename] Don't rename variables to unique names
[-F|--no-format] Don't format the code for readability
[-C|--char-iter] Iterate over characters instead of tokens during refactoring. Significantly slower; may produce slightly different output
[-s|--smart-rename] (EXPERIMENTAL) Use various heuristics to attempt to generate more informative variable names
[-L|--per-line] (EXPERIMENTAL) Attempt to refactor code line by line (rather than the whole file at once). Useful for some react-native deployments, but fails on many (most?) codebases
[-k|--insecure] Don't verify TLS/SSL certificates for connections when fetching remotely-hosted JS files
[-p|--curl-path] <path> Non-standard path/name for the curl command
[-B|--max-buffer] <n> Maximum size (in bytes) for remotely-fetched JS files (default: 50MB)
[-E|--encoding] <enc> Text encoding for local input/output files (default: "utf8")
[-i|--interactive] Enter interactive NodeJS prompt after completion
jsretk-unsourcemap สคริปต์นี้ใช้รหัสต้นฉบับจาก Tim McCormack กู้คืนซอร์สโค้ด JavaScript/typeScript จากไฟล์แผนที่ JS/Source ( *.js.map )
$ node jsretk-unsourcemap.js --help
usage: jsretk-unsourcemap.js [-h] src-js src-map out-dir
Deobfuscate JavaScript code using a source map
positional arguments:
src-js Path to JavaScript file to recover
src-map Path to source-map to recover from
out-dir Path to directory where sources will be dumped
optional arguments:
-h, --help show this help message and exit
สำหรับการสอบถามและ/หรือข้อมูลเกี่ยวกับฉันเยี่ยมชม เว็บไซต์ส่วนตัว ของฉัน