Code Monkey home page Code Monkey logo

linkfinder's Introduction

About LinkFinder

LinkFinder is a python script written to discover endpoints and their parameters in JavaScript files. This way penetration testers and bug hunters are able to gather new, hidden endpoints on the websites they are testing. Resulting in new testing ground, possibility containing new vulnerabilities. It does so by using jsbeautifier for python in combination with a fairly large regular expression. The regular expressions consists of four small regular expressions. These are responsible for finding:

  • Full URLs (https://example.com/*)
  • Absolute URLs or dotted URLs (/* or ../*)
  • Relative URLs with atleast one slash (text/test.php)
  • Relative URLs without a slash (test.php)

The output is given in HTML.

Screenshots

LinkFinder

Installation

Clone LinkFinder using git as seen belows or download linkfinder.py manually. LinkFinder supports Python 2 & 3.

git clone https://github.com/GerbenJavado/LinkFinder.git

Dependencies:

LinkFinder depends on the requests, argparse, jsbeautifier and requests-file python modules. These dependencies can all be installed using pip.

Usage

Short Form Long Form Description
-i --input Input a: URL, file or folder. For folders a wildcard can be used (e.g. '/*.js').
-o --output Where to save the file, including file name. Default: output.html
-r --regex RegEx for filtering purposes against found endpoints (e.g. ^/api/)
-h --help show the help message and exit

Examples

  • Most basic usage to find endpoints in an online JavaScript file and output the results to results.html:

python linkfinder.py -i https://example.com/1.js -o results.html

  • Enumerating an entire folder for JavaScript files, while looking for endpoints starting with /api/ and finally saving the results to results.html:

python linkfinder.py -i 'Desktop/*.js' -r ^/api/ -o results.html

Final remarks

  • Due to the way python handles string concatenation the beautifying of the JavaScript can take ages.
  • This is the first time I publicly release a tool. Yes, I do suck at coding, but contributions are much appreciated!
  • LinkFinder is published under the MIT License.
  • Thanks to @jackhcable for providing me with feedback.

linkfinder's People

Contributors

gerbenjavado avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.