LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-23-2011, 02:45 PM   #1
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Rep: Reputation: 1
snmpcheck.pl


Hi all,

I am trying to use snmpcheck.pl on my own IP address, but it giving me :
snmpcheck.pl v1.7 - snmp enumerator
Copyright (c) 2005-2008 by Matteo Cantoni (nothink.org)
[*] try to connect to <my IP>...
[-] <My IP>, connection timeout! Use -T flag to increase timeout.
I tried it with other IP, and gave me same result.
Can anyone advise why giving connection timeout?

Thanks in advance
Regards

Last edited by lee_can; 03-23-2011 at 02:51 PM.
 
Old 03-23-2011, 03:22 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,328

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by lee_can View Post
Hi all,
I am trying to use snmpcheck.pl on my own IP address, but it giving me :
snmpcheck.pl v1.7 - snmp enumerator
Copyright (c) 2005-2008 by Matteo Cantoni (nothink.org)
[*] try to connect to <my IP>...
[-] <My IP>, connection timeout! Use -T flag to increase timeout.
I tried it with other IP, and gave me same result.
Can anyone advise why giving connection timeout?
Either you've got SNMP blocked via your firewall/iptables, or you don't have SNMP running.
 
Old 03-24-2011, 02:17 PM   #3
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by TB0ne View Post
Either you've got SNMP blocked via your firewall/iptables, or you don't have SNMP running.
Still i am facing some problems

First, The snmp server was not installed on my system.
So i have installed it.
root@bt:~# service snmpd start
in order to start it.

now in order to check if its running or not, i just type:
root@bt:~# ps aux | grep snmp
root 5548 0.0 0.2 3060 1388 pts/1 T 18:18 0:00 vi /etc/snmp/snmpd.conf
root 5549 0.0 0.2 2944 1332 pts/1 T 18:18 0:00 vi /etc/snmp/snmpd.confl
root 5550 0.0 0.2 3064 1428 pts/1 T 18:18 0:00 vi /etc/snmp/snmpd.conf
root 5576 0.0 0.2 3068 1432 pts/2 T 18:48 0:00 vi /etc/snmp/snmpd.conf
snmp 5785 0.0 0.8 9096 4088 ? S 19:04 0:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1
root 5809 0.0 0.1 2056 520 pts/2 S+ 19:08 0:00 grep snmp
root@bt:~#

I have tried other way (which gave nothing):
root@bt:~# lsof -i :199
root@bt:~#

i tried this too:
root@bt:~# lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
dhclient 4812 root 5u IPv4 16090 UDP *:bootpc
snmpd 5785 snmp 7u IPv4 27485 UDP localhost:snmp
root@bt:~#
it didnt showed me that TCP *:smux (LISTEN)

i also tried :
root@bt:/# snmpwalk -v 1 -c public localhost 1
SNMPv2-MIB::sysDescr.0 = STRING: Linux bt 2.6.35.8 #1 SMP Sun Nov 14 06:32:36 EST 2010 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (56103) 0:09:21.03

but i put root@bt:/# snmpwalk -v 1 -c public <my IP> 1
Timeout: No Response from <IP address>
i dont give anything.

Sorry guys for asking too much, specially no body is paying you to answer us.

thanks is advance
 
Old 03-24-2011, 02:40 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,328

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by lee_can View Post
Still i am facing some problems
First, The snmp server was not installed on my system. So i have installed it.
root@bt:~# service snmpd start in order to start it.

now in order to check if its running or not, i just type:
root@bt:~# ps aux | grep snmp
root 5548 0.0 0.2 3060 1388 pts/1 T 18:18 0:00 vi /etc/snmp/snmpd.conf
root 5549 0.0 0.2 2944 1332 pts/1 T 18:18 0:00 vi /etc/snmp/snmpd.confl
root 5550 0.0 0.2 3064 1428 pts/1 T 18:18 0:00 vi /etc/snmp/snmpd.conf
root 5576 0.0 0.2 3068 1432 pts/2 T 18:48 0:00 vi /etc/snmp/snmpd.conf
snmp 5785 0.0 0.8 9096 4088 ? S 19:04 0:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1
root 5809 0.0 0.1 2056 520 pts/2 S+ 19:08 0:00 grep snmp
root@bt:~#

i tried this too:
root@bt:~# lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
dhclient 4812 root 5u IPv4 16090 UDP *:bootpc
snmpd 5785 snmp 7u IPv4 27485 UDP localhost:snmp
root@bt:~#
it didnt showed me that TCP *:smux (LISTEN)

i also tried :
root@bt:/# snmpwalk -v 1 -c public localhost 1
SNMPv2-MIB::sysDescr.0 = STRING: Linux bt 2.6.35.8 #1 SMP Sun Nov 14 06:32:36 EST 2010 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (56103) 0:09:21.03

but i put root@bt:/# snmpwalk -v 1 -c public <my IP> 1
Timeout: No Response from <IP address>
i dont give anything.

Sorry guys for asking too much, specially no body is paying you to answer us.
thanks is advance
Ok, well first you had to install SNMP, then you have to configure it. Since there appear to be many people/sessions editing the snmpd.conf file, you need to save the changes first, then restart the SNMP daemon. And again, as I said in my first post, you may be blocking it with your firewall/ip tables. Did you check that?
 
Old 03-24-2011, 11:28 PM   #5
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by TB0ne View Post
Ok, well first you had to install SNMP, then you have to configure it. Since there appear to be many people/sessions editing the snmpd.conf file, you need to save the changes first, then restart the SNMP daemon. And again, as I said in my first post, you may be blocking it with your firewall/ip tables. Did you check that?
Appreciate your immediate reply TBOne,
Well after installing, i tried to configure it so many time, but i didnt make anything.

