Skip to content

Commit

Permalink
Fixed edge case when msf returns random string instead of int
Browse files Browse the repository at this point in the history
  • Loading branch information
SadParad1se committed Jun 28, 2024
1 parent e1ea0f9 commit 296f53b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snek_sploit/lib/rpc/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def shell_write(self, session_id: int, data: str) -> int:

response = self._context.call(self.SHELL_WRITE, [session_id, data])

return int(response[constants.B_WRITE_COUNT])
return int(response[constants.B_WRITE_COUNT]) if response.isdigit() else -1

def shell_upgrade(self, session_id: int, local_host: str, local_port: int) -> bool:
"""
Expand Down Expand Up @@ -379,7 +379,7 @@ def ring_put(self, session_id: int, data: str) -> int:
"""
response = self._context.call(self.RING_PUT, [session_id, data])

return int(response[constants.B_WRITE_COUNT])
return int(response[constants.B_WRITE_COUNT]) if response.isdigit() else -1

def ring_last(self, session_id: int) -> int:
"""
Expand Down

0 comments on commit 296f53b

Please sign in to comment.