Re: [Plugins-writers] POSIX ... on multiple lines.

From: Renaud Deraison (deraison@private)
Date: Fri Mar 19 2004 - 10:20:24 PST

  • Next message: Crow, Owen: "RE: [Plugins-writers] False positive for 10965: ssh_AllowedAuthen tications.nasl?"

    On Fri, Mar 19, 2004 at 01:15:56PM -0500, Skill2Die4 wrote:
    > I am coding a nasl_script which requests for a webpage and then tries to
    > gain the IP-address information.
    > 
    > The returned page is like ::
    > ================================================
    >  <div align=right><font color=#000000><b><font size=2 face=Arial>IP 
    >                       Address&nbsp;</font></b></font></div>
    >                   </td>
    >                   <td width=78% height=25><font size=2 face=Arial> 
    >                     192.168.2.1
    >                     </font></td>
    > <td width=22% height=25> 
    > 
    > <div align=right><font color=#000000><b><font face=Arial size=2>Subnet 
    >                       Mask&nbsp;</font></b></font></div>
    >                   </td>
    >                   <td width=78% height=25><font size=2 face=Arial> 
    >                     255.255.255.0
    >                     </font></td>
    > ===============================================
    > 
    > As you see , [0-9]+.[0-9]+.[0-9]+.[0-9]+ wont work here as it comes
    > many times on the page ! (there are other ip-addresses too...)
    
    
    all_ips = egrep(pattern:"[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+", string:foo);
    array   = split(all_ips, sep:'\n');
    the_ip = ereg_replace(pattern:" *([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[^0-9].*", string:array[0]);
    
    
    				-- Renaud
    _______________________________________________
    Plugins-writers mailing list
    Plugins-writers@private
    http://mail.nessus.org/mailman/listinfo/plugins-writers
    



    This archive was generated by hypermail 2b30 : Fri Mar 19 2004 - 10:21:50 PST