|
| 1 | +# oldhosts |
| 2 | + |
| 3 | +`oldhosts` is a tool for bug bounty hunters to discover old hosts that are no longer available, but might still be present on different known and related servers. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +To install `oldhosts`, follow the steps below: |
| 8 | + |
| 9 | + - Ensure you have Go installed on your system. |
| 10 | + - Run the following command to install the required packages: |
| 11 | + ``` |
| 12 | + go install -v github.com/topscoder/oldhosts |
| 13 | + ``` |
| 14 | + |
| 15 | +## Options |
| 16 | +Run the script using the following command-line arguments: |
| 17 | + |
| 18 | + ``` |
| 19 | + oldhosts -ips <ips> -hosts <hosts> [-curl] [-silent] |
| 20 | + ``` |
| 21 | + - `-ips` (required): Specify an IP address or provide a filename containing IP addresses (one per line). |
| 22 | + - `-hosts` (required): Specify the hostname or provide a filename containing hosts (one per line). |
| 23 | + - `-curl` (optional): Output the results as Curl commands. |
| 24 | + - `-silent` (optional): Run in silent mode, suppresses non-200 responses (except for content length). |
| 25 | + |
| 26 | +View the results: |
| 27 | + - The script will perform HTTP and HTTPS requests for each IP and host combination. |
| 28 | + - The script will display the response status code and content length for each successful request. |
| 29 | + - If the `-curl` flag is specified, Curl commands will be displayed instead of the response details. |
| 30 | + |
| 31 | +## Example |
| 32 | + |
| 33 | +Here is an example command to run `oldhosts`: |
| 34 | + |
| 35 | +``` |
| 36 | +oldhosts -ips "192.168.0.1" -hosts "example.com" -curl |
| 37 | +``` |
| 38 | + |
| 39 | +This command will perform HTTP and HTTPS requests to the specified IP addresses and hosts, displaying the results as Curl commands. |
| 40 | + |
| 41 | +## Notes |
| 42 | + |
| 43 | +- The script limits the number of concurrent calls to 5 for performance reasons. You can adjust this value by modifying the `semaphore` channel in the code. |
| 44 | + |
| 45 | +- The script supports both individual strings and filenames as input for IP addresses and hosts. If a filename is provided, the script reads the IP addresses and hosts from the file (one per line). |
| 46 | + |
| 47 | +- The script removes any trailing slashes from the hosts and tries to append default ports (":80" for HTTP and ":443" for HTTPS) to the host header. |
| 48 | + |
| 49 | +- The script has a timeout of 1 second for each HTTP request. |
| 50 | + |
| 51 | +- If the `-silent` flag is specified, the script will only print results for successful requests (200 status code). Use this flag to reduce the output and focus on relevant information. |
| 52 | + |
| 53 | +## Contributing |
| 54 | + |
| 55 | +Contributions are welcome! If you find a bug or want to suggest a new feature, please open an issue or submit a pull request. |
| 56 | + |
| 57 | +## License |
| 58 | + |
| 59 | +This project is licensed under the [MIT License](LICENSE). |
0 commit comments