Skip to content

Commit

Permalink
Merge branch 'platforms'
Browse files Browse the repository at this point in the history
This marks a huge step in pwncat. We're finally merging
the platforms branch. The API has completely changed at
this point. I've bumped the version number in setup.py
and tagged the old version appropriately. The
readthedocs stable page will still point to the old
API while latest should provide documentation on the
updated API.
  • Loading branch information
calebstewart committed Jun 2, 2021
2 parents 0f341b4 + dc79ec4 commit 3f799dd
Show file tree
Hide file tree
Showing 249 changed files with 16,920 additions and 11,368 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
ignore=E501,E123,E121,E126,E133,W505,W503,W504
exclude=.git,__pycache__,pwncat.egg-info,env,dist,build,data,docs,tests
18 changes: 17 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ on:
jobs:
testing:
runs-on: ubuntu-latest

strategy:
matrix:
python-versions: [3.8,3.9]

services:
centos:
image: calebjstewart/pwncat-testing:centos
ports:
- 4444:4444
ubuntu:
image: calebjstewart/pwncat-testing:ubuntu
ports:
- 4445:4444

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -20,10 +31,15 @@ jobs:
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt
python setup.py install
python setup.py install --user
# - name: Lint with flake8
# run: |
# flake8
- name: Test with pytest
env:
CENTOS_HOST: "127.0.0.1"
CENTOS_BIND_PORT: "4444"
UBUNTU_HOST: "127.0.0.1"
UBUNTU_BIND_PORT: "4445"
run: |
pytest
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ data/pwncat.sqlite-journal
pwncat.sqlite-journal
linpeas.txt
NOTES.md

db/pwncat*
windows/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ refer to the documentation for up to date usage and API documentation!
pwncat [documentation] is being built out on Read the Docs. Head there for
the latest usage and development documentation!

**pwncat requires Python 3.9+.**

## Modules

Recently, the architecture of the pwncat framework was redesigned to
Expand Down
5 changes: 2 additions & 3 deletions data/pwncatrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ set -g lhost "127.0.0.1"
# Set your command prefix
set -g prefix c-k
# Set the default private key to use for privilege escalation
set -g privkey "data/pwncat"
set -g privkey "data/pwncat"
# Set the pwncat backdoor user and password
set -g backdoor_user "pwncat"
set -g backdoor_pass "pwncat"
set -g db "sqlite:///pwncat.sqlite"
set -g db "file://db/pwncat"

set -g on_load {
# Run a command upon a stable connection
Expand All @@ -27,4 +27,3 @@ alias down download
# "!ls" run "local ls" given the below directives
shortcut ! local
shortcut @ run

File renamed without changes.
9 changes: 9 additions & 0 deletions docs/apidoc/module.rst_t
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{%- if show_headings %}
{{- [basename, "module"] | join(' ') | e | heading }}

{% endif -%}
.. automodule:: {{ qualname }}
{%- for option in automodule_options %}
:{{ option }}:
{%- endfor %}

34 changes: 34 additions & 0 deletions docs/apidoc/package.rst_t
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{%- macro automodule(modname, options) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
:{{ option }}:
{%- endfor %}
{%- endmacro %}

{%- macro toctree(docnames) -%}
.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
{%- endmacro %}

{%- if pkgname == "pwncat" %}
{{- "API Documentation" | e | heading }}
{% else %}
{%- if is_namespace %}
{{- [pkgname, "namespace"] | join(" ") | e | heading }}
{% else %}
{{- [pkgname, "package"] | join(" ") | e | heading }}
{% endif %}
{% endif %}

{%- if modulefirst and not is_namespace %}
{{ automodule(pkgname, automodule_options) }}
{% endif %}

{%- if (subpackages+submodules) %}
Modules and Packages
--------------------
{{ toctree(subpackages+submodules) }}
{% endif %}
57 changes: 57 additions & 0 deletions docs/apidoc/package.rst_t.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{%- macro automodule(modname, options) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
:{{ option }}:
{%- endfor %}
{%- endmacro %}

{%- macro toctree(docnames) -%}
.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
{%- endmacro %}

{%- if pkgname == "pwncat" %}
{{- "API Documentation" | e | heading }}
{% else %}
{%- if is_namespace %}
{{- [pkgname, "namespace"] | join(" ") | e | heading }}
{% else %}
{{- [pkgname, "package"] | join(" ") | e | heading }}
{% endif %}
{% endif %}

{%- if modulefirst and not is_namespace %}
{{ automodule(pkgname, automodule_options) }}
{% endif %}

{%- if subpackages %}
Subpackages
-----------

{{ toctree(subpackages) }}
{% endif %}

{%- if submodules %}
Submodules
----------
{% if separatemodules %}
{{ toctree(submodules) }}
{% else %}
{%- for submodule in submodules %}
{% if show_headings %}
{{- [submodule, "module"] | join(" ") | e | heading(2) }}
{% endif %}
{{ automodule(submodule, automodule_options) }}
{% endfor %}
{%- endif %}
{%- endif %}

{%- if not modulefirst and not is_namespace %}
Module contents
---------------

{{ automodule(pkgname, automodule_options) }}
{% endif %}
8 changes: 8 additions & 0 deletions docs/apidoc/toc.rst_t
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ header | heading }}

.. toctree::
:maxdepth: {{ maxdepth }}
:hidden:
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
5 changes: 5 additions & 0 deletions docs/rebuild_api_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

rm -rf source/api/*

sphinx-apidoc -M -T -e -t ./apidoc -d -1 -f -o ./source/api ../pwncat ../pwncat/commands/[!_]* ../pwncat/channel/[!_]* ../pwncat/modules/*[!.][!p][!y]
39 changes: 7 additions & 32 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,13 @@
git+https://github.com/JohnHammond/base64io-python
bcrypt==3.1.7
certifi==2020.6.20
cffi==1.14.0
chardet==3.0.4
colorama==0.4.3
commentjson==0.8.3
commonmark==0.9.1
cryptography==2.9.2
DataProperty==0.49.1
idna==2.10
lark-parser==0.7.8
mbstrdecoder==1.0.0
msgfy==0.1.0
netifaces==0.10.9
packaging==20.4
git+https://github.com/calebstewart/paramiko
pathvalidate==2.3.0
pprintpp==0.4.0
prompt-toolkit==3.0.5
pycparser==2.20
pycryptodome==3.9.8
Pygments==2.6.1
PyNaCl==1.4.0
pytablewriter==0.54.0
python-dateutil==2.8.1
pytz==2020.1
requests==2.24.0
rich
six==1.15.0
SQLAlchemy==1.3.18
tabledata==1.1.2
tcolorpy==0.0.5
typepy==1.1.1
typing-extensions==3.7.4.2
urllib3==1.25.9
wcwidth==0.1.9
rich==9.10.0
python-rapidjson==0.9.1
ZODB==5.6.0
zodburi==2.4.0
jinja2
paramiko==2.7.2
sphinx-toolbox==2.11.2
enum-tools==0.6.4
117 changes: 0 additions & 117 deletions docs/source/api/commandparser.rst

This file was deleted.

Loading

0 comments on commit 3f799dd

Please sign in to comment.