i started looking for
com2sec notConfigUser default public
in order to Replace it with (make sure you replace 192.168.0.0/24 replace with your network IPs) following lines: com2sec local localhost public
com2sec mynetwork 192.168.0.0/24 public
but i couldnt find this it on my snmpd.conf.

I dont know how to check if it is blocked by firewall/ip tables, on the meanwhile i am trying to find something on the net how to check if its blocked by firewall.

Thank you man.
Regards
 
Old 03-25-2011, 10:54 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,328

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by lee_can View Post
Appreciate your immediate reply TBOne,
Well after installing, i tried to configure it so many time, but i didnt make anything.

i started looking for
com2sec notConfigUser default public
in order to Replace it with (make sure you replace 192.168.0.0/24 replace with your network IPs) following lines: com2sec local localhost public
com2sec mynetwork 192.168.0.0/24 public
but i couldnt find this it on my snmpd.conf.
There are many configuration how-tos you can easily find via Google on how to configure SNMP, if you tried to look:
http://www.linuxhomenetworking.com/w...er_Performance

and the man page for snmp.conf: http://linux.die.net/man/5/snmpd.conf
Quote:
I dont know how to check if it is blocked by firewall/ip tables, on the meanwhile i am trying to find something on the net how to check if its blocked by firewall.
You can, as root, type in "iptables -L" (again, easily found with a quick search or by reading the man page), or go into your system configuration utility, and check the firewall there. You don't say what version/distro you're using, so we can't say what to run. However, without having SNMP configured, you won't be able to query it, no matter what you do. Start there. Get it configured and working via snmpwalk on your loopback address first. Once that's done, you can deal with the network issues later.
 
Old 03-25-2011, 12:06 PM   #7
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
I think with the useful information you provided me, i guess i will solve the problem.
in anyway i come back after reading these links to explain if its solved or not.

again thanks man for your help and sorry for being annoying by asking sometime silly questions as still i am newbie in linux system
 
Old 03-27-2011, 09:08 AM   #8
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by TB0ne View Post
There are many configuration how-tos you can easily find via Google on how to configure SNMP, if you tried to look:
http://www.linuxhomenetworking.com/w...er_Performance
and the man page for snmp.conf: http://linux.die.net/man/5/snmpd.conf
Thanks lot TBone, but things that i am still a newbie in linux i face some difficulty while following the steps of the above links:
First i am using Backtrack on a virtual machine.
i found a useful link: http://www.debianhelp.co.uk/snmp.htm, i almost follow all steps to be done starting by:
- downloading and installing Net-SNMP
- Configuring snmpd.conf (my ip is 192.168.8.*, so i include also com2sec localNet 192.168.0.0 /24 public, is it correct?)
- Testing your Configuration
#snmpwalk localhost -c public -v1
SNMPv2-MIB::sysDescr.0 = STRING: Linux sritest 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
etc,,,
-SNMP Client installation
#apt-get install snmp scli tkmib
- Configuration
cannot find snmp.conf in /etc/snmp/snmp.conf so i didnt make any configuration.
i look for this file on my system, and found in /etc/cups/snmp.conf, so i edited to try to configure as per the link but
couldnt success.
Code:
#
# "$Id$"
#
#   Sample SNMP configuration file for CUPS.  See "man cups-smnp.conf" for a
#   complete description of this file.
Address @LOCAL
Community public
# End of "$Id$".
I dont know if i am missing some points.
As per the link, to confirm is the SNMP service is active and working properly, i use scli localhost and work properly.
But if i put for example scli <My IP>, it return 100-scli version 0.3.1 (c) 2001-2007 Juergen Schoenwaelder
500 SNMP communication error (timeout)

Quote:
Originally Posted by TB0ne View Post
You can, as root, type in "iptables -L"
Code:
root@bt:/# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             192.168.8.*        udp spts:snmp:snmp-trap dpts:1024:65535 state ESTABLISHED
ACCEPT     udp  --  anywhere             192.168.8.*        udp spts:1024:65535 dpts:snmp:snmp-trap state NEW,ESTABLISHED

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  192.168.8.*         anywhere            udp spts:1024:65535 dpts:snmp:snmp-trap state NEW,ESTABLISHED
ACCEPT     udp  --  192.168.8.*         anywhere            udp spts:snmp:snmp-trap dpts:1024:65535 state ESTABLISHED
The thing that i am taking a course, and i get stack at this points.
after configuration of the snmpd.conf, i am still facing this problem
root@bt:/# snmpwalk -c public -v1 192.168.8.* 1 (192.168.8.* is my ip on the virtual machine)
Timeout: No Response from 192.168.8.*

but if i snmpwalk -c public -v1 localhost 1, it work very fine.
what i must do in order to if i put my ip address to work fine?
i tried also:
root@bt:/pentest/enumeration/snmpcheck# ./snmpcheck.pl -t 192.168.8.22
snmpcheck.pl v1.7 - snmp enumerator
Copyright (c) 2005-2008 by Matteo Cantoni (nothink.org)
[*] try to connect to 192.168.8.22...
[-] 192.168.8.22, connection timeout! Use -T flag to increase timeout.
but it work very fine on localhost.
Thanks man for your help, i know i am asking silly questions, but i am still learning

Last edited by lee_can; 03-27-2011 at 09:58 AM.
 
Old 03-30-2011, 08:56 AM   #9
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
Hi all,

in order to use the snmpwalk on a router or pc, is it necessary to install the snmpd to the other pc in order to work fine?

Best Regards
 
Old 04-01-2011, 01:50 PM   #10
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
any advise?
 
Old 04-01-2011, 01:56 PM   #11
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,275

Rep: Reputation: 148Reputation: 148
Yes snmpd have to up & run everywhere..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration