[Plugins-writers] problem with SSH in NASL..

From: Sandeep Garg (asiaintern_11@private)
Date: Thu Feb 24 2005 - 02:21:43 PST


>Hi ,
>Sorry to bug you all 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
>
>  
>

-- 
_______________________________________________
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 - 02:38:18 PST