How to close JMeter IDE from shell script? - jmeter

I have a shell script deploying the utility jar file and starting the JMeter with the last test plan. Now I would like to close any existing JMeter IDEs before the deployment.
Ideally, the script should invoke the IDE's save menu before closing the GUI.
This will avoid losing any unsaved work.
Note
Killing the JMeter's process may not work in my use case.

I don't understand how this question is connected to JMeter.
It sounds like you're looking for a desktop automation tool like Appium, Taurus, Sikuli, LDTP, etc.
It might be the case that you "shell" script can also send "Save" signal to running JMeter instances and close them, however it depends on the operating system and "shell" type.

Related

Image File Execution Options, legit or malicious use?

I am trying to understand what Image File Executions Options can do and what it's normally used for. I know it is used for debugging purposes but how do I know its used for malicious purposes? Is this registry key used with every executable? If not, is it suspicious?
For example what does \Image File Execution Options\DevOverrideEnable do?
PS: I have looked a these sources already:
https://gooroo.io/GoorooTHINK/Article/17352/Image-File-Execution-Options-Good-Evil-Fun/28441
https://blog.malwarebytes.com/101/2015/12/an-introduction-to-image-file-execution-options/
Normally debuggers can run a process or attach to existing process to debug it and it's enough for normal projects but in some projects like services debugger can't start the service because of Windows service architecture. in this scenario we should attach debugger to running service process but if we want to debug some codes in startup of service we can't do it by this method because debugger attached to process after the startup codes executed.
In scenarios like this we can use Image File Executions Options (IFEO) by configuring to launch debugger when process start, when specified process start Windows launch process inside specified debugger and let developer to debug the process from beginning of born !
The problem of this option is Microsoft Windows do not (and cannot ;) check the specified debugger is really a debugge.
On the other hand malware authors use this option as a trick to start they malicious process when some process run, for example they can run a injector every time "explorer.exe" process run and inject some malicious code to it.
Finally IFEO is not malicious option by it self but maybe! and there is not simple way to know it's malicious or not. if you want to be sure it's malicious or not the debugger should be analyze and check manually for malicious activity.
If you are not computer skilled person the easiest way for you is to find the IFEO registry keys and find debugger's path from theme and upload debugger file to online scanner website like VirusTotal and hope they tell the truth :))

what is GUI and non GUI difference in Jmeter

what are the two types of execution that can be done in jmeter?
This was asked in a interview to me. i was asked what are the ways u execute the script i.e GUI or non -GUI. I am working on jmeter but I have never come across these two words
GUI means "graphical user interface", like you run in microsoft windows.
We can run Jmeter in both GUI or Non-GUI (From command line).
I strongly suggest you do some reading about Jmeter on below website
http://jmeter.apache.org/usermanual/index.html
http://developer.amd.com/community/blog/2009/03/31/using-apache-jmeter-in-non-gui-mode/
hope this will help.
It is absolutely not recommended to use JMeter GUI (graphical user interface) for anything apart from developing or debugging test as AWT Event Thread will kill both your test and JMeter in case of more or less high load.
There is a variety of approaches on how to run a JMeter test in non-GUI mode including:
command-line mode
Apache Ant task
Apache Maven plugin
Jenkins plugin
Execution pre-defined .jmx from Java code or creating a test on-the-fly
Plugins for IDEs like Eclipse or Idea
See 5 Ways To Launch a JMeter Test without Using the JMeter GUI for more details on above.

Run a Windows command in Perl outside of CGI enviroment

I have a specific proprietary application, which is dual use, running "account.exe" in a CGI context (eg from inside a web server) will make account.exe output a HTML page and such. Running "account.exe" outside of CGI context causes account.exe to enable certain command line functions.
Now to the question:
I want to run account.exe outside the CGI context in perl. Have tried with system(1, "command"); have tried with system("start command"), tried with a BAT wrapper that clears (SET VARIABLE=) every enviroment variable that has with CGI to do, but still account.exe "detects" that its run by a web server and outputs its HTML.
How can I run a windows command in a CGI script in perl (using strawberry perl) and making it impossible for the "account.exe" application to detect that the execution originally came from a web server?
There are many ways how account.exe could possibly detect how it was run.
Environment variables is one way; it seems you have already ruled that one out.
Normally processes can see who is their parent and their parent, so that could be other way.
So either you can do a lot of testing until you finally fool the specific technique that the process is using, or you might want to try sandboxing to gain more control on what the process can or cannot see (or do).

Using VMMap in a batch script

I am doing some analysis work on some software we are running where I work. The software seems to have memory issues some where along the line which are proving difficult to track down. We have decided to use Sysinternals VMMap to track the memory being used by the software.
We have VMMap exporting the usage every 20 seconds using Windows scheduler to launch a batch script which pulls back the target process PID and launches VMMap with it. The process runs for a while, output appearing the out directory but after a while it stops. Windows scheduler reports the job ran fine and will start another instance when the trigger is meant, once again with no output.
After a bit of investigation it looks like VMMap is failing to open the process and is trying to report an error through its GUI. Since we are running in batch, we cannot see this error to dismiss it. This is causing numerous process' to be spawned but not actually doing anything.
Has anyone come across this issue when using VMMap, or know of anything that may help? I am thinking there may be some flag I can pass which suppresses messages or maybe some way I can handle it in the batch but Google hasn't helped nor has the Sysinternals forum. Any help would be really appreciated.
VMMap is a GUI tool, so trying to capture its output in an automated way will be difficult. Instead, try using another SysInternals tool, Handle, that captures a lot of the same information, but exports/reports on it in command line, where it can be captured much easier. Alternatively, don't run the output in an auto-repeating way when using VMMap, but instead have your script somehow detect the error or missing expected results/data and stop so the GUI output can be examined.
All Sysinternals tools do pop up a consent dialog for the first time they are started on a new machine to accept their license. I think you did deploy the tool to a production machine and it was trying to show the consent dialog but nobody did press ok.
They do basically create a registry key on the machine which you can fake if you need a fully automated deployement or you can start in once on the target machine for the user in question.

Supporting two shells in windows

I'd like to write my own (very simple) explorer.exe alternative that I could actively switch between without having to restart my computer.
Is it possible to run two shells simultaneosly (or to write a program that temporarily disables the current shell)?
If not, is it possible to stop explorer without it restarting itself, and have my shell start itself instead?
Edit
More info: I'd like to write a simple productivity tool for myself. I want to set up a very simple task manager that prevents me from starting/opening/using anything but a whitelisted set of applications I list ahead of time. Locking me into that set of apps for whatever time period I've set. If there's another (better) way to prevent people from shutting down my app, switching from my app (with alt-tab, etc) I'm all ears.
Note: I'm fine with the app/shell/whatever being escapable by restarting my computer. I just want to make it massively inconvenient to switch to being distracted, and I wanted to learn a bit more about the Windows API.
See this question for details about writing a shell.
No, there can only be one real shell process (SetShellWindowEx only works when there is no other shell process) WH_SHELL can be used by other processes and it might be enough for your needs (Maybe in combination with IShellExecuteHook)
When explorer.exe is started and it detects a different shell it will not display the taskbar, just a file browser window. Explorer also looks at the shell value in the registry IIRC. You might also want to look into the shift to exit trick.

Resources