Name | protocon JSON |
Version |
1.4.0
JSON |
| download |
home_page | https://github.com/zeroSteiner/protocon |
Summary | Protocon is a socket-centric framework for rapidly prototyping connections through simple send and receive transcripts. |
upload_time | 2024-02-17 16:11:34 |
maintainer | Spencer McIntyre |
docs_url | None |
author | Spencer McIntyre |
requires_python | |
license | BSD |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
protocon
========
Protocon is a socket-centric framework for rapidly prototyping
connections through simple send and receive commands. Think socat with
pretty hex output and more send / receive automation control.
|asciicast|
Installing
----------
Protocon requires Python 3.4+ and can be installed via pip using the
command ``python3 -m pip install protocon``.
Example Usage
-------------
Manual Mode
~~~~~~~~~~~
Starting Protocon requires a ``target_url`` argument which describes the
type of socket to open and the endpoint to connect to. Protocon will
then switch to an interactive console where various commands are
available to send and receive data.
::
user@localhost:~$ ./protocon tcp://github.com:22
[*] Loaded 4 connection drivers
[+] Initialized protocon engine v1.0 at 2017-12-22 08:13:09
[+] Connected to: tcp://github.com:22
pro > # this is a comment
pro > # next we're going to receive all the data we can read in 1 second
pro > recv_time 1
[*] RX: 22 bytes (CRC: 0xd533)
0000 53 53 48 2d 32 2e 30 2d 6c 69 62 73 73 68 5f 30 SSH-2.0-libssh_0
0010 2e 37 2e 30 0d 0a .7.0..
pro > exit
Trans(script) Mode
~~~~~~~~~~~~~~~~~~
When starting Protocon, one or more resource files containing commands
can be specified and will be executed in sequence.
::
user@localhost:~$ ./protocon udp://8.8.8.8:53 examples/dns_query.txt
[*] Loaded 4 connection drivers
[+] Initialized protocon engine v1.0 at 2017-12-22 08:26:28
[+] Connected to: udp://8.8.8.8:53
encoding - was: utf-8
now: hex
[*] TX: 55 bytes (CRC: 0xa139)
0000 37 49 01 20 00 01 00 00 00 00 00 01 03 77 77 77 7I. .........www
0010 06 67 6f 6f 67 6c 65 03 63 6f 6d 00 00 01 00 01 .google.com.....
0020 00 00 29 10 00 00 00 00 00 00 0c 00 0a 00 08 4e ..)............N
0030 c1 3b 36 79 86 a5 d5 .;6y...
[*] RX: 59 bytes (CRC: 0x5210)
0000 37 49 81 80 00 01 00 01 00 00 00 01 03 77 77 77 7I...........www
0010 06 67 6f 6f 67 6c 65 03 63 6f 6d 00 00 01 00 01 .google.com.....
0020 c0 0c 00 01 00 01 00 00 00 57 00 04 ac d9 06 e4 .........W......
0030 00 00 29 02 00 00 00 00 00 00 00 ..)........
[*] The connection has been closed
For more examples of resource files, see the `examples
directory <https://github.com/zeroSteiner/protocon/tree/master/examples>`__.
``target_url`` Examples
~~~~~~~~~~~~~~~~~~~~~~~
::
ether://eth0/?type=0x86dd&src=00:0c:29:84:05:fd&dst=33:33:00:00:00:01
null:
serial:///dev/ttyUSB0?baudrate=9600&bytesize=8&parity=N&stopbits=1
ssl://1.2.3.4:123
ssl4://5.6.7.8:567
ssl6://[fe80::800:27ff:fe00:10]:4444/?ip6-scope-id=eth0
tcp://1.2.3.4:123
tcp4://0.0.0.0:123/?type=server
tcp6://[fe80::800:27ff:fe00:10]:4444/?ip6-scope-id=eth0
udp://1.2.3.4:123
udp4://1.2.3.4:123/?size=8192
Data Expansion
--------------
Data passed by the user (such as the parameter to the ``send`` and
``recv_until`` commands) will be expanded using a basic escape sequence.
Additionally these sequences can be escaped by being prefixed with
``\``.
+------------+------------------------+
| Sequence | Description |
+============+========================+
| ``\\`` | Literal backslash |
+------------+------------------------+
| ``\n`` | New line |
+------------+------------------------+
| ``\r`` | Carrige return |
+------------+------------------------+
| ``\t`` | Tab |
+------------+------------------------+
| ``\x00`` | Literal byte ``0x00`` |
+------------+------------------------+
| ``${var}`` | Variable named ``var`` |
+------------+------------------------+
Variables
~~~~~~~~~
The expansion supports variables inserted with ``${var}``. The following
variables are defined automatically.
+------------------+---------------------------------+
| Variable Name | Description |
+==================+=================================+
| ``url.host`` | The host portion of the URL |
+------------------+---------------------------------+
| ``url.password`` | The password portion of the URL |
+------------------+---------------------------------+
| ``url.port`` | The port portion of the URL |
+------------------+---------------------------------+
| ``url.scheme`` | The scheme portion of the URL |
+------------------+---------------------------------+
| ``url.username`` | The username portion of the URL |
+------------------+---------------------------------+
Credits
-------
- Spencer McIntyre - zeroSteiner
(`@zeroSteiner <https://twitter.com/zeroSteiner>`__)
.. |asciicast| image:: https://asciinema.org/a/153917.png
:target: https://asciinema.org/a/153917
Raw data
{
"_id": null,
"home_page": "https://github.com/zeroSteiner/protocon",
"name": "protocon",
"maintainer": "Spencer McIntyre",
"docs_url": null,
"requires_python": "",
"maintainer_email": "zeroSteiner@gmail.com",
"keywords": "",
"author": "Spencer McIntyre",
"author_email": "zeroSteiner@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a4/23/e6ce513c3f8910c08c6c93ec8b9aa154bd5565b4ffa9e0e64725ab51c7e1/protocon-1.4.0.tar.gz",
"platform": null,
"description": "protocon\n========\n\nProtocon is a socket-centric framework for rapidly prototyping\nconnections through simple send and receive commands. Think socat with\npretty hex output and more send / receive automation control.\n\n|asciicast|\n\nInstalling\n----------\n\nProtocon requires Python 3.4+ and can be installed via pip using the\ncommand ``python3 -m pip install protocon``.\n\nExample Usage\n-------------\n\nManual Mode\n~~~~~~~~~~~\n\nStarting Protocon requires a ``target_url`` argument which describes the\ntype of socket to open and the endpoint to connect to. Protocon will\nthen switch to an interactive console where various commands are\navailable to send and receive data.\n\n::\n\n user@localhost:~$ ./protocon tcp://github.com:22\n [*] Loaded 4 connection drivers\n [+] Initialized protocon engine v1.0 at 2017-12-22 08:13:09\n [+] Connected to: tcp://github.com:22\n pro > # this is a comment\n pro > # next we're going to receive all the data we can read in 1 second\n pro > recv_time 1\n [*] RX: 22 bytes (CRC: 0xd533)\n 0000 53 53 48 2d 32 2e 30 2d 6c 69 62 73 73 68 5f 30 SSH-2.0-libssh_0\n 0010 2e 37 2e 30 0d 0a .7.0.. \n pro > exit\n\nTrans(script) Mode\n~~~~~~~~~~~~~~~~~~\n\nWhen starting Protocon, one or more resource files containing commands\ncan be specified and will be executed in sequence.\n\n::\n\n user@localhost:~$ ./protocon udp://8.8.8.8:53 examples/dns_query.txt \n [*] Loaded 4 connection drivers\n [+] Initialized protocon engine v1.0 at 2017-12-22 08:26:28\n [+] Connected to: udp://8.8.8.8:53\n encoding - was: utf-8\n now: hex\n [*] TX: 55 bytes (CRC: 0xa139)\n 0000 37 49 01 20 00 01 00 00 00 00 00 01 03 77 77 77 7I. .........www\n 0010 06 67 6f 6f 67 6c 65 03 63 6f 6d 00 00 01 00 01 .google.com.....\n 0020 00 00 29 10 00 00 00 00 00 00 0c 00 0a 00 08 4e ..)............N\n 0030 c1 3b 36 79 86 a5 d5 .;6y... \n [*] RX: 59 bytes (CRC: 0x5210)\n 0000 37 49 81 80 00 01 00 01 00 00 00 01 03 77 77 77 7I...........www\n 0010 06 67 6f 6f 67 6c 65 03 63 6f 6d 00 00 01 00 01 .google.com.....\n 0020 c0 0c 00 01 00 01 00 00 00 57 00 04 ac d9 06 e4 .........W......\n 0030 00 00 29 02 00 00 00 00 00 00 00 ..)........ \n [*] The connection has been closed\n\nFor more examples of resource files, see the `examples\ndirectory <https://github.com/zeroSteiner/protocon/tree/master/examples>`__.\n\n``target_url`` Examples\n~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n ether://eth0/?type=0x86dd&src=00:0c:29:84:05:fd&dst=33:33:00:00:00:01\n null:\n serial:///dev/ttyUSB0?baudrate=9600&bytesize=8&parity=N&stopbits=1\n ssl://1.2.3.4:123\n ssl4://5.6.7.8:567\n ssl6://[fe80::800:27ff:fe00:10]:4444/?ip6-scope-id=eth0\n tcp://1.2.3.4:123\n tcp4://0.0.0.0:123/?type=server\n tcp6://[fe80::800:27ff:fe00:10]:4444/?ip6-scope-id=eth0\n udp://1.2.3.4:123\n udp4://1.2.3.4:123/?size=8192\n\nData Expansion\n--------------\n\nData passed by the user (such as the parameter to the ``send`` and\n``recv_until`` commands) will be expanded using a basic escape sequence.\nAdditionally these sequences can be escaped by being prefixed with\n``\\``.\n\n+------------+------------------------+\n| Sequence | Description |\n+============+========================+\n| ``\\\\`` | Literal backslash |\n+------------+------------------------+\n| ``\\n`` | New line |\n+------------+------------------------+\n| ``\\r`` | Carrige return |\n+------------+------------------------+\n| ``\\t`` | Tab |\n+------------+------------------------+\n| ``\\x00`` | Literal byte ``0x00`` |\n+------------+------------------------+\n| ``${var}`` | Variable named ``var`` |\n+------------+------------------------+\n\nVariables\n~~~~~~~~~\n\nThe expansion supports variables inserted with ``${var}``. The following\nvariables are defined automatically.\n\n+------------------+---------------------------------+\n| Variable Name | Description |\n+==================+=================================+\n| ``url.host`` | The host portion of the URL |\n+------------------+---------------------------------+\n| ``url.password`` | The password portion of the URL |\n+------------------+---------------------------------+\n| ``url.port`` | The port portion of the URL |\n+------------------+---------------------------------+\n| ``url.scheme`` | The scheme portion of the URL |\n+------------------+---------------------------------+\n| ``url.username`` | The username portion of the URL |\n+------------------+---------------------------------+\n\nCredits\n-------\n\n- Spencer McIntyre - zeroSteiner\n (`@zeroSteiner <https://twitter.com/zeroSteiner>`__)\n\n.. |asciicast| image:: https://asciinema.org/a/153917.png\n :target: https://asciinema.org/a/153917\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Protocon is a socket-centric framework for rapidly prototyping connections through simple send and receive transcripts.",
"version": "1.4.0",
"project_urls": {
"Homepage": "https://github.com/zeroSteiner/protocon"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a423e6ce513c3f8910c08c6c93ec8b9aa154bd5565b4ffa9e0e64725ab51c7e1",
"md5": "2fb7b007024be872e47c0af91dfada9e",
"sha256": "16297ec86a7e4899f320e14afadd7d638130dfd16268f39754040328f1af33bc"
},
"downloads": -1,
"filename": "protocon-1.4.0.tar.gz",
"has_sig": false,
"md5_digest": "2fb7b007024be872e47c0af91dfada9e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18530,
"upload_time": "2024-02-17T16:11:34",
"upload_time_iso_8601": "2024-02-17T16:11:34.167257Z",
"url": "https://files.pythonhosted.org/packages/a4/23/e6ce513c3f8910c08c6c93ec8b9aa154bd5565b4ffa9e0e64725ab51c7e1/protocon-1.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-17 16:11:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zeroSteiner",
"github_project": "protocon",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "protocon"
}