Posted By:
Angela_Stempfel
Posted On:
Friday, May 2, 2003 07:29 AM
Hi all i would like to execute a NMAP command from java. So i wrote the following method: public void execute(){ try { Runtime r = Runtime.getRuntime(); String command = new String("nmap -sU -p 161-162 "+this.network+" -oX /home/hippie/blaTEST.txt"); System.out.println("command: "+command); Process p = r.exec(command); System.out.println("executed nmap"); } catch (Exception ex) { System.out.println(ex); } } Now i have the problem that i have to be root user in linux to execute this command. So it doesn't work the way i implemented it Could someone expl
More>>
Hi all
i would like to execute a NMAP command from java. So i wrote the following method:
public void execute(){
try {
Runtime r = Runtime.getRuntime();
String command = new String("nmap -sU -p 161-162 "+this.network+" -oX /home/hippie/blaTEST.txt");
System.out.println("command: "+command);
Process p = r.exec(command);
System.out.println("executed nmap");
}
catch (Exception ex) {
System.out.println(ex);
}
}
Now i have the problem that i have to be root user in linux to execute this command. So it doesn't work the way i implemented it
Could someone explain me how i have to implement it?
I think the same problem could occur in Windows if i'm not Admin, is this right?
Thanks Angela
<<Less