C# Kayıtlı Wİ-Fİ Şifre Bulucu

Kruvazör

Yazılım Ekibi Lideri
28 Mar 2020
1,722
2,540
Wrong Side Of Heaven
Herkese selamlar ben
Coderx37
Bugün sizlerle Bilgisayarımızda kayıtlı olan ağların şifrelerini gösteren bir program yapacağız.

Windows Form projemizi başlatıp tasarımı yapmaya başlayalım:


2 label
1 button
1 combobox
1 textbox

f33oam6.jpg

Arkada bir CMD işlemi çalıştıracağımız için en başta yazacağımız komutları öğrenmeliyiz.

CMD açıp şu kodu yazıp çıktısını inceleyelim.

netsh wlan show profiles
kn29r24.png

Evet yazdığımız komut sayesinde cihazda kayıtlı olan Wİ-Fİ ağlarının isimlerini öğrendik.
Şimdi de öğrendiğimiz isim ile şifre sorgulayalım.


netsh wlan show profiles "Coderx37" key=clear

opachve.png

Evet çıktılarımız bu şekilde şimdi C# a geri dönüp bu verileri form ekranına taşıyalım


C#:
  private void UpdateProfileList()
  {
      // netsh komutunu çalıştır ve çıktısını oku
      string output = RunNetshCommand("wlan show profiles");

      // Profil isimlerini çıktıdan al ve combobox'a ekle
      string[] profiles = GetProfileNames(output);
      comboBox1.Items.Clear();
      comboBox1.Items.AddRange(profiles);
  }

C#:
 private void Form1_Load(object sender, EventArgs e)
 {
     UpdateProfileList(); //fonksiyonun çalışması için burada fonksiyonu çağırıyoruz.
 }

C#:
 private string RunNetshCommand(string arguments)
 {
     try
     {
         ProcessStartInfo processStartInfo = new ProcessStartInfo
         {
             FileName = "netsh",
             Arguments = arguments,
             RedirectStandardOutput = true,
             UseShellExecute = false,
             CreateNoWindow = true
         };

         using (Process process = new Process { StartInfo = processStartInfo })
         {
             process.Start();
             string output = process.StandardOutput.ReadToEnd();
             process.WaitForExit();
             return output;
         }
     }
     catch (Exception ex)
     {
         return $"Error: {ex.Message}";
     }
 }

 private string[] GetProfileNames(string netshOutput)
 {
     // netsh çıktısından profil isimlerini ayıkla
     string[] lines = netshOutput.Split('\n');
     System.Collections.Generic.List<string> profiles = new System.Collections.Generic.List<string>();

     foreach (string line in lines)
     {
         if (line.Contains("All User Profile"))
         {
             // "All User Profile" içeren satırdan profil adını çıkar
             int startIndex = line.IndexOf(":") + 1;
             string profileName = line.Substring(startIndex).Trim();
             profiles.Add(profileName);
         }
     }

     return profiles.ToArray();
 }


C#:
 private string GetKeyContent(string netshOutput)
 {
     // netsh çıktısından "Key Content" değerini yani şifreyi ayıkla
     string[] lines = netshOutput.Split('\n');

     foreach (string line in lines)
     {
         if (line.Contains("Key Content"))
         {
             // "Key Content" içeren satırdan veriyi al
             int startIndex = line.IndexOf(":") + 1;
             string keyContent = line.Substring(startIndex).Trim();
             return keyContent;
         }
     }

     return "Keyi bulamadık :(";
 }

Ve son olarak button kodlarımızı yazalım.
C#:
  // "Password" butonuna tıklandığında seçilen profille ilgili key'i al ve TextBox'a yazdır
  string selectedProfile = comboBox1.SelectedItem as string;
  if (!string.IsNullOrEmpty(selectedProfile))
  {
      // netsh komutunu çalıştır ve çıktısını oku
      string commandOutput = RunNetshCommand($"wlan show profiles name=\"{selectedProfile}\" key=clear");

      // "Key Content" değerini al
      string keyContent = GetKeyContent(commandOutput);

      // TextBox'a yazdır
      textBox1.Text = keyContent;




Kodun Tamamı


C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PasswordFinder
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            UpdateProfileList();
        }

        private void UpdateProfileList()
        {
            // netsh komutunu çalıştır ve çıktısını oku
            string output = RunNetshCommand("wlan show profiles");

            // Profil isimlerini çıktıdan al ve combobox'a ekle
            string[] profiles = GetProfileNames(output);
            comboBox1.Items.Clear();
            comboBox1.Items.AddRange(profiles);
        }

        private string RunNetshCommand(string arguments)
        {
            try
            {
                ProcessStartInfo processStartInfo = new ProcessStartInfo
                {
                    FileName = "netsh",
                    Arguments = arguments,
                    RedirectStandardOutput = true,
                    UseShellExecute = false,
                    CreateNoWindow = true
                };

                using (Process process = new Process { StartInfo = processStartInfo })
                {
                    process.Start();
                    string output = process.StandardOutput.ReadToEnd();
                    process.WaitForExit();
                    return output;
                }
            }
            catch (Exception ex)
            {
                return $"Error: {ex.Message}";
            }
        }

        private string[] GetProfileNames(string netshOutput)
        {
            // netsh çıktısından profil isimlerini ayıkla
            string[] lines = netshOutput.Split('\n');
            System.Collections.Generic.List<string> profiles = new System.Collections.Generic.List<string>();

            foreach (string line in lines)
            {
                if (line.Contains("All User Profile"))
                {
                    // "All User Profile" içeren satırdan profil adını çıkar
                    int startIndex = line.IndexOf(":") + 1;
                    string profileName = line.Substring(startIndex).Trim();
                    profiles.Add(profileName);
                }
            }

            return profiles.ToArray();
        }

    
        private void button1_Click(object sender, EventArgs e)
        {
            // "Key'i Göster" butonuna tıklandığında seçilen profille ilgili key'i al ve TextBox'a yazdır
            string selectedProfile = comboBox1.SelectedItem as string;
            if (!string.IsNullOrEmpty(selectedProfile))
            {
                // netsh komutunu çalıştır ve çıktısını oku
                string commandOutput = RunNetshCommand($"wlan show profiles name=\"{selectedProfile}\" key=clear");

                // "Key Content" değerini al
                string keyContent = GetKeyContent(commandOutput);

                // TextBox'a yazdır
                textBox1.Text = keyContent;
            }
        }

        private string GetKeyContent(string netshOutput)
        {
            // netsh çıktısından "Key Content" değerini ayıkla
            string[] lines = netshOutput.Split('\n');

            foreach (string line in lines)
            {
                if (line.Contains("Key Content"))
                {
                    // "Key Content" içeren satırdan değeri çıkar
                    int startIndex = line.IndexOf(":") + 1;
                    string keyContent = line.Substring(startIndex).Trim();
                    return keyContent;
                }
            }

            return "Key Content not found.";
        }
Sonuç:
rokbjny.jpg




Okuduğunuz için teşekkürler.
 

Grimner

Adanmış Üye
28 Mar 2020
6,308
4,727
Elinize sağlık kodır hocam, aynı projeyi yıllar önce lise de yapmıştım..
 

drjacob

Uzman üye
21 Ocak 2012
1,773
402
localhost
Herkese selamlar ben
Coderx37
Bugün sizlerle Bilgisayarımızda kayıtlı olan ağların şifrelerini gösteren bir program yapacağız.

Windows Form projemizi başlatıp tasarımı yapmaya başlayalım:


2 label
1 button
1 combobox
1 textbox

f33oam6.jpg

Arkada bir CMD işlemi çalıştıracağımız için en başta yazacağımız komutları öğrenmeliyiz.

CMD açıp şu kodu yazıp çıktısını inceleyelim.

netsh wlan show profiles
kn29r24.png

Evet yazdığımız komut sayesinde cihazda kayıtlı olan Wİ-Fİ ağlarının isimlerini öğrendik.
Şimdi de öğrendiğimiz isim ile şifre sorgulayalım.


netsh wlan show profiles "Coderx37" key=clear

opachve.png

Evet çıktılarımız bu şekilde şimdi C# a geri dönüp bu verileri form ekranına taşıyalım


