tech-tools


Nametech-tools JSON
Version 0.2 PyPI version JSON
download
home_pageNone
SummaryBasic Local Network Tools for Technicians
upload_time2024-11-28 13:58:04
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Caleb Yourison Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords networking technician cctv
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tech-tools: Basic Functions to Assess Hosts On a Network
---
`tech-tools` is geared towards the Low Voltage Security Industry, though its design is fairly general and could have other use cases.
The basic goal is to gather information about local hosts for potential troubleshooting.  Currently, only IPv4 is supported.

This projects makes use of the OS CLI and is currently supported on Linux and Windows.
For Linux, some features may not be included by default.  This project requires the presence of `traceroute` and `network-manager`.
Please refer to your distribution's documentation, though in many cases these packages can be installed using:
```bash
sudo apt-get install traceroute
sudo apt-get install network-manager
```

**Do not use `tech-tools` (or other networking tools) unless on your own network or on a network in which you have been given permission to operate.**

#### Getting Started
---

```bash
pip install tech-tools
```

Simple examination of local network with accompany DataFrame:
```bash
from tech_tools import local_devices

my_local_network_df = local_devices()
print(my_local_network_df)

Attempting to gather information for local devices, please wait...

            ip                mac      ports       company
0    10.10.0.1  54:AF:97:2D:14:30  [80, 443]        TPLink
1    10.10.0.4  58:B9:65:14:2D:6C        NaN         Apple
2    10.10.0.7  90:09:D0:22:41:DE  [80, 443]      Synology
```

By default, the function searches for the network associated with the machine's primary interface, and on ports [80, 443] but this behavior can be easily modified for different ports or for a network on a different valid interface.

```bash
my_local_network_df = local_devices(network='192.168.0.1/26', ports = [21, 22, 5000, 8000])
```

This function assumes a valid ping, which may not be the case for all hosts.  It also relies on the local arp table, though this table may not be fully populated for all devices.  Running the function multiple times may yield different results. 

An Alternative is to scan for hosts via TCP ports.

#### Basic TCP Scanning
---

Provide a list of IPv4 Addresses and a list of ports to the TCP scanner function.
List generating functions can aid in this process.  The scanner will return a DataFrame containing hosts along with a list of ports on which they responded.

```bash
from tech_tools import tcp_ip_port_scanner

from tech_tools.utilities import generate_range_from_subnet, generate_range_from_two_ips

subnet_to_scan = generate_range_from_subnet('10.10.0.1/20')
range_of_addresses_to_scan = generate_range_from_two_ips('10.10.0.1', '10.10.0.150')
manual_list_of_addresses_to_scan = ['10.10.0.1', '10.10.0.199', '10.10.0.201', ...]

ports_to_scan = [21, 22, 80, 443, 514]

results = tcp_ip_port_scanner(subnet_to_scan, ports_to_scan)

print(results)
               ip      ports
0       10.10.0.1  [80, 443]
1      10.10.0.19      [514]
2      10.10.0.26  [22, 514]
```
The preceding demonstrations assume that your machine has an address that matches the network on which it is probing.
Sometimes packet sniffing can be a helpful starting point when very little is known about the networking environment.  You could install `pyshark` or,
as is the direction of this project, use wireshark GUI to monitor activity for a short while and export packet dissections into JSON format. 

The following functions help to extract useful information from such a JSON file.

#### Wireshark JSON Analysis
---

Using the path to a valid file, produce a list of addresses that fall under the umbrella of private/local.
Alternatively, produce a DataFrame of sniffed Mac Addresses along with their associated manufacturing company.
Larger files will require more time to process, so use good judgement when capturing packets as a few hundred frames might provide enough information.  

