The File Type Fetcher is a Go script designed to extract and collect file links from specified target URLs. The script can be used to identify and list different types of files (e.g., .js, .json, .env, .jsx) present on web pages. The script can also download the identified files to a specified directory. This tool can be useful for bug bounters, pentesters, developers or web administrators to quickly identify and manage files on web servers and web sites.
- Extract file links from specified URLs.
- Ability to specify the target URLs via a file.
- Supports multiple file types.
- Option to download the found files to a specified directory.
- Writes the file links to a specified output file and prints them to the command line.
- Go installed on your machine.
Clone this repository to your local machine:
git clone https://github.com/huseyinstif/FileTypeFetcher.git
cd FileLinkFetcher
- First, create a text file (e.g.,
targets.txt
) containing the target URLs, one per line. - Then, run the script using the following command:
go run main.go -l targets.txt -o output.txt
This will extract the file links from the specified URLs and write them to output.txt.
To download the identified files to a specified directory, use the -d flag followed by the directory path:
go run main.go -l targets.txt -o output.txt -d downloads
This will download the files to the downloads directory.
-l: Path to the file containing the list of target URLs (Required).
-o: Output file name for saving the file links (Default: output.txt).
-d: Directory to download files to. If not specified, files will not be downloaded.
- Ensure that the target URLs in the input file start with
http://
orhttps://
. - The script does not create directories, so ensure that the specified download directory exists before running the script with the
-d
flag.