
raver2046
|
je me lance mais je me doute que vous allez rire car c'est codé un peu a la bourin.
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Diagnostics; using System.Threading;
namespace WindowsApplication8 { /// <summary> /// Description résumée de Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { public string file; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Button button1; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.Label label3; private System.ComponentModel.IContainer components;
public Form1() { // // Requis pour la prise en charge du Concepteur Windows Forms // InitializeComponent();
// // TODO : ajoutez le code du constructeur après l'appel à InitializeComponent // }
/// <summary> /// Nettoyage des ressources utilisées. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); }
#region Windows Form Designer generated code /// <summary> /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas /// le contenu de cette méthode avec l'éditeur de code. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); this.textBox1 = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.textBox3 = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.textBox2 = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // textBox1 // this.textBox1.AcceptsReturn = true; this.textBox1.AcceptsTab = true; this.textBox1.BackColor = System.Drawing.Color.DimGray; this.textBox1.ForeColor = System.Drawing.Color.Lime; this.textBox1.Location = new System.Drawing.Point(0, 80); this.textBox1.MaxLength = 255555555; this.textBox1.Multiline = true; this.textBox1.Name = "textBox1"; this.textBox1.ReadOnly = true; this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.textBox1.Size = new System.Drawing.Size(416, 176); this.textBox1.TabIndex = 0; this.textBox1.TabStop = false; this.textBox1.Text = ""; this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); // // button1 // this.button1.BackColor = System.Drawing.Color.DimGray; this.button1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128))); this.button1.Location = new System.Drawing.Point(344, 296); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(64, 32); this.button1.TabIndex = 1; this.button1.Text = "GO"; this.button1.Click += new System.EventHandler(this.button1_Click); // // pictureBox1 // this.pictureBox1.BackColor = System.Drawing.Color.Black; this.pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand; this.pictureBox1.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(424, 82); this.pictureBox1.TabIndex = 2; this.pictureBox1.TabStop = false; this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); // // groupBox1 // this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] { this.textBox3, this.label2, this.label1, this.textBox2}); this.groupBox1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128))); this.groupBox1.Location = new System.Drawing.Point(8, 264); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(200, 64); this.groupBox1.TabIndex = 6; this.groupBox1.TabStop = false; this.groupBox1.Text = "Params."; // // textBox3 // this.textBox3.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.textBox3.Location = new System.Drawing.Point(72, 40); this.textBox3.Name = "textBox3"; this.textBox3.Size = new System.Drawing.Size(120, 18); this.textBox3.TabIndex = 7; this.textBox3.Text = "254.254.254.254"; // // label2 // this.label2.Font = new System.Drawing.Font("Lucida Console", 8.25F); this.label2.Location = new System.Drawing.Point(24, 40); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(48, 16); this.label2.TabIndex = 6; this.label2.Text = "IP END"; // // label1 // this.label1.Font = new System.Drawing.Font("Lucida Console", 8.25F); this.label1.Location = new System.Drawing.Point(8, 16); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(64, 16); this.label1.TabIndex = 5; this.label1.Text = "IP START"; // // textBox2 // this.textBox2.BackColor = System.Drawing.Color.White; this.textBox2.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.textBox2.Location = new System.Drawing.Point(72, 16); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(120, 18); this.textBox2.TabIndex = 4; this.textBox2.Text = "127.0.0.1"; // // label4 // this.label4.BackColor = System.Drawing.Color.Black; this.label4.Font = new System.Drawing.Font("Lucida Console", 8.25F); this.label4.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128))); this.label4.Location = new System.Drawing.Point(320, 64); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(96, 16); this.label4.TabIndex = 7; this.label4.Text = "By Raver2046"; // // label3 // this.label3.BackColor = System.Drawing.Color.Black; this.label3.Font = new System.Drawing.Font("Lucida Console", 8.25F); this.label3.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128))); this.label3.Location = new System.Drawing.Point(304, 264); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(104, 16); this.label3.TabIndex = 8; this.label3.Text = "Powered by C#"; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(416, 332); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.label3, this.label4, this.groupBox1, this.pictureBox1, this.button1, this.textBox1}); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Form1"; this.Opacity = 0.89999997615814209; this.Text = " -= HYPNO RPC DCOM2 GUI =-"; this.groupBox1.ResumeLayout(false); this.ResumeLayout(false);
} #endregion
/// <summary> /// Point d'entrée principal de l'application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); }
private void button1_Click(object sender, System.EventArgs e) { button1.Text="PAUSE"; button1.Refresh(); string neFile = "RPC2.exe"; file = neFile; FileInfo fi = new FileInfo(neFile);
if (!fi.Exists) { MessageBox.Show("Manque le fichier " + neFile); button1.Text="GO"; button1.Refresh(); } else { if(button1.Text=="PAUSE") { Thread t = new Thread(new ThreadStart(scan)); /* L'instence de ThreadStart demande un delegate * en paramètre ce qui est plus ou moins * l'équivalent d'un pointeur de fonction en C++ */ t.Start();
//scan();
} else { button1.Text="PAUSED"; button1.Refresh(); } } }
private void textBox1_TextChanged(object sender, System.EventArgs e) { } private uint[] ConvertStringArrayToIntArray(string[] sArray) { uint[] iArray = new uint[sArray.Length]; int length = sArray.Length; for (int i=0; i<length; i++) iArray[i] = uint.Parse(sArray[i]);
return iArray; } private void pictureBox1_Click(object sender, System.EventArgs e) { Process p = new Process(); p.StartInfo.FileName = "http://www.hypnowarez.org/"; p.Start(); }
private void scan() { // début du traitement de chaine pour faire un scanner string[] dbs,fns; string ip="127.0.0.1"; bool i=true; dbs = textBox2.Text.Split('.'); fns = textBox3.Text.Split('.'); uint[] db =ConvertStringArrayToIntArray(dbs); uint[] fn =ConvertStringArrayToIntArray(fns); double testipfn = ((fn[0]*1000000000D)+(fn[1]*1000000D)+(fn[2]*1000D)+fn[3]); while(i) { //i=false;//pour test // db[0].db[1].db[2].db[3] double testipdb = (db[0]*1000000000D)+(db[1]*1000000D)+(db[2]*1000D)+db[3]; if(testipdb>=testipfn){i=false;}
if( db[0] >= 255) { i=false; } if( db[1] >= 255) { db[0]++; db[1]=0; }
if( db[2] >= 255) { db[1]++; db[2]=1; } if(db[3] >= 255) { db[2]++; db[3]=1; }
//définition de l'adresse ip ip=db[0] + "." + db[1] + "." + db[2] + "." + db[3]; label3.Text = ip; label3.Refresh(); //future pause // while(button1.Text != "GO") // { // timer1.Interval = 10; // timer1_Tick( // // } // ---------------------------------------------
// DEBUT DU SCANNNNNN
// prise de contrôle de la console Process p = new Process(); string args; args = ip + " "; args += 0;
p.StartInfo.FileName = file; p.StartInfo.Arguments = args; p.StartInfo.CreateNoWindow = true; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.Start(); //wait que le process ce finish // p.WaitForExit(); string sortie = p.StandardOutput.ReadToEnd(); if (sortie.EndsWith("Bad luck!\r\n")||(sortie.EndsWith("10060"))) { sortie = ""; } else { textBox1.Text = sortie; i = false; } // deuxième vague args = ip + " "; args += 1;
p.StartInfo.FileName = file; p.StartInfo.Arguments = args; p.StartInfo.CreateNoWindow = true; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.Start(); //wait que le process ce finish // p.WaitForExit(); sortie = "\r\n\r\n" + p.StandardOutput.ReadToEnd();
if (sortie.EndsWith("Bad luck!\r\n")||(sortie.EndsWith("10060"))) { sortie = ""; } else { textBox1.Text = sortie; i = false; } // incrémentation de 1 de l'adresse ip //MessageBox.Show(ip); db[3]++; //fin du while } //FIN DE LA GROSSE BOUCLE !!!!! if (textBox1.Text == "") { textBox1.Text = "Bad Luck MAN ! \r\n Try AGAIN \r\n Check out hypnowarez.org \r\n\r\n NO OPEN TARGETS FOR THIS TIME !\r\n"; } button1.Text="GO"; } }
}
|