Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
v2.1.6 - Use black code formatting, remove t1shopper, discontinue doc…
Browse files Browse the repository at this point in the history
…ker, and misc edits
  • Loading branch information
vesche committed Feb 8, 2022
1 parent d775b0c commit 6e083d7
Show file tree
Hide file tree
Showing 7 changed files with 212 additions and 234 deletions.
4 changes: 0 additions & 4 deletions Dockerfile

This file was deleted.

29 changes: 1 addition & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This is a Python 3 command-line utility and library for using websites that can
* [ipfingerprints](http://www.ipfingerprints.com/portscan.php)
* [spiderip](https://spiderip.com/online-port-scan.php)
* [standingtech](https://portscanner.standingtech.com/)
* [t1shopper](http://www.t1shopper.com/tools/port-scan/)
* [viewdns](http://viewdns.info/)
* [yougetsignal](http://www.yougetsignal.com/tools/open-ports/)

Expand Down Expand Up @@ -47,13 +46,12 @@ $ scanless --list
| ipfingerprints | https://www.ipfingerprints.com |
| spiderip | https://spiderip.com |
| standingtech | https://portscanner.standingtech.com |
| t1shopper | http://www.t1shopper.com |
| viewdns | https://viewdns.info |
| yougetsignal | https://www.yougetsignal.com |
+----------------+--------------------------------------+
$ scanless -t scanme.nmap.org -s spiderip
Running scanless v2.1.4...
Running scanless v2.1.6...
spiderip:
PORT STATE SERVICE
Expand Down Expand Up @@ -123,28 +121,3 @@ Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
}
]
```

## Docker

**Note from the repo author:** I did not create, nor do I maintain Docker support or the Dockerfile for scanless. It was a nice community addition. If it's broken please open an issue or submit a pull request and I'll take a look. Thank you!

### Build

To build the Docker image, run:
```shell
$ docker build -t scanless .
```

### Usage

To use the Docker image previously created, run the following with whichever options you want like `--help`:
```
$ docker run --rm -it scanless --help
```

If that long command is too troublesome, you can make an alias like so: `alias scanless="docker run --rm -it scanless"` and then run `scanless` as you would normally:
```
$ scanless --help
$ scanless -l
$ scanless -t scanme.nmap.org -s yougetsignal
```
6 changes: 2 additions & 4 deletions scanless/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"""scanless"""

# _____ __ ____ ____ _ ___ _____ _____
# / ___/ / ] / || \ | | / _]/ ___// ___/
# ( \_ / / | o || _ || | / [_( \_( \_
# ( \_ / / | o || _ || | / [_( \_( \_
# \__ |/ / | || | || |___ | _]\__ |\__ |
# / \ / \_ | _ || | || || [_ / \ |/ \ |
# \ \ || | || | || || |\ |\ |
# \___|\____||__|__||__|__||_____||_____| \___| \___|

from scanless.core import Scanless
from scanless.core import Scanless
101 changes: 52 additions & 49 deletions scanless/cli.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""scanless.cli"""

import crayons
import argparse

from random import choice
from scanless.core import Scanless

SCAN_LIST = '''\
SCAN_LIST = """\
+----------------+--------------------------------------+
| Scanner Name | Website |
+----------------+--------------------------------------+
Expand All @@ -15,68 +13,73 @@
| pingeu | https://ping.eu |
| spiderip | https://spiderip.com |
| standingtech | https://portscanner.standingtech.com |
| t1shopper | http://www.t1shopper.com |
| viewdns | https://viewdns.info |
| yougetsignal | https://www.yougetsignal.com |
+----------------+--------------------------------------+'''
VERSION = '2.1.5'
+----------------+--------------------------------------+"""
VERSION = "2.1.6"

sl = Scanless(cli_mode=True)


def get_parser():
parser = argparse.ArgumentParser(
description='scanless, an online port scan scraper.'
description="scanless, an online port scan scraper."
)
parser.add_argument(
'-v', '--version',
action='store_true',
help='display the current version'
"-v",
"--version",
action="store_true",
help="display the current version"
)
parser.add_argument(
'-t', '--target',
help='ip or domain to scan',
"-t",
"--target",
help="ip or domain to scan",
type=str
)
parser.add_argument(
'-s', '--scanner',
default='hackertarget',
help='scanner to use (default: hackertarget)',
type=str
"-s",
"--scanner",
default="hackertarget",
help="scanner to use (default: hackertarget)",
type=str,
)
parser.add_argument(
'-r', '--random',
action='store_true',
help='use a random scanner'
"-r",
"--random",
action="store_true",
help="use a random scanner"
)
parser.add_argument(
'-l', '--list',
action='store_true',
help='list scanners'
)
"-l",
"--list",
action="store_true",
help="list scanners")
parser.add_argument(
'-a', '--all',
action='store_true',
help='use all the scanners'
"-a",
"--all",
action="store_true",
help="use all the scanners"
)
parser.add_argument(
'-d', '--debug',
action='store_true',
help='debug mode (cli mode off & show network errors)'
"-d",
"--debug",
action="store_true",
help="debug mode (cli mode off & show network errors)",
)
return parser


def display(results):
for line in results.split('\n'):
for line in results.split("\n"):
if not line:
continue
elif 'tcp' in line or 'udp' in line:
if 'open' in line:
elif "tcp" in line or "udp" in line:
if "open" in line:
line = crayons.green(line)
elif 'closed' in line:
elif "closed" in line:
line = crayons.red(line)
elif 'filtered' in line:
elif "filtered" in line:
line = crayons.yellow(line)
print(line)

Expand All @@ -85,39 +88,39 @@ def main():
parser = get_parser()
args = vars(parser.parse_args())

if args['version']:
print(f'v{VERSION}')
if args["version"]:
print(f"v{VERSION}")
return

if args['list']:
if args["list"]:
print(SCAN_LIST)
return

if not args['target']:
if not args["target"]:
parser.print_help()
return

if args['debug']:
if args["debug"]:
sl.cli_mode = False

target = args['target']
scanner = args['scanner'].lower()
target = args["target"]
scanner = args["scanner"].lower()

print(f'Running scanless v{VERSION}...\n')
print(f"Running scanless v{VERSION}...\n")
scanners = sl.scanners.keys()

if args['all']:
if args["all"]:
for s in scanners:
print(f'{s}:')
display(sl.scan(target, scanner=s)['raw'])
print(f"{s}:")
display(sl.scan(target, scanner=s)["raw"])
print()
return

if args['random']:
if args["random"]:
scanner = choice(list(scanners))

if scanner in scanners:
print(f'{scanner}:')
display(sl.scan(target, scanner=scanner)['raw'])
print(f"{scanner}:")
display(sl.scan(target, scanner=scanner)["raw"])
else:
print('Scanner not found, see --list to view all supported scanners.')
print("Scanner not found, see --list to view all supported scanners.")
Loading

0 comments on commit 6e083d7

Please sign in to comment.