Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
rix4uni authored May 3, 2023
1 parent 11b5845 commit 4ef4be4
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions oif
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

while getopts "d:c:z:" opt; do
case $opt in
d)
domain=$OPTARG
;;
c)
CENSYS_API_ID_CENSYS_API_SECRET=$OPTARG
;;
z)
ZOOMEYE_API=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done

if [[ -z $domain || -z $CENSYS_API_ID_CENSYS_API_SECRET || -z $ZOOMEYE_API ]]
then
echo "Usage: $0 -d domain.com -c CENSYS_API_ID:CENSYS_API_SECRET -z ZOOMEYE_API"
exit 1
fi


title=$(echo "$domain" | httpx -title -server -silent)
if echo "$title" | grep -q "\[cloudflare\]"
then
echo "Website using Cloudflare:"
echo -e "$title\n"

echo "Scanning..."
shodan=$(shodan search ssl:$domain --fields ip_str,port --separator ":" | sed 's/:$//' | sed 's/:\(80\|443\)$//')
censys=$(curl -s -g -X 'GET' 'https://search.censys.io/api/v2/hosts/search?per_page=25&virtual_hosts=EXCLUDE&q=$domain' -H 'Accept: application/json' --user "$CENSYS_API_ID_CENSYS_API_SECRET" | jq -r '.result.hits[] | (.ip + ":" + (.services[] | .port | tostring))' | sed 's/:\(80\|443\)$//')
zoomeye=$(curl -s -H "API-KEY: $ZOOMEYE_API" "https://api.zoomeye.org/host/search?query=$domain&page=1" | jq -r '.matches[] | .ip + ":" + (.portinfo.port | tostring)' | grep -v "*" | sed 's/:\(80\|443\)$//')

echo $shodan $censys $zoomeye | tr ' ' '\n' | sort -u | httpx -title -server -silent
else
echo "Website not using Cloudflare:"
fi

0 comments on commit 4ef4be4

Please sign in to comment.