Add TLSv1 configuration option
parent
0b6a31a035
commit
d0a852f4d0
13
C2Server.py
13
C2Server.py
|
@ -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")
|
||||||
|
|
|
@ -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 #
|
||||||
|
|
Loading…
Reference in New Issue