Is it possible to call shellscript or shellcode in a java class ?
My code (in a static method):
Runtime rtime = Runtime.getRuntime();
Process child = rtime.exec("/bin/bash");
BufferedWriter outCommand = new BufferedWriter(new
OutputStreamWriter(child.getOutputStream()));
outCommand.write("streamer -c /dev/video0 -b32 -o test.jpeg");
outCommand.flush();
outCommand.close();
child.destroy();
But I get this error if I try this code on my jsp page (tomcat6):
java.security.AccessControlException: access denied (running java.io.FilePermission / bin / bash)
Any solution to this problem?
EDIT : ls -l / bin / bash shows me the following line:
-rwxr-xr-x 1 root root 875596 2009-09-14 07:09 / bin / bash
thank
Benni source
share