diff --git a/README.md b/README.md index 016564f..aa5baff 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,24 @@ -# Description +# sshprank + +## Description A fast SSH mass-scanner, login cracker and banner grabber tool using the python-masscan and shodan module. -# Usage +## Installation + +Clone the repository, make sure that you have a Python installation, change +into the `sshprank` directory and install `sshprank`. +```bash +$ git clone git@github.com:noptrix/sshprank.git +$ cd sshprank +$ python3 setup.py install --user ``` + +## Usage + +```bash [ hacker@blackarch ~ ]$ sshprank -H __ __ __________/ /_ ____ _________ _____ / /__ @@ -97,22 +110,23 @@ examples $ sshprank -b hosts.txt > sshds2.txt ``` -# Author +## Author -noptrix +[noptrix](https://github.com/noptrix) -# Notes +## Notes - quick'n'dirty code - sshprank is already packaged and available for [BlackArch Linux](https://www.blackarch.org/) - My master-branches are always stable; dev-branches are created for current work. - All of my public stuff you find are officially announced and published via [nullsecurity.net](https://www.nullsecurity.net). -# License +## License Check docs/LICENSE. -# Disclaimer +## Disclaimer + We hereby emphasize, that the hacking related stuff found on [nullsecurity.net](http://nullsecurity.net/) are only for education purposes. We are not responsible for any damages. You are responsible for your own diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fba64ea --- /dev/null +++ b/setup.py @@ -0,0 +1,42 @@ +"""Set up sshprank.""" +import os + +from setuptools import find_packages, setup + +here = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(here, "README.md"), encoding="utf-8") as readme: + long_description = readme.read() + + +setup( + name="sshprank", + version="1.2.3", + description="SSH mass-scanner, login cracker and banner grabber tool", + long_description=long_description, + long_description_content_type='text/markdown', + url="https://github.com/noptrix/sshprank", + author="noptrix", + author_email="noptrix@nullsecurity.net", + maintainer="Fabian Affolter", + maintainer_email="fabian@affolter-engineering.ch", + license="MIT", + install_requires=["paramiko", "shodan", "python-masscan"], + packages=find_packages(), + zip_safe=True, + include_package_data=True, + entry_points={"console_scripts": [" sshprank=sshprank:main"]}, + keywords="ssh scanner login cracker", + classifiers=[ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Utilities", + ], +) diff --git a/sshprank.py b/sshprank.py index 241de55..a78b389 100755 --- a/sshprank.py +++ b/sshprank.py @@ -345,7 +345,7 @@ def portscan(): log('no sshds found or network unreachable', 'error') except Exception as err: log('\n') - log(f'unknown masscan error occured: str({err})', 'error') + log(f'unknown masscan error occurred: str({err})', 'error') return m @@ -633,7 +633,11 @@ def is_root(): return False -def main(cmdline): +def main(args=None): + + if args is None: + cmdline = sys.argv[1:] + sys.stderr.write(BANNER + '\n\n') check_argc(cmdline) parse_cmdline(cmdline) @@ -697,5 +701,5 @@ def main(cmdline): if not sys.warnoptions: warnings.simplefilter('ignore') - main(sys.argv[1:]) + main()