[Plugins-writers] problem in executing SSH commands

From: sandy (sandeep0996@private)
Date: Thu Feb 24 2005 - 01:55:22 PST


>Hi ,
>Sorry to bug you but I'm new to NASL and my first
attempt to write a
>useful NASL script failed :(
>
>I've a problem regarding executing SSH commands in
NASl.
>I want to read a file on a remote machine using SSH
from my nasl 
program.
>Here is what i wrote:
>##########################################################
> ssh_login 
(socket:soc,login:"nsroot",password:"nsroot",pub:NULL,priv:NULL,passphrase:NULL);
>
>cmd1=ssh_cmd(socket:soc, cmd:"shell", timeout:5);
>display('\ncmd1:',cmd1);
>
>buf = ssh_cmd(socket:soc, cmd:"cat myfile",
timeout:5);
>display('\nbuf:',buf);
>############################################################
>
>i got the following output :
>cmd1:
>buf: Done
>ERROR: No such command
>-------------------------------------------------------------------------------------
>i know the second command(cat myfile ) is not
reaching the new shell
>which is forked,
>but i've tried a lot ,i still cudn't find out how to
execute commands
>on that newly forked shell.
>Someone please help me. I know its a silly doubt.
>If it cannot be done plz help me on how to read files
from a remote
>machine using SSH in a nasl program.
>Thanks
>
>  

=====
-------------------------------------------
"I'm gonna live forever, or die trying."

*(`'.(`'.*!!~Sandy~!!*.').')*


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
_______________________________________________
Plugins-writers mailing list
Plugins-writers@private
http://mail.nessus.org/mailman/listinfo/plugins-writers



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 05:03:29 PST