Skip to content

Commit

Permalink
Fix an issue with recognizing Windows shell from nc
Browse files Browse the repository at this point in the history
Fixes issue #7
  • Loading branch information
brightio committed Nov 29, 2021
1 parent b6fda51 commit 67d5e2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions penelope.py
Expand Up @@ -881,10 +881,10 @@ def log(self, data, _input=False):

def determine(self):
history=' export HISTFILE=/dev/null;' if options.no_history else ''
cmd=f' export HISTCONTROL=ignoreboth;{history} echo $((1*1000+3*100+3*10+7))`tty`\n'
cmd=f' export HISTCONTROL=ignoreboth;{history} echo $((1*1000+3*100+3*10+7))`tty`'
outcome=b'1337'

response=self.exec(cmd, expect=(cmd.encode(),outcome,b"Windows PowerShell"))
response=self.exec(cmd+'\n', expect=(cmd.encode(),outcome,b"Windows PowerShell"))

if r:=re.match(rf"(Microsoft Windows \[Version (.*)\].*){re.escape(cmd)}".encode(),
response,re.DOTALL): #cmd
Expand Down

0 comments on commit 67d5e2a

Please sign in to comment.