You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CenQuest is a Python script that uses the Censys API to search for internet-facing hosts based on custom search queries. It retrieves the IP addresses and port numbers of all matching hosts and stores the results in a file called `Hosts.txt`.
20
+
21
+
In addition,CenQuest includes a **resume search feature that enables you to pick up where you left off without having to restart the search**. This feature utilizes a CSV file called Info.csv, which keeps track of previously executed search queries and the number of pages retrieved for each query.
22
+
23
+
## Requirements
24
+
25
+
To run the script, you need to have the following:
26
+
27
+
- Python 3.x
28
+
- A Censys account with API credentials
29
+
30
+
Set up your Censys API credentials by creating a file named `config.ini` in the same directory as the script, with the following format:
31
+
32
+
```
33
+
34
+
[Censys Api Config]
35
+
36
+
api=YOUR_CENSYS_UID
37
+
secret=YOUR_CENSYS_SECRET
38
+
39
+
```
40
+
41
+
42
+
## Usage
43
+
To use the script, you need to provide a search query and the number of pages you want to retrieve. Here's an example command:
- -q QUERY, --query QUERY: search query to be executed.
56
+
- -p PAGES, --pages PAGES: number of pages to retrieve.
57
+
58
+
### Example:
59
+
60
+
```bash
61
+
62
+
python3 cenquest.py -q "apache" -p 5
63
+
64
+
```
65
+
66
+
This will search for hosts with the word "apache" in their banners and retrieve the first 5 pages of results. The results will be written to the `Hosts.txt` file in the same directory as the script.
67
+
68
+
69
+
## Resume Search
70
+
71
+
CenQuest uses a CSV file called `Info.csv` to keep track of which search queries have already been executed and how many pages of results were obtained for each query. This allows the script to resume a search from where it left off, in case the script is interrupted or terminated prematurely.
72
+
73
+
74
+
## Disclaimer
75
+
This script is for educational purposes only. Use it at your own risk.
print(f"[!] The last page of this query ({lastrow[0]}) is {int(lastrow[1])}. The next page does not exist!")
41
+
42
+
exit()
43
+
x=input(f"[!] This query ({lastrow[0]}) has already been used for {lastrow[1]} pages. Do you want to start from page {int(lastrow[1])+1} onwards? (y/n): ").upper()
0 commit comments