• netsh 无文件攻击


    netsh滥用例子:

    https://any.run/report/f77d0ef3d5aa74b233cb642fa5b6dab1c57c9cde503e1a3dd085dba621fbb45c/aa925b1d-19c8-497f-b328-3364e85297b4

    ==》 删除防火墙规则:C:\Windows\system32\netsh.exe advfirewall firewall delete rule profile=any name="ragent.exe"

    https://any.run/report/6333aaa3b8d8dd2dfb449065a012b50d177048d1fec943a4ab2ebaf02eefd6dc/d4aed934-1cb6-44d2-97e3-f0239406ca85

    ==》添加防火墙白名单:netsh firewall add allowedprogram "C:\Users\admin\AppData\Local\Temp\Server2.exe" "Server2.exe" ENABLE

    Netsh 命令语法、上下文和格式设置

    适用于: Windows server 2022,Windows Server 2019,Windows Server 2016,Azure Stack HCI,版本21H2 和20H2

    你可以使用本主题来学习如何输入 netsh 上下文和子上下文、了解 netsh 语法和命令格式,以及如何在本地和远程计算机上运行 netsh 命令。

    Netsh 是命令行脚本实用工具,可让你显示或修改当前正在运行的计算机的网络配置。 可以通过在 netsh 提示符下键入命令来运行 Netsh 命令,并且可以在批处理文件或脚本中使用 Netsh 命令。 可以使用 netsh 命令来配置远程计算机和本地计算机。

    Netsh 还提供脚本功能,可让你在批处理模式下对指定的计算机运行一组命令。 你可以使用 Netsh 将配置脚本保存在文本文件中,以便存档或者帮助你配置其他计算机。

    Netsh 上下文

    Netsh 通过使用动态链接库 (DLL) 文件与其他操作系统组件进行交互。

    每个 netsh 帮助程序 DLL 提供一组称为“上下文”的广泛功能,这是一组特定于网络服务器角色或功能的命令 。 这些上下文通过为一个或多个服务、实用工具或协议提供配置和监视支持来扩展 netsh 的功能。 例如,Dhcpmon.dll 向 netsh 提供配置和管理 DHCP 服务器所需的上下文和命令集。

    获取上下文列表

    可以通过在运行 Windows Server 2016 或 Windows 10 的计算机上打开命令提示符或 Windows PowerShell 来获取 netsh 上下文列表。 键入命令 netsh ,然后按 enter。 键入 /?,然后按 Enter 。

    下面是运行 Windows Server 2016 Datacenter 的计算机上的这些命令的示例输出。

    PS C:\Windows\system32> netsh
    netsh>/?
    
    The following commands are available:
    
    Commands in this context:
    ..            - Goes up one context level.
    ?             - Displays a list of commands.
    abort         - Discards changes made while in offline mode.
    add           - Adds a configuration entry to a list of entries.
    advfirewall   - Changes to the `netsh advfirewall' context.
    alias         - Adds an alias.
    branchcache   - Changes to the `netsh branchcache' context.
    bridge        - Changes to the `netsh bridge' context.
    bye           - Exits the program.
    commit        - Commits changes made while in offline mode.
    delete        - Deletes a configuration entry from a list of entries.
    dhcpclient    - Changes to the `netsh dhcpclient' context.
    dnsclient     - Changes to the `netsh dnsclient' context.
    dump          - Displays a configuration script.
    exec          - Runs a script file.
    exit          - Exits the program.
    firewall      - Changes to the `netsh firewall' context.
    help          - Displays a list of commands.
    http          - Changes to the `netsh http' context.
    interface     - Changes to the `netsh interface' context.
    ipsec         - Changes to the `netsh ipsec' context.
    ipsecdosprotection - Changes to the `netsh ipsecdosprotection' context.
    lan           - Changes to the `netsh lan' context.
    namespace     - Changes to the `netsh namespace' context.
    netio         - Changes to the `netsh netio' context.
    offline       - Sets the current mode to offline.
    online        - Sets the current mode to online.
    popd          - Pops a context from the stack.
    pushd         - Pushes current context on stack.
    quit          - Exits the program.
    ras           - Changes to the `netsh ras' context.
    rpc           - Changes to the `netsh rpc' context.
    set           - Updates configuration settings.
    show          - Displays information.
    trace         - Changes to the `netsh trace' context.
    unalias       - Deletes an alias.
    wfp           - Changes to the `netsh wfp' context.
    winhttp       - Changes to the `netsh winhttp' context.
    winsock       - Changes to the `netsh winsock' context.
    
    The following sub-contexts are available:
     advfirewall branchcache bridge dhcpclient dnsclient firewall http interface ipsec ipsecdosprotection lan namespace netio ras rpc trace wfp winhttp winsock
    
    To view help for a command, type the command, followed by a space, and then type ?.
    

    子上下文

    Netsh 上下文可以同时包含命令和其他上下文(称为“子上下文” )。 例如,在 Routing 上下文中可以更改为 IP 和 IPv6 子上下文。

    若要显示可以在上下文中使用的命令和子上下文列表,请在 netsh 提示符下键入上下文名称,然后键入 /? 或 help。 例如,若要显示可以在路由上下文中使用的子上下文和命令的列表,请在 netsh 提示符 (即netsh ) ,键入以下命令之一:

    routing /?

    routing help

    若要在不更改当前上下文的情况下在另一个上下文中执行任务,请在 netsh 提示符下键入要使用的命令的上下文路径。 例如,若要在 IGMP 上下文中添加名为“Local Area Connection”的接口,且无需提前更改为 IGMP 上下文,请在 netsh 提示符下键入:

    routing ip igmp add interface "Local Area Connection" startupqueryinterval=21

    运行 netsh 命令

    若要运行 netsh 命令,则必须在命令提示符下键入 netsh,然后按 Enter 以启动 netsh 。 接下来可以更改为包含要使用的命令的上下文。 可用的上下文取决于已安装的网络组件。 例如,如果在 netsh 提示符下键入 dhcp 并按 Enter,则 netsh 将更改为 DHCP 服务器上下文 。 但如果未安装 DHCP,则会显示以下消息:

    找不到以下命令:dhcp 。

  • 相关阅读:
    字符串的全排列

    链表
    青蛙跳一格或者两格,n格跳法
    二叉树
    Concurrent实现原理
    sql语句总结 (转) http://blog.csdn.net/fengfeng91/article/details/15029173
    ArrayList实现原理
    java虚拟机 内存分配
    【转】关于Quartus ii无法识别Modelsim路径的问题
  • 原文地址:https://www.cnblogs.com/bonelee/p/16022338.html
Copyright © 2020-2023  润新知