Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Mar 2004 17:02:56 -0800
From:      Chris Pressey <cpressey@catseye.mine.nu>
To:        hugle <hugle@vkt.lt>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Need bash help
Message-ID:  <20040315170256.7ce277ad.cpressey@catseye.mine.nu>
In-Reply-To: <130471393648.20040316014051@vkt.lt>
References:  <130471393648.20040316014051@vkt.lt>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 16 Mar 2004 01:40:51 +0200
hugle <hugle@vkt.lt> wrote:

> Hello all.
> I'm writing here, cause i think just here people can help me.
> (p.s. didn't find bash mailing lists)
> [...]
> So what I wanna do is smth like:
> 
> for i in `seq 1 254`; do
> ./dc 192.168.1.$i
> and if it returns 'Dropping to system shell' then add these IP to
> vulderable_users done

You could pipe the output of dc to grep and check the exit code. 
Something like:

	if ./dc 192.168.1.$i | grep 'Dropping to system shell'; then
		echo "192.168.1.$i" >> vulnerable_users
	fi

YMMV, I haven't used bash; the above is sh, should work about the same.

-Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040315170256.7ce277ad.cpressey>