y se murio
![:xD :xD](https://forum.elhacker.net/Smileys/navidad/xd.gif)
![:xD :xD](https://forum.elhacker.net/Smileys/navidad/xd.gif)
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: MCKSys Argentina en 11 Noviembre 2017, 18:41 PM
Si quieres conseguirlo fácil y sin tener que pedir la licencia, descárgate una iso de kali y listo.
Saludos!
Imports System.Threading
Imports Bitvise.FlowSshNet
Public Enum ExitCodes
Success = 0
UsageError = 1
SessionError = 2
FatalError = 3
End Enum
Public Enum DisconnectReason
Exception = 0
FlowError = 1
ConnectionError = 2
ConnectionLost = 3
ByServer = 4
ByClient = 5
End Enum
Public Class MyClient
Inherits Client
Public Sub New()
AddHandler OnHostKey, AddressOf OnMyHostKey
AddHandler OnForwardingLog, AddressOf OnMyForwardingLog
End Sub
Public Function OnMyHostKey(ByVal sender As Object, ByVal publicKey As PublicKey) As Boolean
Console.WriteLine("Received the following host key: ")
Console.WriteLine(" MD5 Fingerprint: {0}", publicKey.GetMd5())
Console.WriteLine(" Bubble-Babble: {0}", publicKey.GetBubbleBabble())
Console.WriteLine(" SHA-256: {0}", publicKey.GetSha256())
Return True
End Function
Public Sub OnMyForwardingLog(ByVal sender As Object, ByVal log As ForwardingLog)
Console.WriteLine(log.Desc)
End Sub
End Class
Module FlowSshNet_VbTnl
Dim client As MyClient = New MyClient
Dim progress As ProgressHandler
Sub OnUncaughtExceptionInEvent(ByVal sender As Object, ByVal fatal As Boolean, ByVal e As System.Exception)
Console.WriteLine("Error: {0}", e.ToString())
Environment.Exit(ExitCodes.FatalError)
End Sub
Public Sub OnMyDisconnect(ByVal sender As Object, ByVal reason As DisconnectReason, ByVal desc As String)
If reason <> 5 Then 'Exepto cuando sea una desconexión voluntaria, reconecto...
Console.WriteLine("Reconectando...")
Reconectar() 'Espero 10 segundos
End If
End Sub
Sub New()
AddHandler SshNet.OnExceptionInEvent, AddressOf OnUncaughtExceptionInEvent
AddHandler client.OnDisconnect, AddressOf OnMyDisconnect
End Sub
Function Main() As Integer
Try
If IsNothing(client) Then
client = New MyClient
End If
client.SetAppName("FlowSshNet_VbTnl")
client.SetHost("1.1.1.1")
client.SetPort(22)
client.SetUserName("user")
client.SetPassword("pass")
client.SetProxyType(ProxyType.HttpConnect)
client.SetProxyHost("1.1.1.5")
client.SetProxyPort("8080")
client.SetProxyUserName("userproxy")
client.SetProxyPassword("proxypass")
progress = New ProgressHandler
client.Connect(progress)
progress.WaitDone()
If Not progress.Success() Then
Dim connectStep As UInt32 = progress.GetTaskSpecificStep()
Dim auxInfo As String = progress.GetAuxInfo()
Dim connErr As String = ProgressHandler.DescribeConnectError(connectStep, auxInfo)
Console.WriteLine("{0}", connErr)
Reconectar()
Else
Dim proxy As ProxyForwarding = New ProxyForwarding
proxy.ListInterface = "127.0.0.1"
proxy.ListPort = 1080
Dim enableProxyHandler As ForwardingHandler = New ForwardingHandler
client.EnableProxyForwarding(proxy, enableProxyHandler)
enableProxyHandler.WaitDone()
If (enableProxyHandler.Success()) Then
Console.WriteLine("Proxy forwarding enabled, listening port: {0}", enableProxyHandler.GetListPort().ToString())
Else
Console.WriteLine("Error enabling proxy forwarding: {0}", enableProxyHandler.GetError().Desc)
End If
Console.WriteLine("Press Esc to stop forwarding")
While Console.ReadKey(True).Key <> ConsoleKey.Escape
End While
If (enableProxyHandler.Success()) Then
Dim handler As ForwardingHandler = New ForwardingHandler
client.DisableProxyForwarding(handler)
handler.WaitDone()
If (handler.Success()) Then
Console.WriteLine("Proxy forwarding disabled")
Else
Console.WriteLine("Error disabling proxy forwarding: {0}", handler.GetError().Desc)
End If
End If
client.Disconnect(New ProgressHandler)
End If
Catch e As System.Exception
Console.WriteLine(e.Message)
Return ExitCodes.FatalError
Finally
SshNet.Shutdown()
End Try
Return ExitCodes.Success
End Function
Sub Reconectar()
Dim cursT As Integer
Dim cursL As Integer
cursT = Console.CursorTop
cursL = Console.CursorLeft
Const countDownFrom As Integer = 10
Dim cdfW As Integer = countDownFrom.ToString.Length + 1
For x As Integer = countDownFrom To 0 Step -1
Console.SetCursorPosition(cursL, cursT)
Console.Write(x.ToString.PadLeft(cdfW, " "c))
Thread.Sleep(1000) 'for example only
Next
client.Disconnect(New ProgressHandler)
progress = Nothing
client = Nothing
Main()
End Sub
End Module
client.Disconnect(New ProgressHandler)
SshNet.Shutdown()
Imports Bitvise.FlowSshNet
Public Enum ExitCodes
Success = 0
UsageError = 1
SessionError = 2
FatalError = 3
End Enum
Public Enum DisconnectReason
Exception = 0
FlowError = 1
ConnectionError = 2
ConnectionLost = 3
ByServer = 4
ByClient = 5
End Enum
Public Class MyClient
Inherits Client
Dim aTimer As New System.Timers.Timer
Private Sub tick(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs)
aTimer.Stop()
FlowSshNet_VbTnl.Main()
End Sub
Public Sub New()
AddHandler OnHostKey, AddressOf OnMyHostKey
AddHandler OnForwardingLog, AddressOf OnMyForwardingLog
AddHandler OnDisconnect, AddressOf OnMyDisconnect
AddHandler aTimer.Elapsed, AddressOf tick
End Sub
Sub Main()
aTimer.AutoReset = True
aTimer.Interval = 10000 '10 seconds
End Sub
Public Sub OnMyDisconnect(ByVal sender As Object, ByVal reason As DisconnectReason, ByVal desc As String)
aTimer.Start()
End Sub
Public Function OnMyHostKey(ByVal sender As Object, ByVal publicKey As PublicKey) As Boolean
Console.WriteLine("Received the following host key: ")
Console.WriteLine(" MD5 Fingerprint: {0}", publicKey.GetMd5())
Console.WriteLine(" Bubble-Babble: {0}", publicKey.GetBubbleBabble())
Console.WriteLine(" SHA-256: {0}", publicKey.GetSha256())
Return True
End Function
Public Sub OnMyForwardingLog(ByVal sender As Object, ByVal log As ForwardingLog)
Console.WriteLine(log.Desc)
End Sub
End Class
Module FlowSshNet_VbTnl
Sub OnUncaughtExceptionInEvent(ByVal sender As Object, ByVal fatal As Boolean, ByVal e As System.Exception)
Console.WriteLine("Error: {0}", e.ToString())
Environment.Exit(ExitCodes.FatalError)
End Sub
Function Main() As Integer
Try
AddHandler SshNet.OnExceptionInEvent, AddressOf OnUncaughtExceptionInEvent
Dim client As MyClient = New MyClient
client.SetAppName("FlowSshNet_VbTnl")
client.SetHost("1.1.1.1")
client.SetPort(22)
client.SetUserName("user")
client.SetPassword("password")
client.SetProxyType(ProxyType.HttpConnect)
client.SetProxyHost("1.1.1.5")
client.SetProxyPort("8080")
client.SetProxyUserName("userproxy")
client.SetProxyPassword("userpass")
Dim progress As ProgressHandler = New ProgressHandler
client.Connect(progress)
progress.WaitDone()
If Not progress.Success() Then
Dim connectStep As UInt32 = progress.GetTaskSpecificStep()
Dim auxInfo As String = progress.GetAuxInfo()
Dim connErr As String = ProgressHandler.DescribeConnectError(connectStep, auxInfo)
Console.WriteLine("{0}", connErr)
Else
Dim proxy As ProxyForwarding = New ProxyForwarding
proxy.ListInterface = "127.0.0.1"
proxy.ListPort = 1080
Dim enableProxyHandler As ForwardingHandler = New ForwardingHandler
client.EnableProxyForwarding(proxy, enableProxyHandler)
enableProxyHandler.WaitDone()
If (enableProxyHandler.Success()) Then
Console.WriteLine("Proxy forwarding enabled, listening port: {0}", enableProxyHandler.GetListPort().ToString())
Else
Console.WriteLine("Error enabling proxy forwarding: {0}", enableProxyHandler.GetError().Desc)
End If
Console.WriteLine("Press Esc to stop forwarding")
While Console.ReadKey(True).Key <> ConsoleKey.Escape
End While
If (enableProxyHandler.Success()) Then
Dim handler As ForwardingHandler = New ForwardingHandler
client.DisableProxyForwarding(handler)
handler.WaitDone()
If (handler.Success()) Then
Console.WriteLine("Proxy forwarding disabled")
Else
Console.WriteLine("Error disabling proxy forwarding: {0}", handler.GetError().Desc)
End If
End If
client.Disconnect(New ProgressHandler)
Console.WriteLine("Press Esc to exit")
While Console.ReadKey(True).Key <> ConsoleKey.Escape
End While
End If
Catch e As System.Exception
Console.WriteLine(e.Message)
Return ExitCodes.FatalError
Finally
SshNet.Shutdown()
End Try
Return ExitCodes.Success
End Function
End Module