INNER CODE UNIT · Python
shodan
montysecurity/C2-Tracker · tracker.py:6
def shodan():
api_key = os.environ["SHODAN_API_KEY"].strip()
api = Shodan(api_key)
# https://michaelkoczwara.medium.com/hunting-c2-with-shodan-223ca250d06f
# https://michaelkoczwara.medium.com/cobalt-strike-c2-hunting-with-shodan-c448d501a6e2
# https://twitter.com/MichalKoczwara/status/1591750513238118401?cxt=HHwWgsDUiZGqhJcsAAAA
# https://github.com/BushidoUK/OSINT-SearchOperators/blob/main/ShodanAdversaryInfa.md
# https://twitter.com/MichalKoczwara/status/1641119242618650653
# https://twitter.com/MichalKoczwara/status/1641676761283850241
queries = {
"Cobalt Strike C2": [
"ssl.cert.serial:146473198",
"hash:-2007783223 port:50050",
"product:'Cobalt Strike Beacon'",
"ssl:foren.zik"
],
"Metasploit Framework C2": [
"ssl:MetasploitSelfSignedCA",