LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Cut Help (https://www.linuxquestions.org/questions/programming-9/cut-help-604731/)

chrism01 12-13-2007 06:49 PM

Going to offer the management a 'Glasgow kiss' ilikejam ?
;)
PS I pretty much agree btw...

ilikejam 12-13-2007 06:54 PM

Well, it's either that, or run at them with the old Edinburgh socket set :)

chrism01 12-13-2007 07:25 PM

Now that's a new one on me... :)
Of course you don't always have a 'set' on you ...
wonder what the OP is doing?

metallica1973 12-13-2007 08:24 PM

ilikejam,

can you show me your script?

ilikejam 12-14-2007 03:34 AM

The nmap script I use at work?
Code:

#!/bin/bash

HOST="$1"
LISTDIR="$HOME/hostlists"
LIST="$LISTDIR/$HOST"

if ! [ -f "$LIST" ]
    then
    /usr/local/bin/nmap -P0 -sT -p22 $HOST 2>&1 | egrep 'closed|filtered|Failed to resolve' > /dev/null
    if [ $? == 0 ]
        then
        echo "$HOST - WARNING NO SSH"
    else
        echo "$HOST - OK"
    fi
    exit
fi

for go in `cat $LIST`
  do
    /usr/local/bin/nmap -P0 -sT -p22 $go 2>&1 | egrep 'closed|filtered|Failed to resolve' > /dev/null
    if [ $? == 0 ]
        then
        echo "$go - WARNING NO SSH"
    else
        echo "$go - OK"
    fi
done

I have a set of host lists at $HOME/hostlists (like lists of all the Solaris 10 hosts, all the production hosts, all the Sparc hosts etc). The above script takes a single argument, which can be either the filename of one of those lists, or a single hostname. Just change the '-p22' arg to '-p23' to test telnet.

Dave

metallica1973 12-19-2007 11:43 AM

ok I have nmap can you work with me now?

ilikejam 12-20-2007 02:17 PM

Cool.

If you've got a list of hostnames:
Code:

#!/bin/bash
LIST="$1"
if ! [ -f "$LIST" ]
    then
    exit 1
fi
for go in `cat $LIST`
  do
    /usr/local/bin/nmap -P0 -sT -p23 $go 2>&1 | egrep 'closed|filtered|Failed to resolve' > /dev/null
    if [ $? == 0 ]
        then
        echo "$go - No telnet"
    else
        echo "$go - Telnet on"
    fi
done

Run that with the list of hostnames as the argument, and it'll spit out the telnet status of the hosts.

Dave

metallica1973 12-20-2007 04:36 PM

Wow,

After working with several senior nix admins and even working with nmap, we still recieve false/positives when scanning the Cisco NAM version 1 and 2 when scanning only the telnet port 23. It seems at though they are enabled but are set not to recieve any logins. I have not looked at the devices configuration but when you telnet to them, it says connected and then in disconnect you. This is on several devices. This only happens with the Cisco products. Can anyone tell me what could be the issue and if there is a solution for this problem?


All times are GMT -5. The time now is 06:17 PM.