吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 7128|回复: 12
收起左侧

[PC样本分析] 该文件中,含有后门木马特征,请谨慎使用

[复制链接]
liguhe 发表于 2014-11-30 00:25
使用论坛附件上传样本压缩包时必须使用压缩密码保护,压缩密码:52pojie,否则会导致论坛被杀毒软件等误报,论坛有权随时删除相关附件和帖子!
病毒分析分区附件样本、网址谨慎下载点击,可能对计算机产生破坏,仅供安全人员在法律允许范围内研究,禁止非法用途!
禁止求非法渗透测试、非法网络攻击、获取隐私等违法内容,即使对方是非法内容,也应向警方求助!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.IO;
using System.Xml;
using System.Data.SqlClient;
using System.Data;
using Hd.Common.DEncrypt;
using System.Diagnostics;

namespace Hd.Socket.WpfServer
{



    public partial class WindowSet : Window
    {


        string strFileName = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Database.config";
        string strKeyFileName = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Key.config";
        string strAppFileName = AppDomain.CurrentDomain.BaseDirectory.ToString() + "WpfServer.exe.config";
        public WindowSet()
        {
            InitializeComponent();
            this.ResizeMode = ResizeMode.CanMinimize;
            Init();
        }

        private void Init()
        {
            try
            {
                if (File.Exists(strKeyFileName))
                {
                    string RegisterCode = "";
                    RegisterCode = File.ReadAllText(strKeyFileName);
                    txtRegistration.Text = RegisterCode;
                }
                else
                {
                    MessageBox.Show("配置文件丢失");
                }
                if (File.Exists(strFileName))
                {
                    string[] strarray=Hd.DBUtility.PubConstant.ConnectionString.Split(';');
                    txbServer.Text = strarray[0].Replace("server=", "");
                    txbDataBase.Text = strarray[1].Replace("database=", "");
                    txbUser.Text = strarray[2].Replace("uid=", "");
                    txbPwd.Text = strarray[3].Replace("pwd=", "");
                }
                else
                {
                    MessageBox.Show("配置文件丢失");
                }

                List<Model.ServerCodes> serverlist = new Hd.BLL.ServerCodesExt().GetCanUserServerList(Hd.Socket.Server.SocketServer.m_FlagGUID);
                cbxServer.ItemsSource = serverlist;
                cbxServer.DisplayMemberPath = "ServerName";
                cbxServer.SelectedValuePath = "ServerCode";
                if (serverlist.Count > 0)
                {
                    cbxServer.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void btnRegistration_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                File.WriteAllText(strKeyFileName, txtRegistration.Text.Trim());
                MessageBox.Show("修改成功,请重新运行系统!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void btnTest_Click(object sender, RoutedEventArgs e)
        {
            if (IsCanConnect())
            {
                MessageBox.Show("连接成功!");
            }
            else
            {
                MessageBox.Show("连接失败!");
            }
        }

        private bool IsCanConnect()
        {
            string ConnectionString = string.Format("server={0};database={1};uid={2};pwd={3};Connection Timeout=6;", txbServer.Text.Trim(), txbDataBase.Text.Trim(), txbUser.Text.Trim(), txbPwd.Text.Trim());
            using (SqlConnection mySqlConnection = new SqlConnection(ConnectionString))
            {
                bool IsCanConnectioned = false;

                try
                {

                    mySqlConnection.Open();
                    IsCanConnectioned = true;
                }
                catch
                {
                    IsCanConnectioned = false;
                }
                finally
                {
                    mySqlConnection.Close();
                }
                if (mySqlConnection.State == ConnectionState.Closed || mySqlConnection.State == ConnectionState.Broken)
                {
                    return IsCanConnectioned;
                }
                else
                {
                    return IsCanConnectioned;
                }
            }
        }

        private void btnConnection_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (File.Exists(strFileName))
                {
                    string ConnectionString = string.Format("server={0};database={1};uid={2};pwd={3};Connection Timeout=6;", txbServer.Text.Trim(), txbDataBase.Text.Trim(), txbUser.Text.Trim(), txbPwd.Text.Trim());
                    string Encrypt = (cbxEncryption.SelectedItem as ComboBoxItem).Tag.ToString();
                    if (Encrypt.Equals("true"))
                    {
                        ConnectionString = DESEncrypt.Encrypt(ConnectionString);
                    }
                    XmlDocument doc = new XmlDocument();
                    doc.Load(strFileName);

                    XmlNodeList nodes = doc.GetElementsByTagName("add");
                    for (int i = 0; i < nodes.Count; i++)
                    {

                        XmlAttribute att = nodes.Item(i).Attributes["key"];
                        if (att.Value == "IsEncrypt")
                        {
                            XmlAttribute attvalue = nodes.Item(i).Attributes["value"];
                            attvalue.Value = Encrypt;
                        }
                        if (att.Value == "Connection")
                        {
                            XmlAttribute attvalue = nodes.Item(i).Attributes["value"];
                            attvalue.Value = ConnectionString;
                        }
                    }

                    doc.Save(strFileName);
                    MessageBox.Show("修改成功,请重新运行系统!");
                }
                else
                {
                    MessageBox.Show("配置文件丢失");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void btnServer_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (File.Exists(strAppFileName))
                {
                    Model.ServerCodes server = cbxServer.SelectedItem as Model.ServerCodes;
                    XmlDocument doc = new XmlDocument();
                    doc.Load(strAppFileName);

                    XmlNodeList nodes = doc.GetElementsByTagName("server");
                    for (int i = 0; i < nodes.Count; i++)
                    {

                        XmlAttribute att = nodes.Item(i).Attributes["serverTypeName"];
                        if (att.Value == "HdScoketServer")
                        {
                            nodes.Item(i).Attributes["name"].Value = server.ServerCode;
                            nodes.Item(i).Attributes["port"].Value = server.Port;
                            break;
                        }
                    }

                    doc.Save(strAppFileName);
                    MessageBox.Show("修改成功,请重新运行系统!");
                }
                else
                {
                    MessageBox.Show("配置文件丢失");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void cbxServer_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Model.ServerCodes server = cbxServer.SelectedItem as Model.ServerCodes;
            txbServerInfo.Inlines.Clear();
            txbServerInfo.Inlines.Add(string.Format("服务器代码:{0}", server.ServerCode));
            txbServerInfo.Inlines.Add(new LineBreak());
            txbServerInfo.Inlines.Add(new LineBreak());
            txbServerInfo.Inlines.Add(string.Format("服务器名称:{0}", server.ServerName));
            txbServerInfo.Inlines.Add(new LineBreak());
            txbServerInfo.Inlines.Add(new LineBreak());
            txbServerInfo.Inlines.Add(string.Format("服务器端口:{0}", server.Port));
        }

        private void buttonGet_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string filename = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "SerialNumber.exe";

                if (!File.Exists(filename))
                {
                    MessageBox.Show("当前获取机器码程序无法启动!");
                }

                Process p = new System.Diagnostics.Process();
                p.StartInfo.FileName = filename;
                p.StartInfo.Arguments = "";
                p.StartInfo.UseShellExecute = false;
                p.StartInfo.RedirectStandardInput = true;
                p.StartInfo.RedirectStandardOutput = true;
                p.StartInfo.RedirectStandardError = true;
                p.StartInfo.CreateNoWindow = false;
                p.Start();
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
    }
}




请问木马特征在哪里啊

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

头像被屏蔽
赵小磊 发表于 2014-11-30 00:51
提示: 作者被禁止或删除 内容自动屏蔽
Sp4ce 发表于 2014-11-30 01:11
            txbServerInfo.Inlines.Clear();
            txbServerInfo.Inlines.Add(string.Format("服务器代码:{0}", server.ServerCode));
            txbServerInfo.Inlines.Add(new LineBreak());
            txbServerInfo.Inlines.Add(new LineBreak());
            txbServerInfo.Inlines.Add(string.Format("服务器名称:{0}", server.ServerName));
            txbServerInfo.Inlines.Add(new LineBreak());
            txbServerInfo.Inlines.Add(new LineBreak());
            txbServerInfo.Inlines.Add(string.Format("服务器端口:{0}", server.Port));
        }
应该是这段,定义了服务器地址、端口,往上追能找到
nodes.Item(i).Attributes["name"].Value = server.ServerCode;
nodes.Item(i).Attributes["port"].Value = server.Port;
应该是这两段【看代码像C的,@Raker 你不是学C呢么,过来看下】
fenginsc 发表于 2014-11-30 01:05
danwenwen 发表于 2014-11-30 01:34
    大神你好  看不懂
dongwenqi 发表于 2014-11-30 08:27
有样本吗
willJ 发表于 2014-12-4 14:44
轩少 发表于 2014-11-30 01:11
txbServerInfo.Inlines.Clear();
            txbServerInfo.Inlines.Add(string.Format("服 ...

你怎么这么屌

点评

我弟弟就是叼!  发表于 2014-12-4 21:45
a2376641a 发表于 2014-12-4 17:28
学习了~~~~
Sp4ce 发表于 2014-12-4 20:17

大腾讯工程师{:1_931:},能别黑小菜了不。。。
Mr.Mlwareson_V 发表于 2014-12-19 01:17
学习了,分析得很详细                        
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-4 20:57

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表