Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setup.py #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
__ __
__________/ /_ ____ _________ _____ / /__
Expand Down Expand Up @@ -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
Expand Down
42 changes: 42 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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",
],
)
10 changes: 7 additions & 3 deletions sshprank.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -697,5 +701,5 @@ def main(cmdline):
if not sys.warnoptions:
warnings.simplefilter('ignore')

main(sys.argv[1:])
main()