我有一个外部java应用程序(blackbox),它需要身份验证。我需要在批处理设置中运行此应用程序,但它似乎以某种非标准方式从标准输入读取。也就是说,如果我将程序的调用设置为将 STDIN 重定向到文件 (... ) 或通过管道将数据传输到该文件 (echo mypasword | ...< /code>),它无法识别输入。当我运行它时,它似乎也会拦截 Cntrl+c
和 Cntrl+d
和 Cntrl+z
作为合法的密码字符,所以它一定在做一些奇怪的事情,而不仅仅是从标准输入中读取。
知道这个应用程序可以做什么来读取输入吗?我需要能够以编程方式向其发送信息,但目前我很困惑。
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.
发布评论
评论(1)
最简单的就是看源代码。
如果您没有可用的并且无法提供给您,那么您可以尝试 java 反编译器。只要编写该程序的人没有混淆源代码,您应该能够从反编译的源代码中弄清楚会发生什么。
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.