pydnst


Namepydnst JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://github.com/mori-b/pydnst
SummaryDNS Tunneling client and server
upload_time2023-07-23 04:16:01
maintainer
docs_urlNone
authorMori Benech
requires_python>=3.6
license
keywords dns tunneling dns tunneling
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pydnst
**DNS Tunneling client and server in Python**

<a name="installation"></a>
## INSTALLATION

    pip3 install pydnst
    
For convenience the client, server, and c2 are in the same package, however the "rich" dependency is only used by the c2 module.

<a name="features"></a>
## FEATURES

pydnst is a DNS tunneling implementation in Python, supporting Linux only (the client might require a few paths tweaks to run on Windows).  
A simple rich interface on the server side enables to send commands to specific clients, and watch the responses in real-time.  
The client sends keep-alive requests every 30 seconds. If the server has a command to send to a specific client, it sends it in response to a keep-alive. Then the client sends other queries containing the command response.  
The server can manage up to 250 clients, communication is encrypted with a unique Fernet key per client, generated on the fly and shared using RSA encryption.  
The client being implemented in Python is not stealth, and intentionally exposes its hostname in clear text (you can tweak that).  

![alt text](https://github.com/mori-b/pydnst/assets/22458480/fbd0e97c-2030-467b-94e0-b0943f1a9b1a)

<a name="setup"></a>
## SET UP

First acquire access to a machine with a public IP, this is where the pydnst server will run.  
Then acquire a DNS name, as short as possible, and configure its nameservers with glue records pointing to your public IP.  
You can then configure your pydnst.toml field DNST_SERVER_NAME, and run pydnst server on your public machine, and pydnst client on your victim machine.  
Of course you can also experiment with it in a local environment similarly configured.  


<a name="usage"></a>
## USAGE

### Install the pydnst package on client and server

    pip3 install pydnst
    python3 -m pydnst --help
    
### Generate certificates (recommended), to encrypt the shared key transfer between client and server
This creates server_private.pem (copy to server) and server_public.pem (copy to client).
After copying server_private.pem to server, don't forget to chmod 600.

    python3 -m pydnst create_certificates
    
### Generate configuration
This creates pydnst.toml : edit if needed and then copy to client and server.  
On client, edit the MAIN_INTERFACE to use the DNS server of this interface, or DNS_SERVER_ADDRESS to circumvent it.  
On server, edit the LISTENING_INTERFACE.  
On both, specify the DNST_SERVER_NAME (the DNS name purchased).  

    python3 -m pydnst config
    
### On server
In one terminal, run the server (pydnst.toml must be in the current directory) :   
Logs are under pydnst.log  

    python3 -m pydnst server run
    
In another terminal, run the c2 commander (pydnst.toml must be in the current directory), which enables to send commands and watch responses in real-time.  

    python3 -m pydnst server c2
    
### On client
In one terminal, run the client (pydnst.toml must be in the current directory) :   
Logs are under pydnst.log  

    python3 -m pydnst client run


    



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mori-b/pydnst",
    "name": "pydnst",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "dns,tunneling,dns tunneling",
    "author": "Mori Benech",
    "author_email": "moribirom@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fe/24/fa7f331c7558bd0bbe35094db0ff11a699ea6680cfe2552d343e5e5b692d/pydnst-1.0.4.tar.gz",
    "platform": null,
    "description": "# pydnst\n**DNS Tunneling client and server in Python**\n\n<a name=\"installation\"></a>\n## INSTALLATION\n\n    pip3 install pydnst\n    \nFor convenience the client, server, and c2 are in the same package, however the \"rich\" dependency is only used by the c2 module.\n\n<a name=\"features\"></a>\n## FEATURES\n\npydnst is a DNS tunneling implementation in Python, supporting Linux only (the client might require a few paths tweaks to run on Windows).  \nA simple rich interface on the server side enables to send commands to specific clients, and watch the responses in real-time.  \nThe client sends keep-alive requests every 30 seconds. If the server has a command to send to a specific client, it sends it in response to a keep-alive. Then the client sends other queries containing the command response.  \nThe server can manage up to 250 clients, communication is encrypted with a unique Fernet key per client, generated on the fly and shared using RSA encryption.  \nThe client being implemented in Python is not stealth, and intentionally exposes its hostname in clear text (you can tweak that).  \n\n![alt text](https://github.com/mori-b/pydnst/assets/22458480/fbd0e97c-2030-467b-94e0-b0943f1a9b1a)\n\n<a name=\"setup\"></a>\n## SET UP\n\nFirst acquire access to a machine with a public IP, this is where the pydnst server will run.  \nThen acquire a DNS name, as short as possible, and configure its nameservers with glue records pointing to your public IP.  \nYou can then configure your pydnst.toml field DNST_SERVER_NAME, and run pydnst server on your public machine, and pydnst client on your victim machine.  \nOf course you can also experiment with it in a local environment similarly configured.  \n\n\n<a name=\"usage\"></a>\n## USAGE\n\n### Install the pydnst package on client and server\n\n    pip3 install pydnst\n    python3 -m pydnst --help\n    \n### Generate certificates (recommended), to encrypt the shared key transfer between client and server\nThis creates server_private.pem (copy to server) and server_public.pem (copy to client).\nAfter copying server_private.pem to server, don't forget to chmod 600.\n\n    python3 -m pydnst create_certificates\n    \n### Generate configuration\nThis creates pydnst.toml : edit if needed and then copy to client and server.  \nOn client, edit the MAIN_INTERFACE to use the DNS server of this interface, or DNS_SERVER_ADDRESS to circumvent it.  \nOn server, edit the LISTENING_INTERFACE.  \nOn both, specify the DNST_SERVER_NAME (the DNS name purchased).  \n\n    python3 -m pydnst config\n    \n### On server\nIn one terminal, run the server (pydnst.toml must be in the current directory) :   \nLogs are under pydnst.log  \n\n    python3 -m pydnst server run\n    \nIn another terminal, run the c2 commander (pydnst.toml must be in the current directory), which enables to send commands and watch responses in real-time.  \n\n    python3 -m pydnst server c2\n    \n### On client\nIn one terminal, run the client (pydnst.toml must be in the current directory) :   \nLogs are under pydnst.log  \n\n    python3 -m pydnst client run\n\n\n    \n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "DNS Tunneling client and server",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/mori-b/pydnst"
    },
    "split_keywords": [
        "dns",
        "tunneling",
        "dns tunneling"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "274de9c3dedda578be542c196585a471ab3406b0318d641578373596eee810de",
                "md5": "ddb529f9d8000c137c928143fcb5488e",
                "sha256": "b3639344d679b8ba07872220539cf55faef253718eb43d36b6a94341b38b6306"
            },
            "downloads": -1,
            "filename": "pydnst-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ddb529f9d8000c137c928143fcb5488e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 26068,
            "upload_time": "2023-07-23T04:15:57",
            "upload_time_iso_8601": "2023-07-23T04:15:57.019866Z",
            "url": "https://files.pythonhosted.org/packages/27/4d/e9c3dedda578be542c196585a471ab3406b0318d641578373596eee810de/pydnst-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fe24fa7f331c7558bd0bbe35094db0ff11a699ea6680cfe2552d343e5e5b692d",
                "md5": "f0d9afb5e42a87066300410ce1fe75a2",
                "sha256": "940ff46be1e10af6473b00b92c1ce269a26c5150273340718c99600dee6b582e"
            },
            "downloads": -1,
            "filename": "pydnst-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "f0d9afb5e42a87066300410ce1fe75a2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 26302,
            "upload_time": "2023-07-23T04:16:01",
            "upload_time_iso_8601": "2023-07-23T04:16:01.719461Z",
            "url": "https://files.pythonhosted.org/packages/fe/24/fa7f331c7558bd0bbe35094db0ff11a699ea6680cfe2552d343e5e5b692d/pydnst-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-23 04:16:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mori-b",
    "github_project": "pydnst",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pydnst"
}
        
Elapsed time: 0.18434s