Skip to content
A small tool that extracts relative URLs from a file.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information. Added -c option to readme and added demo Oct 19, 2017
demo-file.js Added demo file Oct 19, 2017
extract.rb Added extract script (initial commit, copied code from somewhere else) Oct 19, 2017

During reconnaissance (recon) it is often helpful to get a quick overview of all the relative endpoints in a file. These days web applications have frontend pipelines that make it harder for humans to understand minified code. This tool contains a nifty regular expression to find and extract the relative URLs in such files. This can help surface new targets for security researchers to look at. It can also be used to periodically compare the results of the same file, to see which new endpoints have been deployed. History has shown that this is a goldmine for bug bounty hunters.


The tool has three ways to be executed: with a file name, a URL, or a command. The options are outlined below. By default, only the unique relative URLs are shown. To include an excerpt of the line it was matched in, append -c to the command.

  • ruby extract.rb demo-file.js
  • ruby extract.rb
  • ruby extract.rb '|cat demo-file.js' -c


A demo file is included in the repository. Run the commands as shown above to extract relative URLs from a minified JavaScript file. An excerpt of the output is shown below.

You can’t perform that action at this time.