Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2007 10:48:13 -0500
From:      Dave Grochowski <malus.x@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Newbie NMap in FreeBSD Question
Message-ID:  <45ABA23D.2060207@gmail.com>
In-Reply-To: <20070115073443.5539.qmail@web59210.mail.re1.yahoo.com>
References:  <20070115073443.5539.qmail@web59210.mail.re1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hey,

It is pretty straightforward:

--- cut here ---
#!/usr/local/bin/perl

exec("nmap 192.168.1.2");
--- cut here ---

I would just use an sh script for something this simple:

--- cut here ---
#!/bin/sh

nmap 192.168.1.2;
--- cut here ---

If you want to be able to supply optional arguments, we can slightly 
modify the script to allow for it:

--- cut here ---
#!/bin/sh

nmap $@ 192.168.1.2;
--- cut here ---

So you can do a "./mynmap -A -Ss" and it will run "nmap -A -Ss 192.168.1.2".

Hope that helps.

Sincerely,
Dave Grochowski

linux quest wrote:
> Note: forwarded message attached.
>  
> ---------------------------------
> Now that's room service! Choose from over 150,000 hotels 
> in 45,000 destinations on Yahoo! Travel to find your fit.
>
> ------------------------------------------------------------------------
>
> Subject:
> Newbie NMap in FreeBSD Question
> From:
> linux quest <linuxquest7570@yahoo.com>
> Date:
> Sat, 13 Jan 2007 08:53:18 -0800 (PST)
> To:
> FreeBSD-questions@freebsd.org
>
> To:
> FreeBSD-questions@freebsd.org
>
>
>    Lets say, I wanted to create a Perl script to execute a very simple
>    nmap command as listed below, may I know how do I do it?
>    unix# nmap 192.168.1.2
>    I know we need to save it in .pl extension. May I know what else I
>    need to do. I hope someone can share with me the simple coding.
>    Thanks. [01.gif]
>    Regards,
>    Linux Quest
>      _________________________________________________________________
>
>    8:00? 8:25? 8:40? [1]Find a flick in no time
>    with the[2]Yahoo! Search movie showtime shortcut.
>
> References
>
>    1. http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news
>    2. http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45ABA23D.2060207>