From owner-freebsd-questions@FreeBSD.ORG Mon Mar 15 16:57:35 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C3E416A4CE for ; Mon, 15 Mar 2004 16:57:35 -0800 (PST) Received: from priv-edtnes57.telusplanet.net (outbound01.telus.net [199.185.220.220]) by mx1.FreeBSD.org (Postfix) with ESMTP id 384FC43D1D for ; Mon, 15 Mar 2004 16:57:35 -0800 (PST) (envelope-from cpressey@catseye.mine.nu) Received: from catseye.biscuit.boo ([154.5.85.228]) by priv-edtnes57.telusplanet.netSMTP <20040316005734.CQOH25381.priv-edtnes57.telusplanet.net@catseye.biscuit.boo>; Mon, 15 Mar 2004 17:57:34 -0700 Date: Mon, 15 Mar 2004 17:02:56 -0800 From: Chris Pressey To: hugle Message-Id: <20040315170256.7ce277ad.cpressey@catseye.mine.nu> In-Reply-To: <130471393648.20040316014051@vkt.lt> References: <130471393648.20040316014051@vkt.lt> Organization: Cat's Eye Technologies X-Mailer: Sylpheed version 0.9.9 (GTK+ 1.2.10; i386-portbld-freebsd4.9) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: Need bash help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2004 00:57:35 -0000 On Tue, 16 Mar 2004 01:40:51 +0200 hugle 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