gethandledf


Namegethandledf JSON
Version 0.11 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/gethandledf
SummaryRetrieves the list of handles using the 'handle.exe' command and return the data as a pandas DataFrame.
upload_time2023-06-01 08:53:36
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords wmic process pid handle
VCS
bugtrack_url
requirements getfilenuitkapython kthread_sleep numpy pandas subprocesskiller
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Retrieves the list of handles using the 'handle.exe' command and return the data as a pandas DataFrame.

## pip install gethandledf

### Tested against Windows 10 / Python 3.10 / Anaconda

## Python

```python
from gethandledf import get_handle_list, get_handle_list_interval
df = get_handle_list(partial_process_string="explorer.exe")
df2 = get_handle_list_interval(interval=1, partial_process_string="") # press ctrl+c when you are done


get_handle_list_interval(interval: int = 5, partial_process_string: str = "")->pd.DataFrame:
    r"""
    Continuously retrieve the list of handles at a specified interval using the 'handle.exe' command
    and return the data as a concatenated pandas DataFrame. Press ctrl+c when you want the capturing to stop

    Args:
        interval (int): The interval in seconds at which to retrieve the handle list. Defaults to 5.
        partial_process_string (str): A partial process string to filter the handles by a specific process.
            Defaults to an empty string, which retrieves handles for all processes.

    Returns:
        pd.DataFrame: A DataFrame containing information about the handles.

    Raises:
        None

    Example:
        >>> df = get_handle_list_interval(interval=1, partial_process_string="")
        >>> print(df.head())
              Process  PID               User   Handle Type ShareFlags  \
        0  System         4  NT AUTHORITY\SYSTEM  0x3f4    Key
        1  System         4  NT AUTHORITY\SYSTEM  0x6cc    Key
        2  System         4  NT AUTHORITY\SYSTEM  0x78c    Key
        3  System         4  NT AUTHORITY\SYSTEM  0x790    Key
        4  System         4  NT AUTHORITY\SYSTEM  0x7a8    Key

                          Name            AccessMask  scan_id
        0  \REGISTRY\MACHINE\BCD       0x20019           0
        1  \REGISTRY\MACHINE\BCD       0x20019           0
        2  \REGISTRY\MACHINE\BCD       0x20019           0
        3  \REGISTRY\MACHINE\BCD       0x20019           0
        4  \REGISTRY\MACHINE\BCD       0x20019           0
        ...
		

get_handle_list(partial_process_string: str = "") -> pd.DataFrame:
    r"""
    Retrieve the list of handles using the 'handle.exe' command and return the data as a pandas DataFrame.

    Args:
        partial_process_string (str): A partial process string to filter the handles by a specific process.
            Defaults to an empty string, which retrieves handles for all processes.

    Returns:
        pd.DataFrame: A DataFrame containing information about the handles.

    Raises:
        None

    Example:
        >>> df = get_handle_list(partial_process_string="explorer.exe")
        >>> print(df.head())
              Process  PID               User   Handle Type ShareFlags  \
        0  System         4  NT AUTHORITY\SYSTEM  0x3f4    Key
        1  System         4  NT AUTHORITY\SYSTEM  0x6cc    Key
        2  System         4  NT AUTHORITY\SYSTEM  0x78c    Key
        3  System         4  NT AUTHORITY\SYSTEM  0x790    Key
        4  System         4  NT AUTHORITY\SYSTEM  0x7a8    Key

                          Name            AccessMask
        0  \REGISTRY\MACHINE\BCD       0x20019
        1  \REGISTRY\MACHINE\BCD       0x20019
        2  \REGISTRY\MACHINE\BCD       0x20019
        3  \REGISTRY\MACHINE\BCD       0x20019
        4  \REGISTRY\MACHINE\BCD       0x20019
        ...		
		
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/gethandledf",
    "name": "gethandledf",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "wmic,process,pid,handle",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b5/69/27ac79ad596cfffe10aba97cf66963ab0728af74dd5ef42ec1ebd1bf6ebe/gethandledf-0.11.tar.gz",
    "platform": null,
    "description": "\r\n# Retrieves the list of handles using the 'handle.exe' command and return the data as a pandas DataFrame.\r\n\r\n## pip install gethandledf\r\n\r\n### Tested against Windows 10 / Python 3.10 / Anaconda\r\n\r\n## Python\r\n\r\n```python\r\nfrom gethandledf import get_handle_list, get_handle_list_interval\r\ndf = get_handle_list(partial_process_string=\"explorer.exe\")\r\ndf2 = get_handle_list_interval(interval=1, partial_process_string=\"\") # press ctrl+c when you are done\r\n\r\n\r\nget_handle_list_interval(interval: int = 5, partial_process_string: str = \"\")->pd.DataFrame:\r\n    r\"\"\"\r\n    Continuously retrieve the list of handles at a specified interval using the 'handle.exe' command\r\n    and return the data as a concatenated pandas DataFrame. Press ctrl+c when you want the capturing to stop\r\n\r\n    Args:\r\n        interval (int): The interval in seconds at which to retrieve the handle list. Defaults to 5.\r\n        partial_process_string (str): A partial process string to filter the handles by a specific process.\r\n            Defaults to an empty string, which retrieves handles for all processes.\r\n\r\n    Returns:\r\n        pd.DataFrame: A DataFrame containing information about the handles.\r\n\r\n    Raises:\r\n        None\r\n\r\n    Example:\r\n        >>> df = get_handle_list_interval(interval=1, partial_process_string=\"\")\r\n        >>> print(df.head())\r\n              Process  PID               User   Handle Type ShareFlags  \\\r\n        0  System         4  NT AUTHORITY\\SYSTEM  0x3f4    Key\r\n        1  System         4  NT AUTHORITY\\SYSTEM  0x6cc    Key\r\n        2  System         4  NT AUTHORITY\\SYSTEM  0x78c    Key\r\n        3  System         4  NT AUTHORITY\\SYSTEM  0x790    Key\r\n        4  System         4  NT AUTHORITY\\SYSTEM  0x7a8    Key\r\n\r\n                          Name            AccessMask  scan_id\r\n        0  \\REGISTRY\\MACHINE\\BCD       0x20019           0\r\n        1  \\REGISTRY\\MACHINE\\BCD       0x20019           0\r\n        2  \\REGISTRY\\MACHINE\\BCD       0x20019           0\r\n        3  \\REGISTRY\\MACHINE\\BCD       0x20019           0\r\n        4  \\REGISTRY\\MACHINE\\BCD       0x20019           0\r\n        ...\r\n\t\t\r\n\r\nget_handle_list(partial_process_string: str = \"\") -> pd.DataFrame:\r\n    r\"\"\"\r\n    Retrieve the list of handles using the 'handle.exe' command and return the data as a pandas DataFrame.\r\n\r\n    Args:\r\n        partial_process_string (str): A partial process string to filter the handles by a specific process.\r\n            Defaults to an empty string, which retrieves handles for all processes.\r\n\r\n    Returns:\r\n        pd.DataFrame: A DataFrame containing information about the handles.\r\n\r\n    Raises:\r\n        None\r\n\r\n    Example:\r\n        >>> df = get_handle_list(partial_process_string=\"explorer.exe\")\r\n        >>> print(df.head())\r\n              Process  PID               User   Handle Type ShareFlags  \\\r\n        0  System         4  NT AUTHORITY\\SYSTEM  0x3f4    Key\r\n        1  System         4  NT AUTHORITY\\SYSTEM  0x6cc    Key\r\n        2  System         4  NT AUTHORITY\\SYSTEM  0x78c    Key\r\n        3  System         4  NT AUTHORITY\\SYSTEM  0x790    Key\r\n        4  System         4  NT AUTHORITY\\SYSTEM  0x7a8    Key\r\n\r\n                          Name            AccessMask\r\n        0  \\REGISTRY\\MACHINE\\BCD       0x20019\r\n        1  \\REGISTRY\\MACHINE\\BCD       0x20019\r\n        2  \\REGISTRY\\MACHINE\\BCD       0x20019\r\n        3  \\REGISTRY\\MACHINE\\BCD       0x20019\r\n        4  \\REGISTRY\\MACHINE\\BCD       0x20019\r\n        ...\t\t\r\n\t\t\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Retrieves the list of handles using the 'handle.exe' command and return the data as a pandas DataFrame.",
    "version": "0.11",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/gethandledf"
    },
    "split_keywords": [
        "wmic",
        "process",
        "pid",
        "handle"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59ee1b2375ea749169be338fbde8b1eb756787fc2ed015f511acf55df4413fd4",
                "md5": "59a12f4d22c0027113ca4d5086ba9e59",
                "sha256": "81d7fd86b63c0aeb88f66bea16d27a29e25a3a71ac3d03e2995cd46e330b8996"
            },
            "downloads": -1,
            "filename": "gethandledf-0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "59a12f4d22c0027113ca4d5086ba9e59",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 771256,
            "upload_time": "2023-06-01T08:53:32",
            "upload_time_iso_8601": "2023-06-01T08:53:32.891520Z",
            "url": "https://files.pythonhosted.org/packages/59/ee/1b2375ea749169be338fbde8b1eb756787fc2ed015f511acf55df4413fd4/gethandledf-0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b56927ac79ad596cfffe10aba97cf66963ab0728af74dd5ef42ec1ebd1bf6ebe",
                "md5": "145e5525b3cfad0d07287735e91ed393",
                "sha256": "47243cf4358385de816c9348aa16a8a8fa59fd307cec7b7b8115628187b821f3"
            },
            "downloads": -1,
            "filename": "gethandledf-0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "145e5525b3cfad0d07287735e91ed393",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 770780,
            "upload_time": "2023-06-01T08:53:36",
            "upload_time_iso_8601": "2023-06-01T08:53:36.972824Z",
            "url": "https://files.pythonhosted.org/packages/b5/69/27ac79ad596cfffe10aba97cf66963ab0728af74dd5ef42ec1ebd1bf6ebe/gethandledf-0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-01 08:53:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "gethandledf",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "getfilenuitkapython",
            "specs": []
        },
        {
            "name": "kthread_sleep",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "subprocesskiller",
            "specs": []
        }
    ],
    "lcname": "gethandledf"
}
        
Elapsed time: 1.35587s