Search code examples
javabatch-filehttp-redirectioblack-box

Rogue black-box java application not responding to standard input redirect


I have an external java application (blackbox), which requires authentication. I need to run this application in a batch setting, but it seems to be reading from standard input in some nonstandard way. That is, if I set the calling of the program to redirect STDIN to a file (... <password.txt) or pipe data to it (echo mypasword | ...), it does not recognize the input. As I run it, also, it seems to intercept Cntrl+c and Cntrl+d and Cntrl+z as legitimate password characters, so it must be doing something odd and not just reading from standard in.

Any idea what this application could be doing to read in input? I need to be able to send it information programmatically, and I'm stumped for the moment.


Solution

  • Easiest is to take a look at the source code. If you do not have this available and can not be provided to you, then you could try a java decompiler. Provided whoever wrote the program did not obfuscate the source code, you should be able to figure out what happens from the decompiled sources.