MCPcopy Create free account
hub / github.com/achillean/shodan-python / honeyscore

Function honeyscore

shodan/__main__.py:799–816  ·  view source on GitHub ↗

Check whether the IP is a honeypot or not.

(ip)

Source from the content-addressed store, hash-verified

797@main.command()
798@click.argument('ip', metavar='<IP address>')
799def honeyscore(ip):
800 """Check whether the IP is a honeypot or not."""
801 key = get_api_key()
802 api = shodan.Shodan(key)
803
804 try:
805 score = api.labs.honeyscore(ip)
806
807 if score == 1.0:
808 click.echo(click.style('Honeypot detected', fg='red'))
809 elif score > 0.5:
810 click.echo(click.style('Probably a honeypot', fg='yellow'))
811 else:
812 click.echo(click.style('Not a honeypot', fg='green'))
813
814 click.echo('Score: {}'.format(score))
815 except Exception:
816 raise click.ClickException('Unable to calculate honeyscore')
817
818
819@main.command()

Callers

nothing calls this directly

Calls 2

get_api_keyFunction · 0.90
honeyscoreMethod · 0.80

Tested by

no test coverage detected