Suspicious VB Code. What Does this VB Code Do?

E

Eric Noland

I recently saw this VB code in a module I was given, and it looks suspicious
to me. Can anybody tell me what is does?

Private Sub TestFTPUpload()
On Error GoTo errHandler
Dim objFTP As InetTransferLib.FTP
Const conTarget = "ftp://ftp.someserver.com"

Set objFTP = New InetTransferLib.FTP
With objFTP
.FtpURL = conTarget
.SourceFile = vbNullString
.DestinationFile = "/2/test.txt"
.AutoCreateRemoteDir = True
If Not .IsConnected Then .DialDefaultNumber
.ConnectToFTPHost "username", "password"
.UploadFileToFTPServer
End With
ExitHere:
On Error Resume Next
Set objFTP = Nothing
Call SysCmd(acSysCmdRemoveMeter)
Exit Sub
errHandler:
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly,
Err.Source
Resume ExitHere
End Sub

Private Sub TestFTP()
On Error GoTo errHandler
Dim objFTP As InetTransferLib.FTP
Const conTarget = "ftp://ftp.microsoft.com/softlib/softlib.exe"

Set objFTP = New InetTransferLib.FTP
With objFTP
.UseProxy = True
.FtpURL = conTarget
.DestinationFile = "h:\temp\test.exe"
'If .FileExists Then .OverwriteTarget = True
.PromptWithCommonDialog = True
If Not .IsConnected Then .DialDefaultNumber
.ConnectToFTPHost
.WriteFTPDataToFile
End With
ExitHere:
On Error Resume Next
Set objFTP = Nothing
Call SysCmd(acSysCmdRemoveMeter)
Exit Sub
errHandler:
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly,
Err.Source
Resume ExitHere
End Sub

Private Sub TestHTTP()
On Error GoTo errHandler
Dim objHTTP As HTTP
Const conTarget = "http://google.com"

'Application.FollowHyperlink

Set objHTTP = New HTTP
With objHTTP
'.About
.HttpURL = conTarget
'.DestinationFile = "j:\temp\test.htm"
.PromptWithCommonDialog = True
If .FileExists Then .OverwriteTarget = True
If Not .IsConnected Then .DialDefaultNumber
.ConnectToHTTPHost
.WriteHTTPDataToFile
End With
ExitHere:
On Error Resume Next
Set objHTTP = Nothing
Call SysCmd(acSysCmdRemoveMeter)
Exit Sub
errHandler:
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly,
Err.Source
Resume ExitHere
End Sub
 
B

Brian

Peter R. Fletcher said:
It appears to test some FTP and HTTP file transfer functionality in a
(probably third-party) library called InetTransferLib. It does not
appear to read or write anything sensitive on the host system, but it
would, of course, be possible for the library code to be doing things
other than what one would expect!

Appears to be this library:

http://www.mvps.org/access/modules/mdl0037.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top