Jump to content

INetGet Alernative?


Recommended Posts

Hey all,

Recently I've been working on minimizing false positives in my latest project. The biggest change so far that helped was removing INetGet which helps the compiled script consistently stay around 3 false positives instead of occasionally jumping up to 6-7. Are there any recommend alternatives for INetGet or is just downloading an executable update from the internet that sketchy for AVs?

Here was the code excerpt in question that I've since commented out:

Case "/u", "/update"
                        Case UBound($CmdLine) = 2
                            InetGet("https://fcofix.org/MSEdgeRedirect/releases/latest/download/MSEdgeRedirect.exe", @ScriptDir & "\MSEdgeRedirect_Latest.exe")
                            _ArrayDelete($CmdLine, 1)
                        Case UBound($CmdLine) > 2 And $CmdLine[2] = "dev"
                            InetGet("https://nightly.link/rcmaehl/MSEdgeRedirect/workflows/mser/main/mser.zip", @ScriptDir & "\MSEdgeRedirect_dev.zip")
                            _ArrayDelete($CmdLine, "1-2")
                        Case UBound($CmdLine) > 2 And $CmdLine[2] = "release"
                            InetGet("https://fcofix.org/MSEdgeRedirect/releases/latest/download/MSEdgeRedirect.exe", @ScriptDir & "\MSEdgeRedirect_Latest.exe")
                            _ArrayDelete($CmdLine, "1-2")
                        Case StringLeft($CmdLine[2], 1) = "/"
                            InetGet("https://fcofix.org/MSEdgeRedirect/releases/latest/download/MSEdgeRedirect.exe", @ScriptDir & "\MSEdgeRedirect_Latest.exe")
                            _ArrayDelete($CmdLine, 1)
                        Case Else
                            MsgBox(0, _
                                "Invalid", _
                                'Invalid release type - "' & $CmdLine[2] & "." & @CRLF)
                            Exit 87 ; ERROR_INVALID_PARAMETER


Thanks in advance!

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

Cisco FinesseGithubIRC UDFWindowEx UDF


Link to comment
Share on other sites

You should check out The WinHTTP functions: 



Alternatively, you can also try out using the WinHTTP.WinHTTPRequest.5.1 object: https://learn.microsoft.com/en-us/windows/win32/winhttp/winhttprequest The WinHTTP UDF linked above is basically using this, though through DLLs directly instead of through the object

Something like this though for the object:

; https://learn.microsoft.com/en-us/windows/win32/winhttp/winhttprequest
Local $sURL = "http://ipv4.download.thinkbroadband.com/5MB.zip"

Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")

$oHTTP.Open("GET", $sURL, False)
If (@error) Then
    ConsoleWrite('$oHTTP.Open error: ' & @error & @CRLF)

If (@error) Then
    ConsoleWrite('$oHTTP.Send error: ' & @error & @CRLF)

If ($oHTTP.Status <> 200) Then
    ConsoleWrite('$oHTTP.Status <> 200: ' & $oHTTP.Status & @CRLF)

ConsoleWrite('$oHTTP.ResponseBody ('&stringlen($oHTTP.ResponseBody)&'): ' & StringLeft($oHTTP.ResponseBody, 1000) & @CRLF)
ConsoleWrite('$oHTTP.ResponseText ('&stringlen($oHTTP.ResponseText)&'): ' & StringLeft($oHTTP.ResponseText, 1000) & @CRLF)

FileWrite('test.zip', $oHTTP.ResponseBody)

This should save a 5MB .zip file in your script directory. The .zip file is not meant to be opened: "These files are made of random data, and although listed as zip files, will appear to be corrupt if you try and open them"




We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...