Last active
June 7, 2024 18:58
-
-
Save t94j0/244a53d63c911c6a99d1a8699f85352b to your computer and use it in GitHub Desktop.
Cool BBOT Queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all domain names, the IP associated, ASN, and open ports | |
MATCH (dns:DNS_NAME) | |
OPTIONAL MATCH (dns)-[r2]->(ip:IP_ADDRESS) | |
OPTIONAL MATCH (ip)-[r3]->(asn:ASN) | |
OPTIONAL MATCH (dns)-[r4]->(port:OPEN_TCP_PORT) | |
RETURN | |
dns.data AS Domain, | |
ip.data AS IPAddress, | |
asn.data AS ASN, | |
collect(DISTINCT TAIL(SPLIT(port.data, ':'))[0]) AS AssociatedPorts | |
# Same analysis starting with IP | |
MATCH (ip:IP_ADDRESS)-[r]->(asn:ASN) | |
OPTIONAL MATCH (dns:DNS_NAME)-[r2]->(ip) | |
OPTIONAL MATCH (ip)-[r3]->(port:OPEN_TCP_PORT) | |
RETURN | |
ip.data AS IPAddress, | |
asn.data AS ASN, | |
collect(dns.data) AS AssociatedDNSNames, | |
collect(DISTINCT TAIL(SPLIT(port.data, ':'))[0]) AS AssociatedPorts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment