# psex
A simple, fast and powerful password scanner engine tool was built by antx.
## Description
psex is a simple, fast and powerful password scanner engine tool was built by antx. psex also
support some useful features, which like fofa search and parse assets to verify. psex has been built in some weak username and password.
## Install
```bash
pip3 install psex
```
## Usage
### PSE Sample:
```python
# Title: xxxxxxx
# Author: antx-code
# Email: 7877940+antx-code@users.noreply.github.com
from loguru import logger
from redis import Redis
from psex import ScannerEngine
from psex.funcs.assetio import AssetIO
from psex.weaks import weak_passwords
class Scanner(ScannerEngine):
def __init__(self):
super(Scanner, self).__init__()
@logger.catch(level='ERROR')
def is_connected(self, connection):
"""
check if the connection is connected.
"""
try:
connection.ping()
return True
except Exception as e:
return False
@logger.catch(level='ERROR')
def create_connect(self, *args):
"""
create a connection.
"""
connection = Redis(host=args[0], port=args[1], password=args[3], db=0, socket_connect_timeout=self.timeout,
socket_timeout=self.timeout)
return connection
@logger.catch(level='ERROR')
def dia(self):
asset_io = AssetIO()
ips = asset_io.get_file_assets('input/source_redis.csv')
"""
or use fofa search and parse assets to verify.
grammar = 'xxx'
api_key='xxxxxxxxxxxxxxxxxxxxxx'
api_email='xxxx@email.com'
ips = asset_io.get_fofa_assets(grammar, api_key, api_email, 'fofa_redis.csv')
"""
passwords = weak_passwords('redis')
for password in passwords:
for ip_port in ips:
ip_port = ip_port.strip()
ip = ip_port.split(':')[0]
port = int(ip_port.split(':')[1])
logger.debug(f'Connecting to {ip} ......')
logger.warning(f'Testing {ip_port} with password: "{password}" !')
result = self.poc(ip, port, '', password)
if result:
asset_io.save2file('redis_success', ip, port, '', password)
if __name__ == '__main__':
ds = Scanner()
ds.dia()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/antx-code/psex",
"name": "psex",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "poc,engine,psex,database,weak password",
"author": "antx-code",
"author_email": "wkaifeng2007@163.com",
"download_url": "https://files.pythonhosted.org/packages/bd/1b/74c1ecaf3d882e2cf27865ddbb0724fb798124aaa1ff9020b8ce774b6d32/psex-0.1.4.tar.gz",
"platform": null,
"description": "# psex\nA simple, fast and powerful password scanner engine tool was built by antx.\n\n## Description\npsex is a simple, fast and powerful password scanner engine tool was built by antx. psex also \nsupport some useful features, which like fofa search and parse assets to verify. psex has been built in some weak username and password. \n\n## Install\n\n```bash\npip3 install psex\n```\n\n## Usage\n\n### PSE Sample:\n\n```python\n# Title: xxxxxxx\n# Author: antx-code\n# Email: 7877940+antx-code@users.noreply.github.com\n\nfrom loguru import logger\nfrom redis import Redis\nfrom psex import ScannerEngine\nfrom psex.funcs.assetio import AssetIO\nfrom psex.weaks import weak_passwords\n\n\nclass Scanner(ScannerEngine):\n def __init__(self):\n super(Scanner, self).__init__()\n\n @logger.catch(level='ERROR')\n def is_connected(self, connection):\n \"\"\"\n check if the connection is connected.\n \"\"\"\n try:\n connection.ping()\n return True\n except Exception as e:\n return False\n\n @logger.catch(level='ERROR')\n def create_connect(self, *args):\n \"\"\"\n \n create a connection.\n \n \"\"\"\n connection = Redis(host=args[0], port=args[1], password=args[3], db=0, socket_connect_timeout=self.timeout,\n socket_timeout=self.timeout)\n return connection\n\n @logger.catch(level='ERROR')\n def dia(self):\n asset_io = AssetIO()\n ips = asset_io.get_file_assets('input/source_redis.csv')\n \"\"\"\n \n or use fofa search and parse assets to verify.\n \n grammar = 'xxx'\n api_key='xxxxxxxxxxxxxxxxxxxxxx'\n api_email='xxxx@email.com'\n ips = asset_io.get_fofa_assets(grammar, api_key, api_email, 'fofa_redis.csv')\n \n \"\"\"\n \n passwords = weak_passwords('redis')\n for password in passwords:\n for ip_port in ips:\n ip_port = ip_port.strip()\n ip = ip_port.split(':')[0]\n port = int(ip_port.split(':')[1])\n logger.debug(f'Connecting to {ip} ......')\n logger.warning(f'Testing {ip_port} with password: \"{password}\" !')\n result = self.poc(ip, port, '', password)\n if result:\n asset_io.save2file('redis_success', ip, port, '', password)\n\n\nif __name__ == '__main__':\n ds = Scanner()\n ds.dia()\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple, fast and powerful password scanner engine tool was built by antx.",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/antx-code/psex",
"Repository": "https://github.com/antx-code/psex"
},
"split_keywords": [
"poc",
"engine",
"psex",
"database",
"weak password"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1c77a877b56a42e8536cf61b94940054578e44a832415a8412d696f6876e0f9c",
"md5": "3ab83807a618f1801aae1adf8d99d735",
"sha256": "3a0a7415aa086556c81a6c8a6736faa8fa6e4de282b9dfb6f2c33c9ac46104ca"
},
"downloads": -1,
"filename": "psex-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3ab83807a618f1801aae1adf8d99d735",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 7628,
"upload_time": "2023-07-04T03:14:46",
"upload_time_iso_8601": "2023-07-04T03:14:46.543638Z",
"url": "https://files.pythonhosted.org/packages/1c/77/a877b56a42e8536cf61b94940054578e44a832415a8412d696f6876e0f9c/psex-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bd1b74c1ecaf3d882e2cf27865ddbb0724fb798124aaa1ff9020b8ce774b6d32",
"md5": "8ee073e70fa68fb20131d9a1c5cde0b5",
"sha256": "a78b8cc9742f572d70d892dd54dcd04553264c18a162e70276ec50a5aa30b8e8"
},
"downloads": -1,
"filename": "psex-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "8ee073e70fa68fb20131d9a1c5cde0b5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 5840,
"upload_time": "2023-07-04T03:14:49",
"upload_time_iso_8601": "2023-07-04T03:14:49.088399Z",
"url": "https://files.pythonhosted.org/packages/bd/1b/74c1ecaf3d882e2cf27865ddbb0724fb798124aaa1ff9020b8ce774b6d32/psex-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-04 03:14:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "antx-code",
"github_project": "psex",
"travis_ci": false,
"coveralls": true,
"github_actions": false,
"lcname": "psex"
}