tis-disable-netbios icon

Disable NetBIOS

Paquet d’installation silencieuse pour Disable NetBIOS

13
System and network
System and network

  • package: tis-disable-netbios
  • name: Disable NetBIOS
  • version: 13
  • categories: System and network
  • maintainer: WAPT Team,Tranquil IT
  • locale: all
  • target_os: windows
  • architecture: all
  • signature_date:
  • size: 7.29 Ko

package           : tis-disable-netbios
version           : 13
architecture      : all
section           : base
priority          : optional
name              : Disable NetBIOS
categories        : System and network
maintainer        : WAPT Team,Tranquil IT
description       : Disable netbios on all interfaces
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : Désactiver netbios sur toutes les interfaces
description_pl    : Wyłączenie netbios na wszystkich interfejsach
description_de    : Netbios auf allen Schnittstellen deaktivieren
description_es    : Desactivar netbios en todas las interfaces
description_pt    : Desactivar netbios em todas as interfaces
description_it    : Disabilitare netbios su tutte le interfacce
description_nl    : Schakel netbios uit op alle interfaces
description_ru    : Отключить netbios на всех интерфейсах
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : ebfd3414-9ee9-4c38-80b2-029a60f87316
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 04c349c5b94ca20ba22d88f25510da7f820cc9d5f1a876e9a3960d0c0cabc353
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2026-03-10T14:17:06.000000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,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,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
signature         : VwdzkE0b4WcyMmMbmKlsDy1MtQ/BgYOGs+PsjMzU3lLNoDEX1W1UmwLJCeVmnyzdsZPJoh0/f8RcIfrS+QAepniTvFKm4Uc0VdN7pNHbuwdxD6BgvkmR1wGO+90YSLOvkL5diYo2YpNpNo/xAl/CMNheUjNNKBMFPodQm458DXMVn6E6jgKvQ8SntYhMLCtFlltFg049V3K+fSoWVBG3Ky08QJB29KUDo+5zdDKCKzAtdIibZ9yOYL7gSwkavtbxQmHR0zfQI5d4W4YdS40qa/jDvRsA1DeKKl1XyDU2+qNa2dAkuvl9w0pkQ9Tfy2A99biyungSkKwJNf8B5KerGA==

from setuphelpers import *
import wmi

uninstallkey = []

"""
Custom name of VPN adapter
Enter the name of the network adapter concerned:
ex: Get-NetAdapter | Select-Object InterfaceDescription
"""
VPN_NAME = "NAME_VPN_ADAPTER"

def install():
    netcfg = wmi.WMI().Win32_NetworkAdapterConfiguration(IPEnabled=True)
    for connection in netcfg:
        adapter_name = connection.Description or ""

        # Skip VPN adapter
        if VPN_NAME.lower() in adapter_name.lower():
            print(u"Skipping NetBIOS disable for VPN adapter: %s" % adapter_name)
            continue

        # Disable Netbios if it is not already disabled
        if connection.TcpipNetbiosOptions != 2:
            print(u"Disabling NetBIOS on %s" % adapter_name)
            connection.SetTcpipNetbios(2)

    print("Fix Denis's last experiment on NetBios things...")

    with disable_file_system_redirection():
        run('reg import "%s"' % makepath(persistent_dir, 'fix.reg'))

def uninstall():
    netcfg = wmi.WMI().win32_NetworkAdapterConfiguration
    for connection in netcfg.query(IPEnabled = True):
        if connection.TcpipNetbiosOptions == 2:
            print(u'Enabling Netbios on %s' % connection.Description)
            connection.SetTcpipNetbios(0)

def audit():
    result = check_netbios()
    if result == "ERROR":
        print('Auto remediation')
        install()

        result = check_netbios()
        if result == "ERROR":
            print('Fail Fix netbios')
            return "ERROR"
    return "OK"

def check_netbios():
    netcfg = wmi.WMI().Win32_NetworkAdapterConfiguration
    has_netbios = []

    for connection in netcfg.query(IPEnabled=True):
        adapter_name = connection.Description or ""

        # Skip VPN adapter
        if VPN_NAME.lower() in adapter_name.lower():
            print(u'OK: SentinelOne VPN detected, check skipped for: %s' % adapter_name)
            continue

        if connection.TcpipNetbiosOptions == 2:
            print(u'OK: NetBIOS disabled on: %s' % adapter_name)
        else:
            print(u'ERROR: NetBIOS enabled on: %s' % adapter_name)
            has_netbios.append(adapter_name)

    if has_netbios:
        print(u'\nNetBIOS must be disabled on:\n%s' % u'\n'.join(has_netbios))
        return 'ERROR'
    else:
        return 'OK'

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
f3ac430eb05b2a59b0e58ac0cd294222981f618e8a971333fb21cc7b3a21858b : WAPT/control
04c349c5b94ca20ba22d88f25510da7f820cc9d5f1a876e9a3960d0c0cabc353 : WAPT/icon.png
df9e7a57d9d44a24a5339aa627880b6d5f61c7bed55c8d30932c54517cbc2915 : WAPT/persistent/fix.reg
f6135525818624980efa46537bb664c21db2794e8a7d32e0d38af43e7c237a89 : luti.json
df30bf520d39da95556e618a365d49d1717eaebdd1df764d0c31fd7906e11ba6 : setup.py