C#:
  private void UpdateProfileList()
  {
      // netsh komutunu çalıştır ve çıktısını oku
      string output = RunNetshCommand("wlan show profiles");

      // Profil isimlerini çıktıdan al ve combobox'a ekle
      string[] profiles = GetProfileNames(output);
      comboBox1.Items.Clear();
      comboBox1.Items.AddRange(profiles);
  }

C#:
 private void Form1_Load(object sender, EventArgs e)
 {
     UpdateProfileList(); //fonksiyonun çalışması için burada fonksiyonu çağırıyoruz.
 }

C#:
 private string RunNetshCommand(string arguments)
 {
     try
     {
         ProcessStartInfo processStartInfo = new ProcessStartInfo
         {
             FileName = "netsh",
             Arguments = arguments,
             RedirectStandardOutput = true,
             UseShellExecute = false,
             CreateNoWindow = true
         };

         using (Process process = new Process { StartInfo = processStartInfo })
         {
             process.Start();
             string output = process.StandardOutput.ReadToEnd();
             process.WaitForExit();
             return output;
         }
     }
     catch (Exception ex)
     {
         return $"Error: {ex.Message}";
     }
 }

 private string[] GetProfileNames(string netshOutput)
 {
     // netsh çıktısından profil isimlerini ayıkla
     string[] lines = netshOutput.Split('\n');
     System.Collections.Generic.List<string> profiles = new System.Collections.Generic.List<string>();

     foreach (string line in lines)
     {
         if (line.Contains("All User Profile"))
         {
             // "All User Profile" içeren satırdan profil adını çıkar
             int startIndex = line.IndexOf(":") + 1;
             string profileName = line.Substring(startIndex).Trim();
             profiles.Add(profileName);
         }
     }

     return profiles.ToArray();
 }


C#:
 private string GetKeyContent(string netshOutput)
 {
     // netsh çıktısından "Key Content" değerini yani şifreyi ayıkla
     string[] lines = netshOutput.Split('\n');

     foreach (string line in lines)
     {
         if (line.Contains("Key Content"))
         {
             // "Key Content" içeren satırdan veriyi al
             int startIndex = line.IndexOf(":") + 1;
             string keyContent = line.Substring(startIndex).Trim();
             return keyContent;
         }
     }

     return "Keyi bulamadık :(";
 }

Ve son olarak button kodlarımızı yazalım.
C#:
  // "Password" butonuna tıklandığında seçilen profille ilgili key'i al ve TextBox'a yazdır
  string selectedProfile = comboBox1.SelectedItem as string;
  if (!string.IsNullOrEmpty(selectedProfile))
  {
      // netsh komutunu çalıştır ve çıktısını oku
      string commandOutput = RunNetshCommand($"wlan show profiles name=\"{selectedProfile}\" key=clear");

      // "Key Content" değerini al
      string keyContent = GetKeyContent(commandOutput);

      // TextBox'a yazdır
      textBox1.Text = keyContent;




Kodun Tamamı


C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PasswordFinder
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            UpdateProfileList();
        }

        private void UpdateProfileList()
        {
            // netsh komutunu çalıştır ve çıktısını oku
            string output = RunNetshCommand("wlan show profiles");

            // Profil isimlerini çıktıdan al ve combobox'a ekle
            string[] profiles = GetProfileNames(output);
            comboBox1.Items.Clear();
            comboBox1.Items.AddRange(profiles);
        }

        private string RunNetshCommand(string arguments)
        {
            try
            {
                ProcessStartInfo processStartInfo = new ProcessStartInfo
                {
                    FileName = "netsh",
                    Arguments = arguments,
                    RedirectStandardOutput = true,
                    UseShellExecute = false,
                    CreateNoWindow = true
                };

                using (Process process = new Process { StartInfo = processStartInfo })
                {
                    process.Start();
                    string output = process.StandardOutput.ReadToEnd();
                    process.WaitForExit();
                    return output;
                }
            }
            catch (Exception ex)
            {
                return $"Error: {ex.Message}";
            }
        }

        private string[] GetProfileNames(string netshOutput)
        {
            // netsh çıktısından profil isimlerini ayıkla
            string[] lines = netshOutput.Split('\n');
            System.Collections.Generic.List<string> profiles = new System.Collections.Generic.List<string>();

            foreach (string line in lines)
            {
                if (line.Contains("All User Profile"))
                {
                    // "All User Profile" içeren satırdan profil adını çıkar
                    int startIndex = line.IndexOf(":") + 1;
                    string profileName = line.Substring(startIndex).Trim();
                    profiles.Add(profileName);
                }
            }

            return profiles.ToArray();
        }

   
        private void button1_Click(object sender, EventArgs e)
        {
            // "Key'i Göster" butonuna tıklandığında seçilen profille ilgili key'i al ve TextBox'a yazdır
            string selectedProfile = comboBox1.SelectedItem as string;
            if (!string.IsNullOrEmpty(selectedProfile))
            {
                // netsh komutunu çalıştır ve çıktısını oku
                string commandOutput = RunNetshCommand($"wlan show profiles name=\"{selectedProfile}\" key=clear");

                // "Key Content" değerini al
                string keyContent = GetKeyContent(commandOutput);

                // TextBox'a yazdır
                textBox1.Text = keyContent;
            }
        }

        private string GetKeyContent(string netshOutput)
        {
            // netsh çıktısından "Key Content" değerini ayıkla
            string[] lines = netshOutput.Split('\n');

            foreach (string line in lines)
            {
                if (line.Contains("Key Content"))
                {
                    // "Key Content" içeren satırdan değeri çıkar
                    int startIndex = line.IndexOf(":") + 1;
                    string keyContent = line.Substring(startIndex).Trim();
                    return keyContent;
                }
            }

            return "Key Content not found.";
        }
