Skip to content

Commit

Permalink
Fix problems to determine if a conection is a rev shell
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthares101 committed Nov 13, 2021
1 parent 9fa37d5 commit c20bfe4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img alt="Test status" src="https://img.shields.io/github/workflow/status/anthares101/netpwn/CI?style=for-the-badge"> <img alt="Version v1.1" src="https://img.shields.io/badge/version-v1.1-blue?style=for-the-badge"> <img alt="GPL-2.0 license" src="https://img.shields.io/github/license/anthares101/netpwn?style=for-the-badge">
<img alt="Test status" src="https://img.shields.io/github/workflow/status/anthares101/netpwn/CI?style=for-the-badge"> <img alt="Version v1.2" src="https://img.shields.io/badge/version-v1.2-blue?style=for-the-badge"> <img alt="GPL-2.0 license" src="https://img.shields.io/github/license/anthares101/netpwn?style=for-the-badge">

# Netpwn - A netcat listener alternative

Expand Down
2 changes: 1 addition & 1 deletion netpwn/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
SHELL_STABILIZATION_METHODS = {
'python': {
'bash': """python -c 'import pty; pty.spawn("/bin/bash")'""",
'sh': """python -c 'import pty; pty.spawn("/bin/bash")'"""
'sh': """python -c 'import pty; pty.spawn("/bin/sh")'"""
},
'python3': {
'bash': """python3 -c 'import pty; pty.spawn("/bin/bash")'""",
Expand Down
4 changes: 2 additions & 2 deletions netpwn/services/ListenerService.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def prepare_listener(self) -> listen:
return listener

def is_rev_shell(self, listener: listen):
data_received = listener.recv(timeout=0.5)
data_received = listener.recvline_endswith(b'$',b'#', timeout=1)
listener.unrecv(data_received)
# Check that we got a shell
if (not b'$' in data_received and not b'Windows' in data_received):
if (data_received):
return False
return True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='netpwn',
version='1.1.post4',
version='1.2',
license='GPL-2.0',
description='A netcat listener alternative with automatic shell stabilization.',
author='Ángel Heredia',
Expand Down

0 comments on commit c20bfe4

Please sign in to comment.