Skip to content

Commit

Permalink
remove banner if one exists
Browse files Browse the repository at this point in the history
Former-commit-id: bba39c3 [formerly bba39c3 [formerly bba39c3 [formerly 838e77f]]]
Former-commit-id: a3b325046d7d404351a02459c6ae8a7ac11e25c6
Former-commit-id: 30be7df
Former-commit-id: 6201ac2
  • Loading branch information
AlessandroZ committed Sep 13, 2017
1 parent ab64288 commit 70cedfa
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Windows/lazagne/config/powershell_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def powershell_execute(script, function):
script = re.sub("Write-Error ","Write-Output ", script, flags=re.I)
script = re.sub("Write-Warning ","Write-Output ", script, flags=re.I)

fullargs = ["powershell.exe", "-C", "-"]
fullargs = ["powershell.exe", "-NoProfile", "-NoLogo", "-C", "-"]

info = subprocess.STARTUPINFO()
info.dwFlags = sub.STARTF_USESHOWWINDOW
Expand All @@ -35,15 +35,12 @@ def powershell_execute(script, function):
p.stdin.write("Write-Host \"[BEGIN]\"\n")
p.stdin.write("Write-Host $b\n")

while True:
# begin flag used to remove possible bullshit output print before the function is launched
if '[BEGIN]' in p.stdout.readline():
# Get the result in base64
for i in p.stdout.readline():
output += i
break

output = base64.b64decode(output)
# begin flag used to remove possible bullshit output print before the function is launched
if '[BEGIN]' in p.stdout.readline():
# Get the result in base64
for i in p.stdout.readline():
output += i
output = base64.b64decode(output)
except Exception, e:
pass

Expand Down

0 comments on commit 70cedfa

Please sign in to comment.