{ "info": { "author": "Hugo Doria", "author_email": "hugodoria@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "HnTool\n------\n\nWhat is it?\n~~~~~~~~~~~\n\nHnTool is an open source (GPLv2) hardening tool for Unix. It scans your system for\nvulnerabilities or problems in configuration files allowing you to get a quick\noverview of the security status of your system.\n\nTo use HnTool download it and run: ::\n\n\t# ./hntool\n\nSupported systems\n~~~~~~~~~~~~~~~~~\n\nHnTool was already tested and is working on:\n\n * Arch Linux\n * CentOS\n * Debian\n * Fedora\n * Gentoo\n * Ubuntu\n\nIf you are using HnTool on a system that is not listed above, please, let us know.\n\nHow to install\n~~~~~~~~~~~~~~\n\nTo install HnTool run the following command, as root: ::\n\n\t# python setup.py install --prefix /usr/ --root /\n\nHow to use\n~~~~~~~~~~\n\nRun HnTool with: ::\n\n\t# ./hntool\n\nYou can also see the hntool(1) manual by typing 'man hntool' at the command line\nor see the usage help: ::\n\n\t$ hntool -h\n\n\nUnderstanding the output\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nThere are 5 types of results:\n\n * OK :\n\tMeans that the item checked is fine and that you do not need to worry\n\n * INFO:\n\tMeans that you should know the item status, but probably it is fine. A port\n\topened, for example.\n\n * LOW:\n\tMeans that a security problem was found, but it does not provides a high risk\n\tfor your system.\n\n * MEDIUM:\n\tThings are getting worse and you should start to worry about these itens.\n\n * HIGH:\n\tYou have an important security hole/problem on your system and you\n\tshould fix it NOW or run and save your life.\n\n\nHow can I help?\n~~~~~~~~~~~~~~~\n\nThere are several ways that you can contribute and help HnTool's development.\nYou can contribute with code, patchs, bugs and feature requests.\n\nTo report a bug or a feature request for HnTool, file a issue in our Google Code\npage: http://code.google.com/p/hntool/\n\nIf you're reporting a bug, please give concrete examples of how and where the\nproblem occurs.\n\nIf you've a patch (fixing a bug or a new HnTool module), then you can file an\nissue on Google Code too: http://code.google.com/p/hntool/issues/list\n\nHnTool's source is available on:\n\nhttp://code.google.com/p/hntool/\n\n\nHow to create a module\n~~~~~~~~~~~~~~~~~~~~~~\n\nThis section documents the innards of HnTool and specifies how to create\na new module.\n\nThe main HnTool program (hntool.py) runs a list of rules defined in __files__\nand __services__.\n\n * __files__ :\n\tdefines the rules which process simple files and configs.\n\n * __services__ :\n\tdefines the rules which checks the security on services and\n\tdaemons.\n\nOnce your module is finalized, remember to add it to the appropriate array\n(__files__ or __services__) defined in hntool/__init__.py\n\nA sample HnTool module is like this (hntool/ssh.py): ::\n\n\timport os\n\n\tclass rule:\n\t\tdef short_name(self):\n\t\t\treturn \"ssh\"\n\t\tdef long_name(self):\n\t\t\treturn \"Checks security problems on sshd config file\"\n\t\tdef __init__(self, options):\n\t\t\tpass\n\t\tdef analyze(self, options):\n\t\t\tcheck_results = {'ok': [], 'low': [], 'medium': [], 'high': [], 'info': []}\n\t\t\tssh_conf_file = ['/etc/ssh/sshd_config', '/etc/sshd_config']\n\n\t\t\tfor sshd_conf in ssh_conf_file:\n\t\t\t\tif os.path.isfile(sshd_conf):\n\t\t\t\t\ttry:\n\t\t\t\t\t\tfp = open(sshd_conf,'r')\n\t\t\t\t\texcept IOError, (errno, strerror):\n\t\t\t\t\t\tcheck_results['info'].append('Could not open %s: %s' % (sshd_conf, strerror))\n\t\t\t\t\t\tcontinue\n\n\t\t\t\t\tlines = [x.strip('\\n') for x in fp.readlines()]\n\n\t\t\t\t\t# Checking if SSH is using the default port\n\t\t\t\t\tif 'Port 22' in lines or '#Port 22' in lines:\n\t\t\t\t\t\tcheck_results['low'].append('SSH is using the default port')\n\t\t\t\t\telse:\n\t\t\t\t\t\tcheck_results['ok'].append('SSH is not using the default port')\n\n\t\t\t\t\t# Closing the sshd_config file\n\t\t\t\t\tfp.close()\n\n\t\t\t\treturn check_results\n\t\tdef type(self):\n\t\t\treturn \"files\"\n\n\nMostly, the code is self-explanatory. The following are the list of the methods\nthat each HnTool module must have:\n\n * short_name(self)\n\tReturns a string containing a short name of the module. Usually,this is the\n\tsame as the basename of the module file.\n\n * long_name(self)\n\tReturns a string containing a concise description of the module. This\n\tdescription is used when listing all the rules using hntool -l.\n\n * analyze(self)\n\tShould return a list comprising in turn of five lists: ok, low, medium,\n\thigh and info.\n\n * type(self)\n\t\"files\" for a module processing simple files and configs\n\t\"services\" for a module processing services and daemons", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://code.google.com/p/hntool/", "keywords": null, "license": "GPL-2", "maintainer": null, "maintainer_email": null, "name": "HnTool", "package_url": "https://pypi.org/project/HnTool/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/HnTool/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://code.google.com/p/hntool/" }, "release_url": "https://pypi.org/project/HnTool/0.1/", "requires_dist": null, "requires_python": null, "summary": "A hardening tool for *nixes", "version": "0.1" }, "last_serial": 165570, "releases": { "0.1": [] }, "urls": [] }