Check whether the IP is a honeypot or not.
(ip)
| 797 | @main.command() |
| 798 | @click.argument('ip', metavar='<IP address>') |
| 799 | def 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() |
nothing calls this directly
no test coverage detected