Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyrasite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
pyrasite
Commits
d45d67a0
Commit
d45d67a0
authored
Feb 14, 2012
by
Luke Macken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better reverse connection payload docs
parent
05b3c47c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
pyrasite/reverse.py
pyrasite/reverse.py
+7
-1
No files found.
pyrasite/reverse.py
View file @
d45d67a0
...
...
@@ -27,13 +27,16 @@ from StringIO import StringIO
from
pyrasite.ipc
import
PyrasiteIPC
class
ReverseConnection
(
threading
.
Thread
,
PyrasiteIPC
):
"""A payload that connects to a given host:port and receives commands"""
host
=
'127.0.0.1'
port
=
9001
def
__init__
(
self
,
port
=
None
):
def
__init__
(
self
,
host
=
None
,
port
=
None
):
super
(
ReverseConnection
,
self
).
__init__
()
self
.
sock
=
None
if
host
:
self
.
host
=
host
if
port
:
self
.
port
=
port
...
...
@@ -64,7 +67,10 @@ class ReverseConnection(threading.Thread, PyrasiteIPC):
class
ReversePythonConnection
(
ReverseConnection
):
"""A reverse Python connection payload.
Executes Python commands and returns the output.
"""
def
on_command
(
self
,
cmd
):
buffer
=
StringIO
()
sys
.
stdout
=
buffer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment