Files
ayanova7/source/Backdoor/Form1.cs
2018-06-29 19:47:36 +00:00

178 lines
4.0 KiB
C#

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Text;
namespace Backdoor
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox edOut;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.edOut = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// edOut
//
this.edOut.Dock = System.Windows.Forms.DockStyle.Fill;
this.edOut.Location = new System.Drawing.Point(0, 0);
this.edOut.Multiline = true;
this.edOut.Name = "edOut";
this.edOut.Size = new System.Drawing.Size(456, 293);
this.edOut.TabIndex = 0;
this.edOut.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(456, 293);
this.Controls.Add(this.edOut);
this.Name = "Form1";
this.Text = "AyaNova BackDoor login ";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
edOut.AppendText("Today's login:\r\n");
edOut.AppendText(Generate(System.DateTime.Today,new Random(unchecked((int)DateTime.Now.Ticks))));
edOut.AppendText("\r\nTomorrow's login:\r\n");
edOut.AppendText(Generate(System.DateTime.Today.AddDays(1),new Random(~unchecked((int)DateTime.Now.Ticks))));
}
private string Generate(System.DateTime dtWhen, Random r)
{
int nDummyCharFactor=4;
int ndwf=0;
StringBuilder sb = new StringBuilder();
string sLogin="";
string sPassword="";
switch(dtWhen.DayOfWeek)
{
case System.DayOfWeek.Monday:
ndwf=12;
break;
case System.DayOfWeek.Tuesday:
ndwf=49;
break;
case System.DayOfWeek.Wednesday:
ndwf=23;
break;
case System.DayOfWeek.Thursday:
ndwf=65;
break;
case System.DayOfWeek.Friday:
ndwf=87;
break;
case System.DayOfWeek.Sunday:
ndwf=99;
break;
case System.DayOfWeek.Saturday:
ndwf=72;
break;
}
int nLogin=dtWhen.DayOfYear+ndwf*ndwf;
int nPassword=(dtWhen.Year+dtWhen.Month+ndwf)*(ndwf+2);
char dummy=' ';
foreach(char c in nLogin.ToString())
{
int nDummycharcount=r.Next(nDummyCharFactor)+1;
for(int x=0;x<nDummycharcount;x++)
{
dummy=(char)(r.Next(26)+65);
sLogin+=dummy;
}
sLogin+=c;
}
sb.Append("Login:[");
sb.Append(sLogin);
sb.Append("]\r\n");
//Do password
foreach(char c in nPassword.ToString())
{
int nDummycharcount=r.Next(nDummyCharFactor)+1;
for(int x=0;x<nDummycharcount;x++)
{
dummy=(char)(r.Next(26)+65);
sPassword+=dummy;
}
sPassword+=c;
}
sb.Append("Password:[");
sb.Append(sPassword);
sb.Append("]\r\n");
return sb.ToString();
}
}
}