File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9090
9191# Prompt for target if not provided as argument
9292if [ -z " $1 " ]; then
93- echo -e " ${YELLOW} [* ]${NC} No target ID provided"
93+ echo -e " ${YELLOW} [- ]${NC} No target ID provided"
9494 read -p " Enter target name: " id
9595 if [ -z " $id " ]; then
9696 error " Target name cannot be empty"
@@ -173,7 +173,10 @@ log "DNS Resolution: Resolving subdomains with puredns..."
173173puredns resolve " $scan_path /subs.txt" -r " $lists_path /resolvers.txt" --resolvers-trusted " $lists_path /resolvers-trusted.txt" -w " $scan_path /resolved.txt" | wc -l
174174
175175log " DNS Resolution: Extracting IP addresses with dnsx..."
176- dnsx -l " $scan_path /resolved.txt" -json -o " $scan_path /dns.json" && jq -r ' .. | objects | to_entries[] | select(.value | tostring | test("^\\d+\\.\\d+\\.\\d+\\.\\d+$")) | .value' " $scan_path /dns.json" | anew " $scan_path /ips.txt" | wc -l
176+ dnsx -l " $scan_path /resolved.txt" -json -o " $scan_path /dns.json"
177+ log " Extracting IP addresses from $scan_path /dns.json"
178+ # Use grep to extract IPv4 addresses from the JSON output (robust across different dnsx JSON shapes)
179+ grep -oE ' \b([0-9]{1,3}\\.){3}[0-9]{1,3}\b' " $scan_path /dns.json" | anew " $scan_path /ips.txt" | wc -l
177180
178181# Port Scanning & HTTP Server Discovery
179182log " Port Scanning: Running nmap on discovered IPs..."
Original file line number Diff line number Diff line change 1+ import requests
2+
3+ requests .packages .urllib3 .disable_warnings (requests .packages .urllib3 .exceptions .InsecureRequestWarning )
4+
5+ def format_text (title , item ):
6+ cr = '\r \n '
7+ section_break = cr + "-" * 20 + cr
8+ item = str (item )
9+ text = title + section_break + item + section_break
10+ return text
11+ r = requests .get ('https://thevillagehacker.com' , verify = False )
12+ print (format_text ('r.status_code is: ' ,r .status_code ))
13+ print (format_text ('r.text is: ' ,r .text ))
14+ print (format_text ('r.headers is: ' ,r .headers ))
15+ print (format_text ('r.cookies is: ' ,r .cookies ))
16+ print (format_text ('r.url is: ' ,r .url ))
You can’t perform that action at this time.
0 commit comments