Sonuç:
rokbjny.jpg




Okuduğunuz için teşekkürler.
elinize sağlık
 

kst132

Junior Hunter
12 Haz 2023
919
536
Herkese selamlar ben
Coderx37
Bugün sizlerle Bilgisayarımızda kayıtlı olan ağların şifrelerini gösteren bir program yapacağız.

Windows Form projemizi başlatıp tasarımı yapmaya başlayalım:


2 label
1 button
1 combobox
1 textbox

f33oam6.jpg

Arkada bir CMD işlemi çalıştıracağımız için en başta yazacağımız komutları öğrenmeliyiz.

CMD açıp şu kodu yazıp çıktısını inceleyelim.

netsh wlan show profiles
kn29r24.png

Evet yazdığımız komut sayesinde cihazda kayıtlı olan Wİ-Fİ ağlarının isimlerini öğrendik.
Şimdi de öğrendiğimiz isim ile şifre sorgulayalım.


netsh wlan show profiles "Coderx37" key=clear

opachve.png

Evet çıktılarımız bu şekilde şimdi C# a geri dönüp bu verileri form ekranına taşıyalım


C#:
  private void UpdateProfileList()
  {
      // netsh komutunu çalıştır ve çıktısını oku
      string output = RunNetshCommand("wlan show profiles");

      // Profil isimlerini çıktıdan al ve combobox'a ekle
      string[] profiles = GetProfileNames(output);
      comboBox1.Items.Clear();
      comboBox1.Items.AddRange(profiles);
  }

C#:
 private void Form1_Load(object sender, EventArgs e)
 {
     UpdateProfileList(); //fonksiyonun çalışması için burada fonksiyonu çağırıyoruz.
 }

C#:
 private string RunNetshCommand(string arguments)
 {
     try
     {
         ProcessStartInfo processStartInfo = new ProcessStartInfo
         {
             FileName = "netsh",
             Arguments = arguments,
             RedirectStandardOutput = true,
             UseShellExecute = false,
             CreateNoWindow = true
         };

         using (Process process = new Process { StartInfo = processStartInfo })
         {
             process.Start();
             string output = process.StandardOutput.ReadToEnd();
             process.WaitForExit();
             return output;
         }
     }
     catch (Exception ex)
     {
         return $"Error: {ex.Message}";
     }
 }

 private string[] GetProfileNames(string netshOutput)
 {
     // netsh çıktısından profil isimlerini ayıkla
     string[] lines = netshOutput.Split('\n');
     System.Collections.Generic.List<string> profiles = new System.Collections.Generic.List<string>();

     foreach (string line in lines)
     {
         if (line.Contains("All User Profile"))
         {
             // "All User Profile" içeren satırdan profil adını çıkar
             int startIndex = line.IndexOf(":") + 1;
             string profileName = line.Substring(startIndex).Trim();
             profiles.Add(profileName);
         }
     }

     return profiles.ToArray();
 }