```bash
from tech_tools.wireshark import wireshark_private_ips, wireshark_mac_addresses

path_to_file = "/some/path/to/file.json"

local_ip_addresses = wireshark_private_ips(path_to_file)
sniffed_mac_addresses = wireshark_mac_addresses(path_to_file)

print(local_ip_addresses)
[IPv4Address('10.10.0.1'), IPv4Address('10.10.0.101'), IPv4Address('169.254.0.132'),...]

print(sniffed_mac_addresses)
              src_mac                src_mac_company
0   58:B9:65:14:2D:6C                    Apple, Inc.
1   54:AF:97:2D:14:30    TP-Link Corporation Limited
2   90:09:D0:22:41:DE          Synology Incorporated
```

## DISCLAIMER
**This project is in no way affiliated with Wireshark or any of its related services and packages. Any usage of that product is subject to its terms of use.**  

**Once again, do not use `tech-tools` or any other networking tool unless you have received permission to do so.  
This project is not responsible for any misuse or abuse, nor does it condone such practices.**

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tech-tools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "networking, technician, cctv",
    "author": null,
    "author_email": "Caleb Yourison <caleb.yourison@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/f2/cb/069d1b254a3219560c5cc7028425e6aae92e58df8aefe836d60d17ed96a6/tech_tools-0.2.tar.gz",
    "platform": null,
    "description": "# tech-tools: Basic Functions to Assess Hosts On a Network\n---\n`tech-tools` is geared towards the Low Voltage Security Industry, though its design is fairly general and could have other use cases.\nThe basic goal is to gather information about local hosts for potential troubleshooting.  Currently, only IPv4 is supported.\n\nThis projects makes use of the OS CLI and is currently supported on Linux and Windows.\nFor Linux, some features may not be included by default.  This project requires the presence of `traceroute` and `network-manager`.\nPlease refer to your distribution's documentation, though in many cases these packages can be installed using:\n```bash\nsudo apt-get install traceroute\nsudo apt-get install network-manager\n```\n\n**Do not use `tech-tools` (or other networking tools) unless on your own network or on a network in which you have been given permission to operate.**\n\n#### Getting Started\n---\n\n```bash\npip install tech-tools\n```\n\nSimple examination of local network with accompany DataFrame:\n```bash\nfrom tech_tools import local_devices\n\nmy_local_network_df = local_devices()\nprint(my_local_network_df)\n\nAttempting to gather information for local devices, please wait...\n\n            ip                mac      ports       company\n0    10.10.0.1  54:AF:97:2D:14:30  [80, 443]        TPLink\n1    10.10.0.4  58:B9:65:14:2D:6C        NaN         Apple\n2    10.10.0.7  90:09:D0:22:41:DE  [80, 443]      Synology\n```\n\nBy default, the function searches for the network associated with the machine's primary interface, and on ports [80, 443] but this behavior can be easily modified for different ports or for a network on a different valid interface.\n\n```bash\nmy_local_network_df = local_devices(network='192.168.0.1/26', ports = [21, 22, 5000, 8000])\n```\n\nThis function assumes a valid ping, which may not be the case for all hosts.  It also relies on the local arp table, though this table may not be fully populated for all devices.  Running the function multiple times may yield different results. \n\nAn Alternative is to scan for hosts via TCP ports.\n\n#### Basic TCP Scanning\n---\n\nProvide a list of IPv4 Addresses and a list of ports to the TCP scanner function.\nList generating functions can aid in this process.  The scanner will return a DataFrame containing hosts along with a list of ports on which they responded.\n\n```bash\nfrom tech_tools import tcp_ip_port_scanner\n\nfrom tech_tools.utilities import generate_range_from_subnet, generate_range_from_two_ips\n\nsubnet_to_scan = generate_range_from_subnet('10.10.0.1/20')\nrange_of_addresses_to_scan = generate_range_from_two_ips('10.10.0.1', '10.10.0.150')\nmanual_list_of_addresses_to_scan = ['10.10.0.1', '10.10.0.199', '10.10.0.201', ...]\n\nports_to_scan = [21, 22, 80, 443, 514]\n\nresults = tcp_ip_port_scanner(subnet_to_scan, ports_to_scan)\n\nprint(results)\n               ip      ports\n0       10.10.0.1  [80, 443]\n1      10.10.0.19      [514]\n2      10.10.0.26  [22, 514]\n```\nThe preceding demonstrations assume that your machine has an address that matches the network on which it is probing.\nSometimes packet sniffing can be a helpful starting point when very little is known about the networking environment.  You could install `pyshark` or,\nas is the direction of this project, use wireshark GUI to monitor activity for a short while and export packet dissections into JSON format. \n\nThe following functions help to extract useful information from such a JSON file.\n\n#### Wireshark JSON Analysis\n---\n\nUsing the path to a valid file, produce a list of addresses that fall under the umbrella of private/local.\nAlternatively, produce a DataFrame of sniffed Mac Addresses along with their associated manufacturing company.\nLarger files will require more time to process, so use good judgement when capturing packets as a few hundred frames might provide enough information.  \n\n```bash\nfrom tech_tools.wireshark import wireshark_private_ips, wireshark_mac_addresses\n\npath_to_file = \"/some/path/to/file.json\"\n\nlocal_ip_addresses = wireshark_private_ips(path_to_file)\nsniffed_mac_addresses = wireshark_mac_addresses(path_to_file)\n\nprint(local_ip_addresses)\n[IPv4Address('10.10.0.1'), IPv4Address('10.10.0.101'), IPv4Address('169.254.0.132'),...]\n\nprint(sniffed_mac_addresses)\n              src_mac                src_mac_company\n0   58:B9:65:14:2D:6C                    Apple, Inc.\n1   54:AF:97:2D:14:30    TP-Link Corporation Limited\n2   90:09:D0:22:41:DE          Synology Incorporated\n```\n\n## DISCLAIMER\n**This project is in no way affiliated with Wireshark or any of its related services and packages. Any usage of that product is subject to its terms of use.**  \n\n**Once again, do not use `tech-tools` or any other networking tool unless you have received permission to do so.  \nThis project is not responsible for any misuse or abuse, nor does it condone such practices.**\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Caleb Yourison  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  ",
    "summary": "Basic Local Network Tools for Technicians",
    "version": "0.2",
    "project_urls": null,
    "split_keywords": [
        "networking",
        " technician",
        " cctv"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be4764d8abc83d9613518f0e290e6e0a8f1dac20f4c343cc050c7e764c0e8a0c",
                "md5": "06666e5fc05ce3431c6d05e105b6787b",
                "sha256": "a6dedbeccf7c52a96b73a9871125c1126e2c8f35e89fad5820eee191117b2109"
            },
            "downloads": -1,
            "filename": "tech_tools-0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "06666e5fc05ce3431c6d05e105b6787b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 757096,
            "upload_time": "2024-11-28T13:58:00",
            "upload_time_iso_8601": "2024-11-28T13:58:00.193487Z",
            "url": "https://files.pythonhosted.org/packages/be/47/64d8abc83d9613518f0e290e6e0a8f1dac20f4c343cc050c7e764c0e8a0c/tech_tools-0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2cb069d1b254a3219560c5cc7028425e6aae92e58df8aefe836d60d17ed96a6",
                "md5": "e62e5d2e07f64dafff69d92a52635a91",
                "sha256": "13a6a455eafc2e7967d19269db7e3bfa10ded2e7cd99433fa5c35b1aed02ef43"
            },
            "downloads": -1,
            "filename": "tech_tools-0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e62e5d2e07f64dafff69d92a52635a91",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8406526,
            "upload_time": "2024-11-28T13:58:04",
            "upload_time_iso_8601": "2024-11-28T13:58:04.587464Z",
            "url": "https://files.pythonhosted.org/packages/f2/cb/069d1b254a3219560c5cc7028425e6aae92e58df8aefe836d60d17ed96a6/tech_tools-0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-28 13:58:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "tech-tools"
}
        
Elapsed time: 0.44815s