Add TLSv1 configuration option

chunking
m0rv4i 2018-12-31 12:10:00 +00:00
parent 0b6a31a035
commit d0a852f4d0
2 changed files with 8 additions and 7 deletions

View File

@ -324,12 +324,13 @@ if __name__ == '__main__':
print (Colours.END) print (Colours.END)
if (os.path.isfile("%sposh.crt" % ROOTDIR)) and (os.path.isfile("%sposh.key" % ROOTDIR)): if (os.path.isfile("%sposh.crt" % ROOTDIR)) and (os.path.isfile("%sposh.key" % ROOTDIR)):
try: if UseTLSv1:
httpd.socket = ssl.wrap_socket (httpd.socket, keyfile="%sposh.key" % ROOTDIR, certfile="%sposh.crt" % ROOTDIR, server_side=True, ssl_version=ssl.PROTOCOL_TLS) httpd.socket = ssl.wrap_socket (httpd.socket, keyfile="%sposh.key" % ROOTDIR, certfile="%sposh.crt" % ROOTDIR, server_side=True, ssl_version=ssl.PROTOCOL_TLSv1)
except Exception as e: else:
httpd.socket = ssl.wrap_socket (httpd.socket, keyfile="%sposh.key" % ROOTDIR, certfile="%sposh.crt" % ROOTDIR, server_side=True, ssl_version=ssl.PROTOCOL_TLSv1) try:
# add this if required - https://github.com/nettitude/PoshC2_Python/issues/13 httpd.socket = ssl.wrap_socket (httpd.socket, keyfile="%sposh.key" % ROOTDIR, certfile="%sposh.crt" % ROOTDIR, server_side=True, ssl_version=ssl.PROTOCOL_TLS)
# httpd.socket = ssl.wrap_socket (httpd.socket, keyfile="%sposh.key" % ROOTDIR, certfile="%sposh.crt" % ROOTDIR, server_side=True, ssl_version=ssl.PROTOCOL_TLSv1) except Exception as e:
httpd.socket = ssl.wrap_socket (httpd.socket, keyfile="%sposh.key" % ROOTDIR, certfile="%sposh.crt" % ROOTDIR, server_side=True, ssl_version=ssl.PROTOCOL_TLSv1)
else: else:
raise ValueError("Cannot find the certificate files") raise ValueError("Cannot find the certificate files")

View File

@ -46,7 +46,7 @@ HTTPResponses = [
] ]
ServerHeader = "Apache" ServerHeader = "Apache"
Insecure = "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}" Insecure = "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}"
UseTLSv1 = False
# DO NOT CHANGE # # DO NOT CHANGE #