From 2fad42746be7825ff10fdf39d3a451352609ffce Mon Sep 17 00:00:00 2001 From: kkalev Date: Wed, 8 Dec 2004 15:10:42 +0000 Subject: [PATCH] * Add a snmp_clearsession which can disconnect a user by using the Cisco AAA Session MIB * Add a configuration directive general_sessionclear_bin --- Changelog | 5 +++++ bin/snmp_clearsession | 22 ++++++++++++++++++++++ conf/admin.conf | 5 +++++ 3 files changed, 32 insertions(+) create mode 100755 bin/snmp_clearsession diff --git a/Changelog b/Changelog index 782a73a..0f4c61c 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,8 @@ +Ver 1.78: +* Add a snmp_clearsession which can disconnect a user by using the Cisco AAA Session MIB +* Add a configuration directive general_sessionclear_bin +* Add a session disconnect button in the 'clear open sessions' page +* Also clear sessions from the sql extra servers in the 'clear open sessions' page Ver 1.75: * A LOT of security related fixes. Now dialupadmin should hopefully be secure enough to be accessed by normal users (not administrators). diff --git a/bin/snmp_clearsession b/bin/snmp_clearsession new file mode 100755 index 0000000..8e22ea1 --- /dev/null +++ b/bin/snmp_clearsession @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +$SNMPGET="/usr/local/bin/snmpget"; +$SNMPSET="/usr/local/bin/snmpset"; +$host=shift; +$comm=shift || 'public'; +$sessionid=shift; +$username=shift; + +die "Could not find snmpwalk binary. Please make sure that the \$SNMPGET variable points to the right location\n" if (! -x $SNMPGET); +die "Could not find snmpset binary. Please make sure that the \$SNMPSET variable points to the right location\n" if (! -x $SNMPSET); +die "Usage: snmp_clearsession \$host \$community \$sessionid \$username\n" if ($username eq ''); + +if ($sessionid ne '' && $username ne ''){ + $walk =`$SNMPGET -v2c -c $comm $host .iso.org.dod.internet.private.enterprises.9.9.150.1.1.3.1.2.$sessionid`; + unless ($walk =~ /^$/){ + if ($walk =~ /$username/){ + print "FOUND: $username\n"; + `$SNMPSET -v2c -c $comm $host .iso.org.dod.internet.private.enterprises.9.9.150.1.1.3.1.5.$sessionid i 1`; + } + } +} diff --git a/conf/admin.conf b/conf/admin.conf index 241a364..f3535df 100644 --- a/conf/admin.conf +++ b/conf/admin.conf @@ -102,6 +102,11 @@ general_finger_type: snmp # general_nas_type: cisco general_snmpfinger_bin: %{general_base_dir}/bin/snmpfinger +# +# Used by the 'Disconnect User' button in the Clear Open Sessions page +# Uses the Cisco AAA Session MIB +# +general_sessionclear_bin: %{general_base_dir}/bin/snmp_clearsession general_radclient_bin: %{general_radiusd_base_dir}/bin/radclient # # this information is used from the server check page -- 2.39.5