Tuesday 23 January 2024

Vulnerability : Default or Guessable SNMP community names: public (snmp-read-0001)

#### To configure SNMP Follow below mentioned Command ####


1) Backup original snmpd.conf file

[root@ebstest snmp]# mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak


2) Create a new snmpd.conf file and populate it with a single line.

[root@ebstest snmp]# touch /etc/snmp/snmpd.conf

echo "rocommunity public" > /etc/snmp/snmpd.conf   // Replace Public with any keyword like a strong Password and don't forget. 

[root@ebstest snmp]# echo "rocommunity Fu#Q@n_12-cFk-cd" > /etc/snmp/snmpd.conf


3) Restart the SNMP service.

[root@ebstest snmp]# systemctl restart snmpd.service

Error: No space left on device

[root@ebstest snmp]# systemctl status snmpd.service

● snmpd.service - Simple Network Management Protocol (SNMP) Daemon.

   Loaded: loaded (/usr/lib/systemd/system/snmpd.service; disabled; vendor preset: disabled)

   Active: active (running) since Thu 2024-01-18 11:04:55 PKT; 1s ago

 Main PID: 23311 (snmpd)

   CGroup: /system.slice/snmpd.service

           └─23311 /usr/sbin/snmpd -LS0-6d -f

Jan 18 11:04:55 ebstest.oracle.com systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....

Jan 18 11:04:55 ebstest.oracle.com snmpd[23311]: NET-SNMP version 5.7.2

Jan 18 11:04:55 ebstest.oracle.com systemd[1]: Started Simple Network Management Protocol (SNMP) Daemon..

4) Test with snmpwalk command on local host

snmpwalk –v2c –c public localhost    // Dont forgot to change public string with configured key

[root@ebstest snmp]# snmpget -v2c -c simbadb  192.168.25.165

No comments:

Post a Comment