C#:
 private string GetKeyContent(string netshOutput)
 {
     // netsh çıktısından "Key Content" değerini yani şifreyi ayıkla
     string[] lines = netshOutput.Split('\n');

     foreach (string line in lines)
     {
         if (line.Contains("Key Content"))
         {
             // "Key Content" içeren satırdan veriyi al
             int startIndex = line.IndexOf(":") + 1;
             string keyContent = line.Substring(startIndex).Trim();
             return keyContent;
         }
     }

     return "Keyi bulamadık :(";
 }

Ve son olarak button kodlarımızı yazalım.
C#:
  // "Password" butonuna tıklandığında seçilen profille ilgili key'i al ve TextBox'a yazdır
  string selectedProfile = comboBox1.SelectedItem as string;
  if (!string.IsNullOrEmpty(selectedProfile))
  {
      // netsh komutunu çalıştır ve çıktısını oku
      string commandOutput = RunNetshCommand($"wlan show profiles name=\"{selectedProfile}\" key=clear");

      // "Key Content" değerini al
      string keyContent = GetKeyContent(commandOutput);

      // TextBox'a yazdır
      textBox1.Text = keyContent;




Kodun Tamamı


C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PasswordFinder
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            UpdateProfileList();
        }

        private void UpdateProfileList()
        {
            // netsh komutunu çalıştır ve çıktısını oku
            string output = RunNetshCommand("wlan show profiles");

            // Profil isimlerini çıktıdan al ve combobox'a ekle
            string[] profiles = GetProfileNames(output);
            comboBox1.Items.Clear();
            comboBox1.Items.AddRange(profiles);
        }

        private string RunNetshCommand(string arguments)
        {
            try
            {
                ProcessStartInfo processStartInfo = new ProcessStartInfo
                {
                    FileName = "netsh",
                    Arguments = arguments,
                    RedirectStandardOutput = true,
                    UseShellExecute = false,
                    CreateNoWindow = true
                };

                using (Process process = new Process { StartInfo = processStartInfo })
                {
                    process.Start();
                    string output = process.StandardOutput.ReadToEnd();
                    process.WaitForExit();
                    return output;
                }
            }
            catch (Exception ex)
            {
                return $"Error: {ex.Message}";
            }
        }

        private string[] GetProfileNames(string netshOutput)
        {
            // netsh çıktısından profil isimlerini ayıkla
            string[] lines = netshOutput.Split('\n');
            System.Collections.Generic.List<string> profiles = new System.Collections.Generic.List<string>();

            foreach (string line in lines)
            {
                if (line.Contains("All User Profile"))
                {
                    // "All User Profile" içeren satırdan profil adını çıkar
                    int startIndex = line.IndexOf(":") + 1;
                    string profileName = line.Substring(startIndex).Trim();
                    profiles.Add(profileName);
                }
            }

            return profiles.ToArray();
        }

   
        private void button1_Click(object sender, EventArgs e)
        {
            // "Key'i Göster" butonuna tıklandığında seçilen profille ilgili key'i al ve TextBox'a yazdır
            string selectedProfile = comboBox1.SelectedItem as string;
            if (!string.IsNullOrEmpty(selectedProfile))
            {
                // netsh komutunu çalıştır ve çıktısını oku
                string commandOutput = RunNetshCommand($"wlan show profiles name=\"{selectedProfile}\" key=clear");

                // "Key Content" değerini al
                string keyContent = GetKeyContent(commandOutput);

                // TextBox'a yazdır
                textBox1.Text = keyContent;
            }
        }

        private string GetKeyContent(string netshOutput)
        {
            // netsh çıktısından "Key Content" değerini ayıkla
            string[] lines = netshOutput.Split('\n');

            foreach (string line in lines)
            {
                if (line.Contains("Key Content"))
                {
                    // "Key Content" içeren satırdan değeri çıkar
                    int startIndex = line.IndexOf(":") + 1;
                    string keyContent = line.Substring(startIndex).Trim();
                    return keyContent;
                }
            }

            return "Key Content not found.";
        }
Sonuç:
rokbjny.jpg




Okuduğunuz için teşekkürler.
Ellerinize sağlık hocam
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.