All Projects → rarecoil → Unwebpack Sourcemap

rarecoil / Unwebpack Sourcemap

Licence: mit
Extract uncompiled, uncompressed SPA code from Webpack source maps.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Unwebpack Sourcemap

mobxSpa
企业级SPA项目,完整开发脚手架
Stars: ✭ 96 (-45.45%)
Mutual labels:  spa, webpack4
Vue2 Spa Tutorial
Vue2.x(即将升Vue 3)、 Webpack 4.x、Babel 7.x
Stars: ✭ 267 (+51.7%)
Mutual labels:  webpack4, spa
Webpack Starter Basic
A simple webpack starter project for your basic modern web development needs.
Stars: ✭ 552 (+213.64%)
Mutual labels:  webpack4, spa
Webpack.js.org
Repository for webpack documentation and more!
Stars: ✭ 2,049 (+1064.2%)
Mutual labels:  webpack4
Zigdiggity
A ZigBee hacking toolkit by Bishop Fox
Stars: ✭ 169 (-3.98%)
Mutual labels:  security-tools
Dnxfirewall
dnxfirewall (dad's next-gen firewall), a pure Python next generation firewall built on top of Linux kernel/netfilter.
Stars: ✭ 174 (-1.14%)
Mutual labels:  security-tools
Intrec Pack
Intelligence and Reconnaissance Package/Bundle installer.
Stars: ✭ 177 (+0.57%)
Mutual labels:  security-tools
Vue Stack 2.0
Vue 2.0 Project Boilerplate
Stars: ✭ 166 (-5.68%)
Mutual labels:  spa
Go Vue Starter
Starter project - Golang api, Vue.js client with user management and jwt authentication
Stars: ✭ 176 (+0%)
Mutual labels:  spa
Recsech
Recsech is a tool for doing Footprinting and Reconnaissance on the target web. Recsech collects information such as DNS Information, Sub Domains, HoneySpot Detected, Subdomain takeovers, Reconnaissance On Github and much more you can see in Features in tools .
Stars: ✭ 173 (-1.7%)
Mutual labels:  security-tools
Tools Tbhm
Tools of "The Bug Hunters Methodology V2 by @jhaddix"
Stars: ✭ 171 (-2.84%)
Mutual labels:  security-tools
Symfony Vuejs
Source code of the tutorial "Building a single-page application with Symfony 4 and Vue.js"
Stars: ✭ 170 (-3.41%)
Mutual labels:  spa
Icongenie
CLI tool to generate all the icons and splashscreens for your Quasar Apps
Stars: ✭ 174 (-1.14%)
Mutual labels:  spa
Rastrea2r
Collecting & Hunting for IOCs with gusto and style
Stars: ✭ 169 (-3.98%)
Mutual labels:  security-tools
Stegcloak
Hide secrets with invisible characters in plain text securely using passwords 🧙🏻‍♂️⭐
Stars: ✭ 2,379 (+1251.7%)
Mutual labels:  security-tools
Cezerin
Cezerin is React and Node.js based eCommerce platform.
Stars: ✭ 1,985 (+1027.84%)
Mutual labels:  spa
Blog
【前端进阶】优质博文
Stars: ✭ 2,439 (+1285.8%)
Mutual labels:  webpack4
Vue Chrome Extension Boilerplate
Boilerplate for Chrome extension using Vue.js and Webpack with auto-reload enabled.
Stars: ✭ 171 (-2.84%)
Mutual labels:  webpack4
Vue Element Ui Scaffold Webpack4
vue下基于webpack4构建的多页面、多环境方案脚手架项目(使用了element-ui,可替换为其他)
Stars: ✭ 171 (-2.84%)
Mutual labels:  webpack4
Antiddos System
🛡️⚔️ Protect your web app from DDOS attack or the Dead Ping + CAPTCHA VERIFICATION in one line!
Stars: ✭ 173 (-1.7%)
Mutual labels:  security-tools

unwebpack-sourcemap

Recover uncompiled TypeScript sources, JSX, and more from Webpack sourcemaps.

As single-page applications take over the world, more and more is being asked of the browser as a client. It is common for SPAs to use Webpack to handle browser script build processes. Usually, Webpack will transpile React/Vue/TypeScript/etc. to JavaScript, minify/compress it, and then serve it as a single bundle to the application.

However, Webpack also produces JavaScript source maps to assist in the debugging and development process; when things go wrong, the browser's debugger can use the SourceMap to point to a line in the code that contains the issue at hand. Most developers do not adequately protect the source maps and ship them to production environments.

When the browser was simply handling an array of JavaScript files concatenated and (maybe) packed, this wasn't so much of an issue. However, developers of SPAs assume the use of JavaScript as an intermediate representation. Developers often expect production to contain obfuscated and/or otherwise-processed scripts, and do not understand just what the sourcemaps contain in many cases. This model aligns closely with shipping binaries: source is compiled and you ship the interpretable version. If this is the case, the sourcemap is akin to leaking your source alongside the "binary" (bundle) you have made. The bundle can be reverse engineered just as a binary can, but sourcemaps make this far easier.

Usage

The script requires Python3, BeautifulSoup4 and requests. Install dependencies with pip3 install -r requirements.txt. The script can handle downloaded sourcemaps, or attempt to parse them from remote sources for you. In all of these cases, we will assume that you have a directory you have created called output alongside the script:

\$ mkdir output

In order of increasing noisiness, to unpack a local sourcemap:

\$ ./unwebpack_sourcemap.py --local /path/to/source.map output

To unpack a remote sourcemap:

\$ ./unwebpack_sourcemap.py https://pathto.example.com/source.map output

To attempt to read all <script src> on an HTML page, fetch JS assets, look for sourceMappingURI, and pull sourcemaps from remote sources:

\$ ./unwebpack_sourcemap.py --detect https://pathto.example.com/spa_root/ output

I'm a developer and this scares me. What do?

You have a few options:

  1. Turn off sourcemaps in production entirely.
  2. Push sourcemaps to a private server, and ACL sourcemap URIs to developers only.
  3. Load sourcemaps from local sources only and do not push them to production.

Example Vulnerable Application

An example TypeScript+React application is included in example-react-ts-app. You can run this locally and run the script against it.

Contributions

This is an alpha-level script built for a series of engagements I was working on in which sourcemaps are disclosed in production environments. It currently is only meant to work with TypeScript+React and TypeScript+Vue templates. Pull requests to harden the script, make it read more sourcemaps, et cetera are greatly appreciated.

License

MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].