Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 243 Vote(s) - 3.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing proxy launcher in VBScript/JScript for console application

#1
I want to alter some arguments passed to application by wrapping it into inspectable script.

CMD.exe is out of list because it damages original arguments list (`=`, `,` & `;` are treated as command separator, rendering `--opt=val` into `--opt` + `val`).

I though about JScript but was frustrated by the fact that both `Wscript.Shell` with `Run` + `Exec` & `Shell.Application` with `ShellExecute` **create new window instead of attaching to existing console**.

It is vital for wrapper to pass STDIO control to launched app. Regular Batch files follow such semantic, CLI pipe to the app continue to work even if the app is called through `.cmd` wrapper.
Reply

#2
Are you looking for something like this?

***launchApplication.vbs***

Dim args : args = ""
For Each arg In WScript.Arguments
If ("" = args) Then
args = arg
Else
args = args & " " & arg
End If
Next

WScript.StdOut.WriteLine "You are using these args: " & args

Dim o, e
With WScript.CreateObject("WScript.Shell")
With .Exec(.ExpandEnvironmentStrings("%COMSPEC% /c application.exe " & args))
o = .StdOut.ReadAll()
e = .StdErr.ReadAll()
End With
End With

WScript.StdOut.WriteLine "StdOut: " & o
WScript.StdOut.WriteLine "StdErr: " & e

Then invoke it using `cscript.exe`. For example:

cscript.exe launchApplication.vbs --opt=val

Assuming your console `application.exe` actually accepts `--opt=val`, then the above script should be capable of capturing the command-line args used to call application.exe, as well as the stdout and stderr from application.exe.

If needed, it can also be modified to alter the command-line arguments, prior to executing application.exe.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through