Windows DOS示例

Windows DOS示例

一、NetSH       微软又把 SMB 改名为 CIFS(CommonInternet File System)   SMB协议改445为139段鸥    https://wenda.so.com/q/1382836325061542

        1、NetSH interface 

              netsh interface ipv4 show config           显示本地ip地址及其他信息

              netsh interface ipv4 set address name="本地连接" source=dhcp(需要管理员权限)      将本地计算机的网络连接名称设置为"本地连接",网络设置为动态分配
              netsh interface ipv4 set address name="本地连接" source=static addr=192.168.1.6 mask=255.255.255.0 gateway=192.168.1.1 gwmetric=1     将本地计算机的网络连接名称设置为"本地连接",网络设置为静态,本地ip地址为"192.168.1.6",默认网关为"192.168.1.1"(需要管理员权限运行)
 
        2、WLAN
              netsh wlan show profiles       显示本地计算机上所有无线网路配置的文件列表
              netsh wlan show profiles name="HUAWEI" key=clear    显示本地计算机连接过的无线网络,名称为"HUAWEI"的明文密码
 
        3、firewall      网址:https://go.microsoft.com/fwlink/?linkid=121488
              show 显示防火墙配置
              add allowedprogram 添加防火墙允许的程序配置。
              add portopening 添加防火墙端口配置
              delete allowedprogram 删除防火墙允许的程序配置
              delete portopening 删除防火墙端口配置
              set allowedprogram 设置防火墙允许的程序配置
              set icmpsetting 设置防火墙 ICMP 配置
              set logging 设置防火墙记录配置
              set multicastbroadcastresponse 设置防火墙多播/广播响应配置
              set notifications 设置防火墙通知配置
              set opmode 设置防火墙操作配置
              set portopening 设置防火墙端口配置
              set service 设置防火墙服务配置
              show allowedprogram 显示防火墙允许的程序配置
              show config 显示防火墙配置。
              show currentprofile 显示当前防火墙配置文件
              show icmpsetting 显示防火墙 ICMP 配置
              show logging 显示防火墙记录配置
              show multicastbroadcastresponse 显示防火墙多播/广播响应配置
              show notifications 显示防火墙操作配置
              show opmode 显示防火墙端口配置
              show portopening 显示防火墙端口配置
              show service 显示防火墙服务配置
              show state 显示当前防火墙状态 
          4、advfirewall
              netsh advfirewall show currentprofile     显示防火墙策略中活动配置文件的属性
              netsh advfirewall set allprofiles state off        关闭防火墙(公用与专用)(需要管理员权限运行)
              netsh advfirewall set allprofiles state on         开启防火墙(公用与专用)(需要管理员权限运行)
              netsh advfirewall set allprofiles firewallpolicy blockinbound.allowoutbound          在所有配置文件中设置默认阻挡入站并允许出站通信
              netsh advfirewall firewall add rule name="allow80" protocol=TCP dir=out localport=80      为TCP端口80添加阻挡的出站规则
              netsh advfirewall firewall add rule name="Require Encryption for Inbound TCP/80" protocol=TCP dir=in localport=80 security=authdynenc action=allow    
              为TCP端口80通信添加需要安全和加密的入站规则
              netsh advfirewall firewall add rule name="allow nei" protocol=TCP dir=in program="c:\nei.exe" security=authnoencap action=allow
              为不具有封装的"c:\nei.exe"添加入站规则
              netsh advfirewall firewall show rule name="allow80"          查看入站规则"allow80"的详细信息
          5、winsock
                     winsock是Windows网络编程接口,winsock工作在应用层,它提供与底层传输协议无关的高层数据传输编程接口 。
               audit – 显示已经安装和删除的 Winsock LSP 列表。
               dump – 显示一个配置脚本。
               help – 显示命令列表。
               remove – 从系统中删除 Winsock LSP。
               reset – 重置 Winsock 目录为清除状态。
               set – 设置 Winsock 选项。
               show – 显示信息。
                     netsh winsock reset          将网络编程接口恢复到默认状态
              
posted @ 2021-08-04 00:25  博雅塔之客  阅读(86)  评论(0编辑  收藏  举报