commit 2b86e88873be956eff55c2b7c07a836b2c829404 Author: Heuze Florent Date: Thu Dec 31 11:59:52 2020 +0100 Init package diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5135af0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.exe filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45a2896 --- /dev/null +++ b/.gitignore @@ -0,0 +1,119 @@ +# ---> Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +WAPT/certificate.crt +WAPT/manifest.sha256 +WAPT/signature.sha256 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1998ac7 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# fws-smb1-client + +SMB1 Client on Windows \ No newline at end of file diff --git a/WAPT/control b/WAPT/control new file mode 100644 index 0000000..4e36894 --- /dev/null +++ b/WAPT/control @@ -0,0 +1,43 @@ +package : fws-smb1-client +version : 1 +architecture : all +section : base +priority : optional +name : +categories : +maintainer : Heuzef +description : Ghostscript for Windows +depends : +conflicts : +maturity : PROD +locale : +target_os : +min_os_version : +max_os_version : +min_wapt_version : +sources : +installed_size : +impacted_process : +description_fr : SMB1 Client on Windows +description_pl : +description_de : +description_es : +description_pt : +description_it : +description_nl : +description_ru : +audit_schedule : +editor : +keywords : +licence : +homepage : https://docs.microsoft.com/fr-fr/windows-server/storage/file-server/troubleshoot/detect-enable-and-disable-smbv1-v2-v3 +package_uuid : +valid_from : +valid_until : +forced_install_on : +changelog : +signer : +signer_fingerprint: +signature : +signature_date : +signed_attributes : \ No newline at end of file diff --git a/WAPT/wapt.psproj b/WAPT/wapt.psproj new file mode 100644 index 0000000..283d844 --- /dev/null +++ b/WAPT/wapt.psproj @@ -0,0 +1,295 @@ +[PyScripter] +Version=3.3.2.0 + +[Project] +ClassName=TProjectRootNode +StoreRelativePaths=TRUE +ShowFileExtensions=FALSE + +[Project\ChildNodes\Node0] +ClassName=TProjectFilesNode + +[Project\ChildNodes\Node0\ChildNodes\Node0] +ClassName=TProjectFolderNode +Name=wapt + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\common.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\setuphelpers.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\wapt-get.ini + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\wapt-get.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\waptpackage.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes] +Count=5 + +[Project\ChildNodes\Node0\ChildNodes\Node1] +ClassName=TProjectFileNode +FileName=$[Project-Path]changelog.txt + +[Project\ChildNodes\Node0\ChildNodes\Node2] +ClassName=TProjectFileNode +FileName=$[Project-Path]control + +[Project\ChildNodes\Node0\ChildNodes\Node3] +ClassName=TProjectFileNode +FileName=$[Project-Path]..\setup.py + +[Project\ChildNodes\Node0\ChildNodes] +Count=4 + +[Project\ChildNodes\Node1] +ClassName=TProjectRunConfiguationsNode + +[Project\ChildNodes\Node1\ChildNodes\Node0] +ClassName=TProjectRunConfiguationNode +Name=install + +[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=install "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node1] +ClassName=TProjectRunConfiguationNode +Name=remove + +[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=remove "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node2] +ClassName=TProjectRunConfiguationNode +Name=session-setup + +[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=session-setup "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node3] +ClassName=TProjectRunConfiguationNode +Name=update + +[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=update +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node4] +ClassName=TProjectRunConfiguationNode +Name=upgrade + +[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-f upgrade +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node5] +ClassName=TProjectRunConfiguationNode +Name=-i build-upload + +[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-i build-upload "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node6] +ClassName=TProjectRunConfiguationNode +Name=svn update + +[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=sources "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node7] +ClassName=TProjectRunConfiguationNode +Name=uninstall + +[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=uninstall "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[Project-Path].. +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node8] +ClassName=TProjectRunConfiguationNode +Name=update-package-sources + +[Project\ChildNodes\Node1\ChildNodes\Node8\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=update-package-sources "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node8\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node9] +ClassName=TProjectRunConfiguationNode +Name=audit + +[Project\ChildNodes\Node1\ChildNodes\Node9\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=audit -f "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node9\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes] +Count=10 + +[Project\ChildNodes] +Count=2 + +[Project\ExtraPythonPath] +Count=0 + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..966b5c2 --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +from setuphelpers import * + +uninstallkey = [] + +def install(): + print("Enable SMB v1") + print('Checking status') + + if: + + else: + + +def uninstall(): + print('Disable SMB v1') + print('Checking status') + + if: + + else: + + + +# Disable : +# +# Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart +# +# Enable : +# +# Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart +# +# Status : +# +# Get-WindowsOptionalFeature -Online -FeatureName smb1protocol +# +# https://docs.microsoft.com/fr-fr/windows-server/storage/file-server/troubleshoot/detect-enable-and-disable-smbv1-v2-v3 \ No newline at end of file diff --git a/tis/tis-disable-smb1-client/WAPT/certificate.crt b/tis/tis-disable-smb1-client/WAPT/certificate.crt new file mode 100644 index 0000000..4d9c7b0 --- /dev/null +++ b/tis/tis-disable-smb1-client/WAPT/certificate.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIUcFRJMa4zqkCH5BWTdQs5ogRDo9swDQYJKoZIhvcNAQEL +BQAwgZAxCzAJBgNVBAYTAkZSMSIwIAYDVQQHDBlTYWludC1TZWJhc3RpZW4gc3Vy +IExvaXJlMRQwEgYDVQQKDAtUcmFucXVpbCBJVDEUMBIGA1UEAwwLVHJhbnF1aWwg +SVQxJDAiBgkqhkiG9w0BCQEWFXRlY2huaXF1ZUB0cmFucXVpbC5pdDELMAkGA1UE +CwwCSVQwHhcNMjAwMjI0MTYxNzMxWhcNMzAwMjIxMTYxNzMxWjCBkDELMAkGA1UE +BhMCRlIxIjAgBgNVBAcMGVNhaW50LVNlYmFzdGllbiBzdXIgTG9pcmUxFDASBgNV +BAoMC1RyYW5xdWlsIElUMRQwEgYDVQQDDAtUcmFucXVpbCBJVDEkMCIGCSqGSIb3 +DQEJARYVdGVjaG5pcXVlQHRyYW5xdWlsLml0MQswCQYDVQQLDAJJVDCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyo955wqwhYnLdzNFQ77DbWKzCn8QMb +YcvdScsaesMnnS8ZBrdnyrFSFecde+ahGdawDxnDpGTyLcDpwoNGToJLlQi3qnns +Wl9n8x6oRWlfxkA4wLFPdkIWtkqvkijru/eJjBtTEUk0dAejym0+L9NzE6zWnx+C +1V0ShCd9wdayBzTvBREYOhHGiMOuxg9qzjgLqVPNZH1QERKf9GjUuxIW9R3cQU1A +5DD4SvFTH5rxCCV1r6NQ8Wol1l1lvk+oVHX1DmfZuJaUHIlZBz8pTW8tXvYwdioA +MzThkyCYTadAWsVqi+iSAO30mxBssdny0wiH7q4p6qcSZQBOa8W5UTkCAwEAAaNa +MFgwDwYDVR0TAQH/BAUwAwEB/zAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAzAdBgNV +HQ4EFgQUKfyxoBlP6/tLnsWIxC06Q9CszV4wDgYDVR0PAQH/BAQDAgHWMA0GCSqG +SIb3DQEBCwUAA4IBAQB0vl+7NwfYgeoBF2ptolWyAsISB+gRcEBRgmaQAQnb2nxs +pYStlZIsMJnaSHaWnXGXTS6Cw6k9Rm61qrcbrVuzdbHtaDSEakMV17sIVRH0Gyd+ +9K7nXoPhN9vbBEcz8pQ5SgchKMfqAAeQQUqaSmYQ1xUsqUgUHoj6eyYTtJM3pYMN +0uukO0+aUDhvXWQYYurlzJkdqH0kV2IJw+dNBrAvXaVrYBwEIxThQ6UNaEFnPjIX +XYGrkl5wpwoIxMQ8uNjZoFOYxrjvqxEVV2ZjoOGMlYNTHsNC5g25QygCWJtGfrHO +2ywdWen+9NKRBrsVpZo5cMttMgDXrsWiMb+MRGWZ +-----END CERTIFICATE----- diff --git a/tis/tis-disable-smb1-client/WAPT/control b/tis/tis-disable-smb1-client/WAPT/control new file mode 100644 index 0000000..761826a --- /dev/null +++ b/tis/tis-disable-smb1-client/WAPT/control @@ -0,0 +1,42 @@ +package : tis-disable-smb1 +version : 22 +architecture : all +section : base +priority : standard +name : +categories : +maintainer : Hubert TOUVET +description : Disable SMB1 Server on Windows >= Vista. Install KB4012598 on win XP. +depends : +conflicts : +maturity : +locale : +target_os : +min_os_version : +max_os_version : +min_wapt_version : +sources : https://srvdev.tranquilit.local/sources/tis-disable-smb1-wapt/trunk/ +installed_size : +impacted_process : +description_fr : +description_pl : +description_de : +description_es : +description_pt : +description_it : +description_nl : +description_ru : +audit_schedule : +editor : +keywords : +licence : +homepage : +package_uuid : 9253096f-9122-45e5-a71a-4b52d58a6bd0 +valid_from : +valid_until : +forced_install_on : +signer : Tranquil IT +signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb +signature : txCgBHbXkCW3CdW6+7rOTA1EiEWw7xwGGpjde3rC2bDWTE82CEI1z4A1EYy1dESY/Y79O9dxHdJYKvTECtsoYy63sqp8euc1JzRbOPxutkT8ngr5nMs0OEZRRpQ05w0wTU0hciAvMylRS5TiqT/fnwSEJOgMA7sLB7quFTFkT59m7wx3Pa/jTRxnG7iR0ms4nxBLXwOvw4W2NswFTjgcQXpSGYg1RDD+54ELDk9P0aCaRIeJO/ygIcjRNfQHiItDT92vrk+Mh7nBzsdAuKXPWrwBnhGD4Z1WToLKv2P+KsWZqPQoBdRzjrdi7B2ubLXn5W1Ml9C38nBG57xXmS3AmQ== +signature_date : 2020-02-27T21:29:45.689828 +signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,signer,signer_fingerprint,signature_date,signed_attributes \ No newline at end of file diff --git a/tis/tis-disable-smb1-client/WAPT/manifest.sha1 b/tis/tis-disable-smb1-client/WAPT/manifest.sha1 new file mode 100644 index 0000000..64db869 --- /dev/null +++ b/tis/tis-disable-smb1-client/WAPT/manifest.sha1 @@ -0,0 +1 @@ +[["WindowsServer2003-KB4012598-x64-custom-ENU.exe","f24d8723f246145524b9030e4752c96430981211"],["WAPT/certificate.crt","8d0a43a817fe7784c63839db94ddf8a3572c8e7a"],["WAPT/wapt.psproj","557e60050809687d56525e6ac46df9c0e02ccae6"],["windowsserver2003-kb4012598-x86-custom-fra_9cf9ac070a1b21bca6757de5d127427c090d581d.exe","9cf9ac070a1b21bca6757de5d127427c090d581d"],["setup.py","d354e5ff47cd888edb3a68d12310c0c2176a4720"],["windowsxp-kb4012598-x86-custom-fra_eb47689656c58ab374521babb9bdca07304d87f5.exe","eb47689656c58ab374521babb9bdca07304d87f5"],["WAPT/control","a31a75ea46b72eb7e8381ea334045f8d0c79bd7d"]] \ No newline at end of file diff --git a/tis/tis-disable-smb1-client/WAPT/manifest.sha256 b/tis/tis-disable-smb1-client/WAPT/manifest.sha256 new file mode 100644 index 0000000..5dd1570 --- /dev/null +++ b/tis/tis-disable-smb1-client/WAPT/manifest.sha256 @@ -0,0 +1 @@ +[["WindowsServer2003-KB4012598-x64-custom-ENU.exe","fa2f1ac56bb81d236e797afea75ce4f4ecf374ed1182e7e2337350f387fd5eac"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/wapt.psproj","795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"],["windowsserver2003-kb4012598-x86-custom-fra_9cf9ac070a1b21bca6757de5d127427c090d581d.exe","1f113bbcb4ec87efb80b105de1591e42dd9ff41f2f81fe04bab3e878cd5c069e"],["setup.py","2d19c818ea1223ac4e9e9585a805243d2c78290bd7b33fe77a65b3e47be58d26"],["windowsxp-kb4012598-x86-custom-fra_eb47689656c58ab374521babb9bdca07304d87f5.exe","3b5aa3201ca409a073dabff9c5fdd8a635851eb37befaef28829c4f374367412"],["WAPT/control","998096546ac1e098ef0669e53c168919fc6d3411388e44a355621f42f5243e56"]] \ No newline at end of file diff --git a/tis/tis-disable-smb1-client/WAPT/signature b/tis/tis-disable-smb1-client/WAPT/signature new file mode 100644 index 0000000..fa1d1af --- /dev/null +++ b/tis/tis-disable-smb1-client/WAPT/signature @@ -0,0 +1,5 @@ +ivYRrF6e04Vr/9rakIPqGXfed6ncWq30DUNoQ8SmPDZbCR9rWI90AqPmMw84LkxORPxmAGbTH3/t +d4QcDqPmChoefdf16wudEqf0H4FXGQYpnqG3TQ5i1m3bfymjn8H9W945ZR1r2KJLqMEC5W7Iqhwh +vk49iRRejdcdNk9uLObMSsMN50x2MEMsiI3k0ExxqfazlBxxnTXtUX/b0QYYXlZrUeOukhHj3y2J +Supfj5pbGe+MNkiKFlW18FCbCYOJLn+yZNtFJAHlyb0XWKbIu3CsU56fN4MJluj8yI1KW3nDezIy +jZ8zrX0zY/viC+ftaI1j20bZ89w/jawGNV/L/A== diff --git a/tis/tis-disable-smb1-client/WAPT/signature.sha256 b/tis/tis-disable-smb1-client/WAPT/signature.sha256 new file mode 100644 index 0000000..f2e0468 --- /dev/null +++ b/tis/tis-disable-smb1-client/WAPT/signature.sha256 @@ -0,0 +1,5 @@ +FcJVI/orDVJPYstrpw8ueevz/tn7jK0rIBlBIJcsSGtytJjpxT5SKyv9ezGHXC40XQcy2m7GKgih +kETKDnJm05u1gYFSzsjxRh0D61QV/vquTVgidlZTvp/80ejbXo5Sk2owxqQzJTu300AOKMUZ83uC +XjMbvA8vwW+X6VJtf/NU+hK9fpTQsNzHKmGfFLvA04+z1D1ojukdrder8PTZiej1ceZD/oOubXtI +Bl9berDu0eBe9t7VL8l5sDOaLnXNQ9XDpLZWQ92HmUsWO14LdF5iSLCv0MVdJfuRF0tefgHDYTc1 +RbfpSEv1SVhtsmsy3CVTGMIqZKv9O/nNG3a+nA== diff --git a/tis/tis-disable-smb1-client/WAPT/wapt.psproj b/tis/tis-disable-smb1-client/WAPT/wapt.psproj new file mode 100644 index 0000000..be63f91 --- /dev/null +++ b/tis/tis-disable-smb1-client/WAPT/wapt.psproj @@ -0,0 +1,247 @@ +[PyScripter] +Version=2.5.3.0 + +[Project] +ClassName=TProjectRootNode +StoreRelativePaths=TRUE +ShowFileExtensions=FALSE + +[Project\ChildNodes\Node0] +ClassName=TProjectFilesNode + +[Project\ChildNodes\Node0\ChildNodes\Node0] +ClassName=TProjectFolderNode +Name=wapt + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0] +ClassName=TProjectFileNode +FileName=c:\wapt\common.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1] +ClassName=TProjectFileNode +FileName=c:\wapt\setuphelpers.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2] +ClassName=TProjectFileNode +FileName=c:\wapt\wapt-get.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3] +ClassName=TProjectFileNode +FileName=c:\wapt\wapt-get.ini + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4] +ClassName=TProjectFileNode +FileName=c:\wapt\waptpackage.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes] +Count=5 + +[Project\ChildNodes\Node0\ChildNodes\Node1] +ClassName=TProjectFileNode +FileName=$[Project-Path]control + +[Project\ChildNodes\Node0\ChildNodes\Node2] +ClassName=TProjectFileNode +FileName=$[Project-Path]..\setup.py + +[Project\ChildNodes\Node0\ChildNodes] +Count=3 + +[Project\ChildNodes\Node1] +ClassName=TProjectRunConfiguationsNode + +[Project\ChildNodes\Node1\ChildNodes\Node0] +ClassName=TProjectRunConfiguationNode +Name=install + +[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug install "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node1] +ClassName=TProjectRunConfiguationNode +Name=remove + +[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug remove "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node2] +ClassName=TProjectRunConfiguationNode +Name=session-setup + +[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug session-setup "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node3] +ClassName=TProjectRunConfiguationNode +Name=update + +[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug update +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node4] +ClassName=TProjectRunConfiguationNode +Name=upgrade + +[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-f -ldebug upgrade +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node5] +ClassName=TProjectRunConfiguationNode +Name=-i build-upload + +[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug -i build-upload "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node6] +ClassName=TProjectRunConfiguationNode +Name=svn update + +[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug sources "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node7] +ClassName=TProjectRunConfiguationNode +Name=uninstall + +[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug uninstall "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes] +Count=8 + +[Project\ChildNodes] +Count=2 + +[Project\ExtraPythonPath] +Item0=c:\wapt +Item1=c:\wapt\lib\site-packages +Count=2 + diff --git a/tis/tis-disable-smb1-client/WindowsServer2003-KB4012598-x64-custom-ENU.exe b/tis/tis-disable-smb1-client/WindowsServer2003-KB4012598-x64-custom-ENU.exe new file mode 100644 index 0000000..8f05779 --- /dev/null +++ b/tis/tis-disable-smb1-client/WindowsServer2003-KB4012598-x64-custom-ENU.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa2f1ac56bb81d236e797afea75ce4f4ecf374ed1182e7e2337350f387fd5eac +size 974072 diff --git a/tis/tis-disable-smb1-client/setup.py b/tis/tis-disable-smb1-client/setup.py new file mode 100644 index 0000000..cf4335e --- /dev/null +++ b/tis/tis-disable-smb1-client/setup.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from setuphelpers import * +import platform + +uninstallkey = [] + +def pending_reboot_reasons(): + result = [] + reboot_required = registry_readstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update','RebootRequired',0) + if reboot_required: + result.append('Windows Update: %s' % reboot_required) + reboot_pending = registry_readstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing','RebootPending',0) + if reboot_pending: + result.append('CBS Updates: %s' % reboot_pending) + renames_pending = registry_readstring(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\Session Manager','PendingFileRenameOperations',None) + if renames_pending: + result.append('File renames: %s' % renames_pending) + return result + +def is_kb_installed(hotfixid): + installed_update = installed_windows_updates() + if [kb for kb in installed_update if kb['HotFixID' ].upper() == hotfixid.upper()]: + return True + return False + + +def install_kb4012598(): + if windows_version() < Version('5.2'): + install_exe_if_needed('windowsxp-kb4012598-x86-custom-fra_eb47689656c58ab374521babb9bdca07304d87f5.exe','/quiet /norestart',key='',min_version='1') + elif windows_version() < Version('5.3'): + if iswin64(): + install_exe_if_needed('WindowsServer2003-KB4012598-x64-custom-ENU.exe','/quiet /norestart',key='',min_version='1') + else: + install_exe_if_needed('windowsserver2003-kb4012598-x86-custom-fra_9cf9ac070a1b21bca6757de5d127427c090d581d.exe','/quiet /norestart',key='',min_version='1') + else: + error('Please install kb4012598') + +def install(): + restart_needed_by = [] + + """ + if service_installed('mrxsmb10') and service_is_running('mrxsmb10'): + print('Disable SMB1 client') + run('sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi') + run('sc.exe config mrxsmb10 start= disabled') + restart_needed_by.append('Disable SMB1 client service') + else: + print('OK: SMB1 client not running') + """ + + if windows_version() < Version('8.1',2): + was_smb1server = registry_readstring(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters','SMB1',1) + registry_setstring(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters','SMB1',0,type=REG_DWORD) + if was_smb1server: + restart_needed_by.append('Disable SMB1 server service') + else: + print('OK: SMB1 server disabled in registry') + else: + was_smb1server = run_powershell('Get-SmbServerConfiguration | Select EnableSMB1Protocol').get('EnableSMB1Protocol',True) + print('Current SMB1 status : %s' % (was_smb1server,)) + if was_smb1server: + print('Disabling SMB1') + result = run_powershell('Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force') + result = run_powershell('Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart') + # {u'ScratchDirectory': None, u'RestartNeeded': True, u'LogLevel': 2, u'LogPath': u'C:\\Windows\\Logs\\DISM\\dism.log', u'WinPath': None, u'Online': True, u'SysDrivePath': None, u'Path': None} + if result.get('RestartNeeded',True): + restart_needed_by.append('Disable SMB1 Server Feature') + + # before Vista, no SMB2, so check patch + if windows_version() < Version('6.0'): + # check if KB4012598 is installed + if not is_kb_installed('KB4012598'): + install_kb4012598() + + restart_needed_by.extend(pending_reboot_reasons()) + if was_smb1server or restart_needed_by: + with disable_file_system_redirection(): + run_notfatal('msg * /time:360 Merci de redemarrer votre ordinateur pour terminer la desactivation du service vulnerable serveur SMB1. Tranquil IT Systems.') + error('Redemarrage necessaire pour : %s ' % restart_needed_by) + else: + print('No reboot required') + + +def uninstall(): + restart_needed_by = [] + """ + if service_installed('mrxsmb10') and not service_is_running('mrxsmb10'): + print('Enable SMB1 client') + # see https://support.microsoft.com/fr-fr/help/2696547/how-to-enable-and-disable-smbv1,-smbv2,-and-smbv3-in-windows-vista,-windows-server-2008,-windows-7,-windows-server-2008-r2,-windows-8,-and-windows-server-2012 + run('sc.exe config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi') + run('sc.exe config mrxsmb10 start= auto') + restart_needed_by.append('Enable SMB1 client service') + else: + print('OK: SMB1 client running or not installed') + """ + + if windows_version() < Version('8.1'): + was_smb1server = registry_readstring(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters','SMB1',0) + registry_setstring(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters','SMB1',1,type=REG_DWORD) + if not was_smb1server: + restart_needed_by.append('Enable SMB1 server service') + else: + print('OK: SMB1 server enabled in registry') + else: + was_smb1server = run_powershell('Get-SmbServerConfiguration | Select EnableSMB1Protocol').get('EnableSMB1Protocol',True) + print('Current SMB1 status : %s' % (was_smb1server,)) + if not was_smb1server: + print('Enabling SMB1') + result = run_powershell('Set-SmbServerConfiguration -EnableSMB1Protocol $true -Force') + result = run_powershell('Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart') + # {u'ScratchDirectory': None, u'RestartNeeded': True, u'LogLevel': 2, u'LogPath': u'C:\\Windows\\Logs\\DISM\\dism.log', u'WinPath': None, u'Online': True, u'SysDrivePath': None, u'Path': None} + if result.get('RestartNeeded',True): + restart_needed_by.append('Enable SMB1 Server Feature') + + restart_needed_by.extend(pending_reboot_reasons()) + if not was_smb1server or restart_needed_by: + with disable_file_system_redirection(): + run_notfatal('msg * /time:360 Merci de redemarrer votre ordinateur pour terminer la reactivation du service serveur SMB1. Tranquil IT Systems.') + else: + print('No reboot required') diff --git a/tis/tis-disable-smb1-client/windowsserver2003-kb4012598-x86-custom-fra_9cf9ac070a1b21bca6757de5d127427c090d581d.exe b/tis/tis-disable-smb1-client/windowsserver2003-kb4012598-x86-custom-fra_9cf9ac070a1b21bca6757de5d127427c090d581d.exe new file mode 100644 index 0000000..0e04afd --- /dev/null +++ b/tis/tis-disable-smb1-client/windowsserver2003-kb4012598-x86-custom-fra_9cf9ac070a1b21bca6757de5d127427c090d581d.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f113bbcb4ec87efb80b105de1591e42dd9ff41f2f81fe04bab3e878cd5c069e +size 707320 diff --git a/tis/tis-disable-smb1-client/windowsxp-kb4012598-x86-custom-fra_eb47689656c58ab374521babb9bdca07304d87f5.exe b/tis/tis-disable-smb1-client/windowsxp-kb4012598-x86-custom-fra_eb47689656c58ab374521babb9bdca07304d87f5.exe new file mode 100644 index 0000000..f737192 --- /dev/null +++ b/tis/tis-disable-smb1-client/windowsxp-kb4012598-x86-custom-fra_eb47689656c58ab374521babb9bdca07304d87f5.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b5aa3201ca409a073dabff9c5fdd8a635851eb37befaef28829c4f374367412 +size 688880 diff --git a/tis/tis-enable-smb1-client/WAPT/certificate.crt b/tis/tis-enable-smb1-client/WAPT/certificate.crt new file mode 100644 index 0000000..4d9c7b0 --- /dev/null +++ b/tis/tis-enable-smb1-client/WAPT/certificate.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIUcFRJMa4zqkCH5BWTdQs5ogRDo9swDQYJKoZIhvcNAQEL +BQAwgZAxCzAJBgNVBAYTAkZSMSIwIAYDVQQHDBlTYWludC1TZWJhc3RpZW4gc3Vy +IExvaXJlMRQwEgYDVQQKDAtUcmFucXVpbCBJVDEUMBIGA1UEAwwLVHJhbnF1aWwg +SVQxJDAiBgkqhkiG9w0BCQEWFXRlY2huaXF1ZUB0cmFucXVpbC5pdDELMAkGA1UE +CwwCSVQwHhcNMjAwMjI0MTYxNzMxWhcNMzAwMjIxMTYxNzMxWjCBkDELMAkGA1UE +BhMCRlIxIjAgBgNVBAcMGVNhaW50LVNlYmFzdGllbiBzdXIgTG9pcmUxFDASBgNV +BAoMC1RyYW5xdWlsIElUMRQwEgYDVQQDDAtUcmFucXVpbCBJVDEkMCIGCSqGSIb3 +DQEJARYVdGVjaG5pcXVlQHRyYW5xdWlsLml0MQswCQYDVQQLDAJJVDCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyo955wqwhYnLdzNFQ77DbWKzCn8QMb +YcvdScsaesMnnS8ZBrdnyrFSFecde+ahGdawDxnDpGTyLcDpwoNGToJLlQi3qnns +Wl9n8x6oRWlfxkA4wLFPdkIWtkqvkijru/eJjBtTEUk0dAejym0+L9NzE6zWnx+C +1V0ShCd9wdayBzTvBREYOhHGiMOuxg9qzjgLqVPNZH1QERKf9GjUuxIW9R3cQU1A +5DD4SvFTH5rxCCV1r6NQ8Wol1l1lvk+oVHX1DmfZuJaUHIlZBz8pTW8tXvYwdioA +MzThkyCYTadAWsVqi+iSAO30mxBssdny0wiH7q4p6qcSZQBOa8W5UTkCAwEAAaNa +MFgwDwYDVR0TAQH/BAUwAwEB/zAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAzAdBgNV +HQ4EFgQUKfyxoBlP6/tLnsWIxC06Q9CszV4wDgYDVR0PAQH/BAQDAgHWMA0GCSqG +SIb3DQEBCwUAA4IBAQB0vl+7NwfYgeoBF2ptolWyAsISB+gRcEBRgmaQAQnb2nxs +pYStlZIsMJnaSHaWnXGXTS6Cw6k9Rm61qrcbrVuzdbHtaDSEakMV17sIVRH0Gyd+ +9K7nXoPhN9vbBEcz8pQ5SgchKMfqAAeQQUqaSmYQ1xUsqUgUHoj6eyYTtJM3pYMN +0uukO0+aUDhvXWQYYurlzJkdqH0kV2IJw+dNBrAvXaVrYBwEIxThQ6UNaEFnPjIX +XYGrkl5wpwoIxMQ8uNjZoFOYxrjvqxEVV2ZjoOGMlYNTHsNC5g25QygCWJtGfrHO +2ywdWen+9NKRBrsVpZo5cMttMgDXrsWiMb+MRGWZ +-----END CERTIFICATE----- diff --git a/tis/tis-enable-smb1-client/WAPT/control b/tis/tis-enable-smb1-client/WAPT/control new file mode 100644 index 0000000..d1456db --- /dev/null +++ b/tis/tis-enable-smb1-client/WAPT/control @@ -0,0 +1,42 @@ +package : tis-enable-smb1-client +version : 11 +architecture : all +section : base +priority : critical +name : +categories : +maintainer : Hubert TOUVET +description : Enable SMB1 Client on Windows > Vista +depends : +conflicts : +maturity : +locale : +target_os : +min_os_version : 6.0 +max_os_version : +min_wapt_version : +sources : https://srvdev.tranquilit.local/sources/tis-disable-smb1-wapt/trunk/ +installed_size : +impacted_process : +description_fr : +description_pl : +description_de : +description_es : +description_pt : +description_it : +description_nl : +description_ru : +audit_schedule : +editor : +keywords : +licence : +homepage : +package_uuid : b6bdffa4-e2a9-4a8a-b0e7-d7d1a2a9c228 +valid_from : +valid_until : +forced_install_on : +signer : Tranquil IT +signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb +signature : gR0xemqsVCcFJ0e05lTebfdv2JRHCJXHsm52jA7wsP0TWh/TRMJAac/VoNNGbQKGo7QXfo/y3dAX1VVu0DZ0QauAv9Mja9zzgfcUcBpQm7k2p7+im4waHyeVoNSl19c6A2dycdpStZlWBtG6s2E2KBMSYpCveH1Sn2MSsUb1f5eiy84UisFGkUNNhmn+6y6qo7FvSIAZ+TglIhT30n6Ur8RrV8/y+KOBNr1tVXr5KQs2IWVGZVBnj73Frj9k0apniIWs7gX+dVFLTCgt44DabsqgXCMS3nxVamTYNGgHDRpWlmZjuUqqjlfJuj7B4RjPbQJVOKCRLW19f0vB4iaeXw== +signature_date : 2020-02-27T21:31:57.375055 +signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,signer,signer_fingerprint,signature_date,signed_attributes \ No newline at end of file diff --git a/tis/tis-enable-smb1-client/WAPT/manifest.sha1 b/tis/tis-enable-smb1-client/WAPT/manifest.sha1 new file mode 100644 index 0000000..3739c0b --- /dev/null +++ b/tis/tis-enable-smb1-client/WAPT/manifest.sha1 @@ -0,0 +1 @@ +[["setup.py","7b54165a3fba1d3cbace3bc8db1e2eb1e56f0d6c"],["WAPT/certificate.crt","8d0a43a817fe7784c63839db94ddf8a3572c8e7a"],["WAPT/wapt.psproj","557e60050809687d56525e6ac46df9c0e02ccae6"],["WAPT/control","b7ebf575e07b9e983bce337a6f717a8dc9c791a8"]] \ No newline at end of file diff --git a/tis/tis-enable-smb1-client/WAPT/manifest.sha256 b/tis/tis-enable-smb1-client/WAPT/manifest.sha256 new file mode 100644 index 0000000..32bdc76 --- /dev/null +++ b/tis/tis-enable-smb1-client/WAPT/manifest.sha256 @@ -0,0 +1 @@ +[["setup.py","1979e98fd406487a37762cb51ba6dc21079b2cf4711971595fdf6febe87ff384"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/wapt.psproj","795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"],["WAPT/control","557a8ad7bdbb6bda9b4a115744c888ebabd5cc104802312481ae6ec5366ad763"]] \ No newline at end of file diff --git a/tis/tis-enable-smb1-client/WAPT/signature b/tis/tis-enable-smb1-client/WAPT/signature new file mode 100644 index 0000000..cba0d3a --- /dev/null +++ b/tis/tis-enable-smb1-client/WAPT/signature @@ -0,0 +1,5 @@ +VVqiYvx5M0oCLBdh9BjQSFXKvmYEaD9MNClN7oqNosxDDOql9lxdHzppAdNLIkzTE0YmPe4TGG3T +D1puyUuSjn70k1mo1xsdu5xdPViElZuyG9XjOw7ZmleaeKf/DAnMjsTKK7OMIdMtbtxqlhBUBK2u +uvwtCuYLXeV/x4JOi1go7W2/mHA4mglnAr/h9UkPqGKlisjA9qFOYYDqn7ODTd58blRb3ZtzFk1j +ZrxJ9VQPyJu8c7PIYBgsEd0ouWVdM1ldsar05JQzmUvC0b933WNidDwUq/AsP4uzKyHLo4Sf7cut +pMnGIS3444QGhtEXANMeCs2VQGs/TldxE+6omg== diff --git a/tis/tis-enable-smb1-client/WAPT/signature.sha256 b/tis/tis-enable-smb1-client/WAPT/signature.sha256 new file mode 100644 index 0000000..104897c --- /dev/null +++ b/tis/tis-enable-smb1-client/WAPT/signature.sha256 @@ -0,0 +1,5 @@ +v2cEqFjlhrfJZmU2hxkr48FlXwxce0tpeRjTzdmKjaZJrR6QSa8akziOR/R2+t7ALvGrZRPn1uI6 +6gCUukdrtA9voFoCvZ37vHsFkG3Fn7TAdY49LxHymKY2TK8p3YrDvkDaaAzVamSVJRg1NB2kDjzn +Gxec1Fw572bqczW/wvgpvBLtogkHoUeDeheXhTa+hWpEo2IJK1qtK2Q1fVfPg7Llxhsf9UAM9L9G +QAq9Z6Qf3pzramIDnyTO6DxZKssFQYFU/crQsecFioh703jHUSHJUnQfuqeHCCgwqELLD+iMUOHp +roAPhgB4qmam+6m6qMGNDmyoZG7TnKNHnvptCA== diff --git a/tis/tis-enable-smb1-client/WAPT/wapt.psproj b/tis/tis-enable-smb1-client/WAPT/wapt.psproj new file mode 100644 index 0000000..be63f91 --- /dev/null +++ b/tis/tis-enable-smb1-client/WAPT/wapt.psproj @@ -0,0 +1,247 @@ +[PyScripter] +Version=2.5.3.0 + +[Project] +ClassName=TProjectRootNode +StoreRelativePaths=TRUE +ShowFileExtensions=FALSE + +[Project\ChildNodes\Node0] +ClassName=TProjectFilesNode + +[Project\ChildNodes\Node0\ChildNodes\Node0] +ClassName=TProjectFolderNode +Name=wapt + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0] +ClassName=TProjectFileNode +FileName=c:\wapt\common.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1] +ClassName=TProjectFileNode +FileName=c:\wapt\setuphelpers.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2] +ClassName=TProjectFileNode +FileName=c:\wapt\wapt-get.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3] +ClassName=TProjectFileNode +FileName=c:\wapt\wapt-get.ini + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4] +ClassName=TProjectFileNode +FileName=c:\wapt\waptpackage.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes] +Count=5 + +[Project\ChildNodes\Node0\ChildNodes\Node1] +ClassName=TProjectFileNode +FileName=$[Project-Path]control + +[Project\ChildNodes\Node0\ChildNodes\Node2] +ClassName=TProjectFileNode +FileName=$[Project-Path]..\setup.py + +[Project\ChildNodes\Node0\ChildNodes] +Count=3 + +[Project\ChildNodes\Node1] +ClassName=TProjectRunConfiguationsNode + +[Project\ChildNodes\Node1\ChildNodes\Node0] +ClassName=TProjectRunConfiguationNode +Name=install + +[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug install "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node1] +ClassName=TProjectRunConfiguationNode +Name=remove + +[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug remove "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node2] +ClassName=TProjectRunConfiguationNode +Name=session-setup + +[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug session-setup "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node3] +ClassName=TProjectRunConfiguationNode +Name=update + +[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug update +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node4] +ClassName=TProjectRunConfiguationNode +Name=upgrade + +[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-f -ldebug upgrade +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node5] +ClassName=TProjectRunConfiguationNode +Name=-i build-upload + +[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug -i build-upload "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node6] +ClassName=TProjectRunConfiguationNode +Name=svn update + +[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug sources "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node7] +ClassName=TProjectRunConfiguationNode +Name=uninstall + +[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig] +ScriptName=c:\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-ldebug uninstall "$[ActiveDoc-Dir]" +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes] +Count=8 + +[Project\ChildNodes] +Count=2 + +[Project\ExtraPythonPath] +Item0=c:\wapt +Item1=c:\wapt\lib\site-packages +Count=2 + diff --git a/tis/tis-enable-smb1-client/setup.py b/tis/tis-enable-smb1-client/setup.py new file mode 100644 index 0000000..573efb2 --- /dev/null +++ b/tis/tis-enable-smb1-client/setup.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +from setuphelpers import * +import platform + +uninstallkey = [] + +def pending_reboot_reasons(): + result = [] + reboot_required = registry_readstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update','RebootRequired',0) + if reboot_required: + result.append('Windows Update: %s' % reboot_required) + reboot_pending = registry_readstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing','RebootPending',0) + if reboot_pending: + result.append('CBS Updates: %s' % reboot_pending) + #renames_pending = registry_readstring(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\Session Manager','PendingFileRenameOperations',None) + #if renames_pending: + # result.append('File renames: %s' % renames_pending) + return result + +def install(): + restart_needed_by = [] + if windows_version() == Version('10.0'): + print('enable smb1protocol') + result = run_powershell('Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart') + if result.get('RestartNeeded',False): + restart_needed_by.append('Enable Windows 10 optional feature smb1protocol') + elif windows_version() == Version('6.2'): + print('add SMB1-FS') + result = run_powershell('Add-WindowsFeature -Name SMB1-FS -NoRestart') + if result.get('RestartNeeded',False): + restart_needed_by.append('Enable windows 12 feature smb1protocol') + elif (service_installed('mrxsmb10') and not service_is_running('mrxsmb10')): + print('Enable SMB1 client') + # see https://support.microsoft.com/fr-fr/help/2696547/how-to-enable-and-disable-smbv1,-smbv2,-and-smbv3-in-windows-vista,-windows-server-2008,-windows-7,-windows-server-2008-r2,-windows-8,-and-windows-server-2012 + run('sc.exe config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi') + run('sc.exe config mrxsmb10 start= auto') + try: + to_restart = [] + svcdepends = run('sc enumdepend lanmanworkstation').splitlines() + # ['SessionEnv', 'Netlogon', 'Browser'] + depends = [s.split(': ')[1] for s in svcdepends if s.startswith('SERVICE_NAME: ')] + for svc in depends: + if service_is_running(svc): + print('Stopping %s'%svc) + service_stop(svc) + to_restart.append(svc) + print('Restarting lanmanworkstation...') + if service_is_running('lanmanworkstation'): + service_restart('lanmanworkstation') + else: + service_start('lanmanworkstation') + print('Done.') + + print('lanmanworkstation redemarre avec SMB1') + except Exception as e: + print('Error trying to stop depends or start lanmanworkstation: %s' % repr(e)) + restart_needed_by.append('Enable SMB1 client service') + if not service_is_running('lanmanworkstation'): + service_start('lanmanworkstation') + finally: + for svc in to_restart: + if not service_is_running(svc): + print('Starting %s'%svc) + service_start(svc) + else: + print('OK: SMB1 client running or not installed or windows system not supported (version %s)' % windows_version()) + + #restart_needed_by.extend(pending_reboot_reasons()) + if (service_installed('mrxsmb10') and not service_is_running('mrxsmb10')) or restart_needed_by: + with disable_file_system_redirection(): + run_notfatal('msg * /time:360 Merci de redemarrer votre ordinateur pour terminer la l''activation du service client SMB1. Tranquil IT Systems.') + error('Redemarrage necessaire pour : %s ' % restart_needed_by) + else: + print('No reboot required') + +