Skip to content

Commit

Permalink
Update docs accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed May 7, 2021
1 parent 5418630 commit 183c70a
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 84 deletions.
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
**[Docs](#closed_book-documentation)** |
**[Install](#tada-install)** |
**[TL;DR](#coffee-tldr)** |
**[Features](#star-features)** |
**[Behaviour](#cop-behaviour)** |
**[Docs](#closed_book-documentation)** |
**[Usage](#computer-usage)** |
**[Examples](#bulb-examples)** |
**[FAQ](#information_source-faq)** |
Expand Down Expand Up @@ -30,7 +30,7 @@


>  
> #### Netcat on steroids with Firewall, IDS/IPS evasion, bind and reverse shell, self-injecting shell and port forwarding magic - and its fully scriptable with Python ([PSE](pse/)).
> #### Netcat on steroids with Firewall, IDS/IPS evasion, bind and reverse shell, self-injecting shell and port forwarding magic - and its fully scriptable with Python ([PSE](pse/)). - [docs.pwncat.org](https://docs.pwncat.org)
>  

Expand Down Expand Up @@ -137,7 +137,7 @@
</tbody>
</table>

> <sup>[1] <a href="https://cytopia.github.io/pwncat/pwncat.type.html">mypy type coverage</a> <strong>(fully typed: 93.97%)</strong></sup><br/>
> <sup>[1] <a href="https://cytopia.github.io/pwncat/pwncat.type.html">mypy type coverage</a> <strong>(fully typed: 93.96%)</strong></sup><br/>
> <sup>[2] <strong>Failing builds do not indicate broken functionality.</strong> Integration tests run for multiple hours and break sporadically for various different reasons (network timeouts, unknown cancellations of GitHub Actions, etc): <a href="https://github.com/actions/virtual-environments/issues/736">#735</a>, <a href="https://github.com/actions/virtual-environments/issues/841">#841</a></sup><br/>
> <sup></sup>
Expand All @@ -154,6 +154,16 @@ tool that works on older and newer machines (hence Python 2+3 compat). Most impo
(Wait for it, binary releases for Linux, MacOS and Windows will come shortly).


## :closed_book: Documentation

| Pwncat docs | Link |
|:----------------|:-----|
| Official documentation | [https://docs.pwncat.org](https://docs.pwncat.org) |
| Official website | [https://pwncat.org](https://pwncat.org) |
| API documentation | [https://pwncat.org/pwncat.api.html](https://pwncat.org/pwncat.api.html) |
| Pwncat Scripting Engine | [PSE](https://github.com/cytopia/pwncat/tree/master/pse) |


## :tada: Install

Current version is: **0.1.1**
Expand Down Expand Up @@ -442,16 +452,6 @@ There are many ways to alter this default behaviour. Have a look at the [usage](
section for more advanced settings.


## :closed_book: Documentation

Documentation will evolve over time.

* API docs can be found here: [pwncat.api.html](https://cytopia.github.io/pwncat/pwncat.api.html)
* Python type coverage can be found here: [pwncat.type.html](https://cytopia.github.io/pwncat/pwncat.type.html)
* HTML man page can be found here: [pwncat.man.html](https://cytopia.github.io/pwncat/pwncat.man.html)
* Raw man page can be found here: [pwncat.1](man/pwncat.1)


## :computer: Usage

### Keys
Expand Down Expand Up @@ -1383,6 +1383,8 @@ sys 0m4.794s

## :information_source: FAQ

**See complete FAQ here:** https://docs.pwncat.org/en/latest/faq.html

**Q**: Is `pwncat` compatible with `netcat`?

**A**: Yes, it is fully compatible in the way it behaves in connect, listen and zero-i/o mode.
Expand Down Expand Up @@ -1449,6 +1451,7 @@ Below is a list of sec tools and docs I am maintaining.
| **[smtp-user-enum]** | Enumeration | Python 2+3 | SMTP users enumerator |
| **[urlbuster]** | Enumeration | Python 2+3 | Mutable web directory fuzzer |
| **[pwncat]** | Pivoting | Python 2+3 | Cross-platform netcat on steroids |
| **[kusanagi]** | Payload Generator | Python 3 | Bind- and Reverse shell payload generator |
| **[badchars]** | Reverse Engineering | Python 2+3 | Badchar generator |
| **[fuzza]** | Reverse Engineering | Python 2+3 | TCP fuzzing tool |
| **[docker-dvwa]** | Playground | PHP | DVWA with local priv esc challenges |
Expand All @@ -1458,6 +1461,7 @@ Below is a list of sec tools and docs I am maintaining.
[smtp-user-enum]: https://github.com/cytopia/smtp-user-enum
[urlbuster]: https://github.com/cytopia/urlbuster
[pwncat]: https://github.com/cytopia/pwncat
[kusanagi]: https://github.com/cytopia/kusanagi
[badchars]: https://github.com/cytopia/badchars
[fuzza]: https://github.com/cytopia/fuzza
[docker-dvwa]: https://github.com/cytopia/docker-dvwa
Expand Down
85 changes: 38 additions & 47 deletions docs/pwncat.api.html
Original file line number Diff line number Diff line change
Expand Up @@ -3366,17 +3366,15 @@ <h1 class="title">Module <code>pwncat</code></h1>
# For issues with flush (when using tail -F or equal) see links below:
# https://stackoverflow.com/questions/26692284
# https://docs.python.org/3/library/signal.html#note-on-sigpipe
self.__screen_lock.acquire()
print(StringEncoder.decode(data))
try:
sys.stdout.flush()
except IOError:
# Python flushes standard streams on exit; redirect remaining output
# to devnull to avoid another broken pipe at shutdown
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, sys.stdout.fileno())
finally:
self.__screen_lock.release()
with self.__screen_lock:
print(StringEncoder.decode(data))
try:
sys.stdout.flush()
except IOError:
# Python flushes standard streams on exit; redirect remaining output
# to devnull to avoid another broken pipe at shutdown
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, sys.stdout.fileno())

def interrupt(self):
# type: () -&gt; None
Expand Down Expand Up @@ -3605,7 +3603,7 @@ <h1 class="title">Module <code>pwncat</code></h1>
# Open executable to wait for commands
env = os.environ.copy()
try:
self.proc = Popen(
self.proc = Popen( # pylint: disable=consider-using-with
self.__opts.executable,
stdin=PIPE,
stdout=PIPE,
Expand Down Expand Up @@ -3656,7 +3654,7 @@ <h1 class="title">Module <code>pwncat</code></h1>
# which then responds with: /bin/sh: line 5: syntax error near unexpected token `;&#39;
# Afterwards the shell is corrupt and gone so we will restart it here.
self.log.error(&#34;COMMAND-EOF restarting: %s&#34;, self.__opts.executable)
self.proc = Popen(
self.proc = Popen( # pylint: disable=consider-using-with
self.__opts.executable,
stdin=PIPE,
stdout=PIPE,
Expand Down Expand Up @@ -5180,9 +5178,8 @@ <h1 class="title">Module <code>pwncat</code></h1>
&#34;&#34;&#34;Check argument for valid file content (file must exist and be readable).&#34;&#34;&#34;
if not os.path.isfile(value):
raise argparse.ArgumentTypeError(&#34;File not found: %s&#34; % value)
fhandle = open(value, mode=&#34;r&#34;)
script = fhandle.read()
fhandle.close()
with open(value, mode=&#34;r&#34;) as fhandle:
script = fhandle.read()
return script

# --------------------------------------------------------------------------
Expand Down Expand Up @@ -7539,9 +7536,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
&#34;&#34;&#34;Check argument for valid file content (file must exist and be readable).&#34;&#34;&#34;
if not os.path.isfile(value):
raise argparse.ArgumentTypeError(&#34;File not found: %s&#34; % value)
fhandle = open(value, mode=&#34;r&#34;)
script = fhandle.read()
fhandle.close()
with open(value, mode=&#34;r&#34;) as fhandle:
script = fhandle.read()
return script

# --------------------------------------------------------------------------
Expand Down Expand Up @@ -7733,9 +7729,8 @@ <h3>Static methods</h3>
&#34;&#34;&#34;Check argument for valid file content (file must exist and be readable).&#34;&#34;&#34;
if not os.path.isfile(value):
raise argparse.ArgumentTypeError(&#34;File not found: %s&#34; % value)
fhandle = open(value, mode=&#34;r&#34;)
script = fhandle.read()
fhandle.close()
with open(value, mode=&#34;r&#34;) as fhandle:
script = fhandle.read()
return script</code></pre>
</details>
</dd>
Expand Down Expand Up @@ -11261,7 +11256,7 @@ <h2 id="args">Args</h2>
# Open executable to wait for commands
env = os.environ.copy()
try:
self.proc = Popen(
self.proc = Popen( # pylint: disable=consider-using-with
self.__opts.executable,
stdin=PIPE,
stdout=PIPE,
Expand Down Expand Up @@ -11312,7 +11307,7 @@ <h2 id="args">Args</h2>
# which then responds with: /bin/sh: line 5: syntax error near unexpected token `;&#39;
# Afterwards the shell is corrupt and gone so we will restart it here.
self.log.error(&#34;COMMAND-EOF restarting: %s&#34;, self.__opts.executable)
self.proc = Popen(
self.proc = Popen( # pylint: disable=consider-using-with
self.__opts.executable,
stdin=PIPE,
stdout=PIPE,
Expand Down Expand Up @@ -11471,7 +11466,7 @@ <h2 id="yields">Yields</h2>
# which then responds with: /bin/sh: line 5: syntax error near unexpected token `;&#39;
# Afterwards the shell is corrupt and gone so we will restart it here.
self.log.error(&#34;COMMAND-EOF restarting: %s&#34;, self.__opts.executable)
self.proc = Popen(
self.proc = Popen( # pylint: disable=consider-using-with
self.__opts.executable,
stdin=PIPE,
stdout=PIPE,
Expand Down Expand Up @@ -12278,17 +12273,15 @@ <h2 id="args">Args</h2>
# For issues with flush (when using tail -F or equal) see links below:
# https://stackoverflow.com/questions/26692284
# https://docs.python.org/3/library/signal.html#note-on-sigpipe
self.__screen_lock.acquire()
print(StringEncoder.decode(data))
try:
sys.stdout.flush()
except IOError:
# Python flushes standard streams on exit; redirect remaining output
# to devnull to avoid another broken pipe at shutdown
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, sys.stdout.fileno())
finally:
self.__screen_lock.release()
with self.__screen_lock:
print(StringEncoder.decode(data))
try:
sys.stdout.flush()
except IOError:
# Python flushes standard streams on exit; redirect remaining output
# to devnull to avoid another broken pipe at shutdown
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, sys.stdout.fileno())

def interrupt(self):
# type: () -&gt; None
Expand Down Expand Up @@ -12343,17 +12336,15 @@ <h3>Methods</h3>
# For issues with flush (when using tail -F or equal) see links below:
# https://stackoverflow.com/questions/26692284
# https://docs.python.org/3/library/signal.html#note-on-sigpipe
self.__screen_lock.acquire()
print(StringEncoder.decode(data))
try:
sys.stdout.flush()
except IOError:
# Python flushes standard streams on exit; redirect remaining output
# to devnull to avoid another broken pipe at shutdown
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, sys.stdout.fileno())
finally:
self.__screen_lock.release()</code></pre>
with self.__screen_lock:
print(StringEncoder.decode(data))
try:
sys.stdout.flush()
except IOError:
# Python flushes standard streams on exit; redirect remaining output
# to devnull to avoid another broken pipe at shutdown
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, sys.stdout.fileno())</code></pre>
</details>
</dd>
<dt id="pwncat.IONetworkScanner.interrupt"><code class="name flex">
Expand Down
40 changes: 17 additions & 23 deletions docs/pwncat.type.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ <h1>pwncat - Type Coverage</h1>
</tr></thead>
<tfoot><tr class="summary summary-quality-1">
<th class="summary summary-filename">Total</th>
<th class="summary summary-precision">6.03% imprecise</th>
<th class="summary summary-lines">6364 LOC</th>
<th class="summary summary-precision">6.04% imprecise</th>
<th class="summary summary-lines">6361 LOC</th>
</tr></tfoot>
<tbody><tr class="summary summary-quality-1">
<td class="summary summary-filename">bin/pwncat</td>
<td class="summary summary-precision">6.03% imprecise</td>
<td class="summary summary-lines">6364 LOC</td>
<td class="summary summary-precision">6.04% imprecise</td>
<td class="summary summary-lines">6361 LOC</td>
</tr></tbody>
</table>

Expand Down Expand Up @@ -6391,9 +6391,6 @@ <h2>pwncat</h2>
<span id="L6359" class="lineno"><a class="lineno" href="#L6359">6359</a></span>
<span id="L6360" class="lineno"><a class="lineno" href="#L6360">6360</a></span>
<span id="L6361" class="lineno"><a class="lineno" href="#L6361">6361</a></span>
<span id="L6362" class="lineno"><a class="lineno" href="#L6362">6362</a></span>
<span id="L6363" class="lineno"><a class="lineno" href="#L6363">6363</a></span>
<span id="L6364" class="lineno"><a class="lineno" href="#L6364">6364</a></span>
</pre></td>
<td class="table-code"><pre><span class="line-empty" title="No Anys on this line!">#!/usr/bin/env python3</span>
<span class="line-empty" title="No Anys on this line!">"""pwncat."""</span>
Expand Down Expand Up @@ -9920,17 +9917,15 @@ <h2>pwncat</h2>
<span class="line-empty" title="No Anys on this line!"> # For issues with flush (when using tail -F or equal) see links below:</span>
<span class="line-empty" title="No Anys on this line!"> # https://stackoverflow.com/questions/26692284</span>
<span class="line-empty" title="No Anys on this line!"> # https://docs.python.org/3/library/signal.html#note-on-sigpipe</span>
<span class="line-precise" title="No Anys on this line!"> self.__screen_lock.acquire()</span>
<span class="line-precise" title="No Anys on this line!"> print(StringEncoder.decode(data))</span>
<span class="line-empty" title="No Anys on this line!"> try:</span>
<span class="line-precise" title="No Anys on this line!"> sys.stdout.flush()</span>
<span class="line-precise" title="No Anys on this line!"> except IOError:</span>
<span class="line-empty" title="No Anys on this line!"> # Python flushes standard streams on exit; redirect remaining output</span>
<span class="line-empty" title="No Anys on this line!"> # to devnull to avoid another broken pipe at shutdown</span>
<span class="line-precise" title="No Anys on this line!"> devnull = os.open(os.devnull, os.O_WRONLY)</span>
<span class="line-precise" title="No Anys on this line!"> os.dup2(devnull, sys.stdout.fileno())</span>
<span class="line-empty" title="No Anys on this line!"> finally:</span>
<span class="line-precise" title="No Anys on this line!"> self.__screen_lock.release()</span>
<span class="line-precise" title="No Anys on this line!"> with self.__screen_lock:</span>
<span class="line-precise" title="No Anys on this line!"> print(StringEncoder.decode(data))</span>
<span class="line-empty" title="No Anys on this line!"> try:</span>
<span class="line-precise" title="No Anys on this line!"> sys.stdout.flush()</span>
<span class="line-precise" title="No Anys on this line!"> except IOError:</span>
<span class="line-empty" title="No Anys on this line!"> # Python flushes standard streams on exit; redirect remaining output</span>
<span class="line-empty" title="No Anys on this line!"> # to devnull to avoid another broken pipe at shutdown</span>
<span class="line-precise" title="No Anys on this line!"> devnull = os.open(os.devnull, os.O_WRONLY)</span>
<span class="line-precise" title="No Anys on this line!"> os.dup2(devnull, sys.stdout.fileno())</span>
<span class="line-empty" title="No Anys on this line!"></span>
<span class="line-precise" title="No Anys on this line!"> def interrupt(self):</span>
<span class="line-empty" title="No Anys on this line!"> # type: () -&gt; None</span>
Expand Down Expand Up @@ -10177,7 +10172,7 @@ <h2>pwncat</h2>
<span class="line-precise" title="No Anys on this line!"> env = os.environ.copy()</span>
<span class="line-empty" title="No Anys on this line!"> try:</span>
<span class="line-precise" title="Any Types on this line:
Explicit (x19)"> self.proc = Popen(</span>
Explicit (x19)"> self.proc = Popen( # pylint: disable=consider-using-with</span>
<span class="line-precise" title="No Anys on this line!"> self.__opts.executable,</span>
<span class="line-precise" title="No Anys on this line!"> stdin=PIPE,</span>
<span class="line-precise" title="No Anys on this line!"> stdout=PIPE,</span>
Expand Down Expand Up @@ -10237,7 +10232,7 @@ <h2>pwncat</h2>
<span class="line-any" title="Any Types on this line:
Explicit (x4)"> self.log.error("COMMAND-EOF restarting: %s", self.__opts.executable)</span>
<span class="line-precise" title="Any Types on this line:
Explicit (x19)"> self.proc = Popen(</span>
Explicit (x19)"> self.proc = Popen( # pylint: disable=consider-using-with</span>
<span class="line-precise" title="No Anys on this line!"> self.__opts.executable,</span>
<span class="line-precise" title="No Anys on this line!"> stdin=PIPE,</span>
<span class="line-precise" title="No Anys on this line!"> stdout=PIPE,</span>
Expand Down Expand Up @@ -11829,9 +11824,8 @@ <h2>pwncat</h2>
<span class="line-precise" title="No Anys on this line!"> if not os.path.isfile(value):</span>
<span class="line-precise" title="No Anys on this line!"> raise argparse.ArgumentTypeError("File not found: %s" % value)</span>
<span class="line-precise" title="Any Types on this line:
Explicit (x1)"> fhandle = open(value, mode="r")</span>
<span class="line-precise" title="No Anys on this line!"> script = fhandle.read()</span>
<span class="line-precise" title="No Anys on this line!"> fhandle.close()</span>
Explicit (x1)"> with open(value, mode="r") as fhandle:</span>
<span class="line-precise" title="No Anys on this line!"> script = fhandle.read()</span>
<span class="line-precise" title="No Anys on this line!"> return script</span>
<span class="line-empty" title="No Anys on this line!"></span>
<span class="line-empty" title="No Anys on this line!"> # --------------------------------------------------------------------------</span>
Expand Down
2 changes: 1 addition & 1 deletion man/pwncat.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.16.
.TH PWNCAT: "1" "April 2021" "https://github.com/cytopia/pwncat" "User Commands"
.TH PWNCAT: "1" "May 2021" "https://github.com/cytopia/pwncat" "User Commands"
.SH NAME
pwncat: \- pwncat
.SH DESCRIPTION
Expand Down

0 comments on commit 183c70a

Please sign in to comment.