прокол ssh брутфорсом Abills версии 0.51

Ответить
yariks7
Сообщения: 10
Зарегистрирован: Вт мар 30, 2010 12:41 pm

прокол ssh брутфорсом Abills версии 0.51

Сообщение yariks7 »

Abills живет на Linux Debian 5.0.1 +FreeRADIUS 2.0.4+Mysql 5.0.51a+ perl 5.10.0+apache 2.2.9

Пользователя root нет ни на Микротике( Router_1), ни в системе Abills !

после обновления Abills c 051b до стабильной версии 0.51 в файле radius.log
обнаружил следующие строки
========================
Tue Jun 15 15:30:15 2010 : Auth: Login OK: [root/apache] (from client Router_1 port 0 cli 213.92.95.38)
Tue Jun 15 15:30:16 2010 : Error: Discarding duplicate request from client Router_1 port 48628 - ID: 102 due to unfinished requ
Tue Jun 15 15:30:16 2010 : Auth: Login OK: [root/apache] (from client Router_1 port 0 cli 213.92.95.38)
Tue Jun 15 15:30:23 2010 : Error: Discarding duplicate request from client Router_1 port 55767 - ID: 104 due to unfinished requ
Tue Jun 15 15:30:23 2010 : Auth: Login OK: [root/test123] (from client Router_1 port 0 cli 213.92.95.38)
Tue Jun 15 15:30:24 2010 : Error: Discarding duplicate request from client Router_1 port 43434 - ID: 105 due to unfinished requ
Tue Jun 15 15:30:24 2010 : Auth: Login OK: [root/test123] (from client Router_1 port 0 cli 213.92.95.38)
Tue Jun 15 15:30:30 2010 : Error: Discarding duplicate request from client Router_1 port 55610 - ID: 107 due to unfinished requ
Tue Jun 15 15:30:30 2010 : Auth: Login OK: [root/linux] (from client Router_1 port 0 cli 213.92.95.38)
Tue Jun 15 15:30:31 2010 : Error: Discarding duplicate request from client Router_1 port 53533 - ID: 108 due to unfinished requ
Tue Jun 15 15:30:31 2010 : Auth: Login OK: [root/linux] (from client Router_1 port 0 cli 213.92.95.38)
Tue Jun 15 15:30:33 2010 : Error: Discarding duplicate request from client Router_1 port 53494 - ID: 110 due to unfinished requ
Tue Jun 15 15:30:33 2010 : Auth: Login OK: [root/] (from client Router_1 port 0 cli 86.196.188.74)
Tue Jun 15 15:30:34 2010 : Auth: Login OK: [root/] (from client Router_1 port 0 cli 86.196.188.74)
Tue Jun 15 15:31:17 2010 : Error: Discarding duplicate request from client Router_1 port 36518 - ID: 114 due to unfinished requ
Tue Jun 15 15:31:17 2010 : Auth: Login OK: [root/] (from client Router_1 port 0 cli 77.209.157.145)
Tue Jun 15 15:31:18 2010 : Error: Discarding duplicate request from client Router_1 port 37183 - ID: 115 due to unfinished requ
Tue Jun 15 15:31:18 2010 : Auth: Login OK: [root/] (from client Router_1 port 0 cli 77.209.157.145)
-------------------------------------------
вот сам freeradius -X
=====================
FreeRADIUS Version 2.0.4, for host i486-pc-linux-gnu, built on Sep 7 2008 at 23:35:34
Copyright (C) 1999-2008 The FreeRADIUS server project and contributors.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License.
Starting - reading configuration files ...
including configuration file /etc/freeradius/radiusd.conf
including configuration file /etc/freeradius/clients.conf
including configuration file /etc/freeradius/snmp.conf
including configuration file /etc/freeradius/sql.conf
including configuration file /etc/freeradius/sql/mysql/counter.conf
including configuration file /etc/freeradius/sqlippool.conf
including configuration file /etc/freeradius/sql/mysql/ippool.conf
including configuration file /etc/freeradius/policy.conf
including files in directory /etc/freeradius/sites-enabled/
including configuration file /etc/freeradius/sites-enabled/default
including dictionary file /etc/freeradius/dictionary
main {
prefix = "/usr"
localstatedir = "/var"
logdir = "/var/log/freeradius"
libdir = "/usr/lib/freeradius"
radacctdir = "/var/log/freeradius/radacct"
hostname_lookups = no
max_request_time = 30
cleanup_delay = 5
max_requests = 1024
allow_core_dumps = no
pidfile = "/var/run/freeradius/freeradius.pid"
user = "freerad"
group = "freerad"
checkrad = "/usr/sbin/checkrad"
debug_level = 0
proxy_requests = no
security {
max_attributes = 200
reject_delay = 5
status_server = yes
}
}
client localhost {
ipaddr = 127.0.0.1
require_message_authenticator = no
secret = "Ocean_Password"
shortname = "localhost"
nastype = "other"
}
radiusd: #### Loading Realms and Home Servers ####
radiusd: #### Instantiating modules ####
instantiate {
}
radiusd: #### Loading Virtual Servers ####
server {
modules {
Module: Checking authenticate {...} for more modules to load
Module: Linked to module rlm_mschap
Module: Instantiating mschap
mschap {
use_mppe = yes
require_encryption = yes
require_strong = yes
with_ntdomain_hack = no
}
Module: Checking authorize {...} for more modules to load
Module: Linked to module rlm_preprocess
Module: Instantiating preprocess
preprocess {
huntgroups = "/etc/freeradius/huntgroups"
hints = "/etc/freeradius/hints"
with_ascend_hack = no
ascend_channels_per_line = 23
with_ntdomain_hack = no
with_specialix_jetstream_hack = no
with_cisco_vsa_hack = no
with_alvarion_vsa_hack = no
}
Module: Linked to module rlm_exec
Module: Instantiating abills_preauth
exec abills_preauth {
wait = yes
program = "/usr/abills/libexec/rauth.pl pre_auth"
input_pairs = "request"
output_pairs = "config"
shell_escape = yes
}
Module: Linked to module rlm_files
Module: Instantiating files
files {
usersfile = "/etc/freeradius/users"
acctusersfile = "/etc/freeradius/acct_users"
preproxy_usersfile = "/etc/freeradius/preproxy_users"
compat = "no"
}
Module: Instantiating abills_auth
exec abills_auth {
wait = yes
program = "/usr/abills/libexec/rauth.pl"
input_pairs = "request"
output_pairs = "reply"
shell_escape = yes
}
Module: Checking preacct {...} for more modules to load
Module: Instantiating abills_acc
exec abills_acc {
wait = yes
program = "/usr/abills/libexec/racct.pl"
input_pairs = "request"
output_pairs = "reply"
shell_escape = yes
}
Module: Checking accounting {...} for more modules to load
Module: Linked to module rlm_detail
Module: Instantiating detail
detail {
detailfile = "/var/log/freeradius/radacct/%{Client-IP-Address}/detail-%Y%m%d"
header = "%t"
detailperm = 384
dirperm = 493
locking = no
log_packet_header = no
}
Module: Linked to module rlm_radutmp
Module: Instantiating radutmp
radutmp {
filename = "/var/log/freeradius/radutmp"
username = "%{User-Name}"
case_sensitive = yes
check_with_nas = yes
perm = 384
callerid = yes
}
Module: Linked to module rlm_sql
Module: Instantiating sql
sql {
driver = "rlm_sql_mysql"
server = "localhost"
port = ""
login = "radiuso"
password = "Mazillo621"
radius_db = "radius"
read_groups = yes
sqltrace = yes
sqltracefile = "/var/log/freeradius/sqltrace.sql"
readclients = yes
deletestalesessions = yes
num_sql_socks = 5
sql_user_name = ""
default_user_profile = ""
nas_query = "SELECT id,nasname,shortname,type,secret FROM nas"
authorize_check_query = ""
authorize_reply_query = ""
authorize_group_check_query = ""
authorize_group_reply_query = ""
accounting_onoff_query = ""
accounting_update_query = ""
accounting_update_query_alt = ""
accounting_start_query = ""
accounting_start_query_alt = ""
accounting_stop_query = ""
accounting_stop_query_alt = ""
connect_failure_retry_delay = 60
simul_count_query = ""
simul_verify_query = ""
postauth_query = ""
safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
}
rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
rlm_sql (sql): Attempting to connect to rad1us_jaro@localhost:/radius
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
rlm_sql_mysql: Starting connect to MySQL server for #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql (sql): starting 1
rlm_sql (sql): Attempting to connect rlm_sql_mysql #1
rlm_sql_mysql: Starting connect to MySQL server for #1
rlm_sql (sql): Connected new DB handle, #1
rlm_sql (sql): starting 2
rlm_sql (sql): Attempting to connect rlm_sql_mysql #2
rlm_sql_mysql: Starting connect to MySQL server for #2
rlm_sql (sql): Connected new DB handle, #2
rlm_sql (sql): starting 3
rlm_sql (sql): Attempting to connect rlm_sql_mysql #3
rlm_sql_mysql: Starting connect to MySQL server for #3
rlm_sql (sql): Connected new DB handle, #3
rlm_sql (sql): starting 4
rlm_sql (sql): Attempting to connect rlm_sql_mysql #4
rlm_sql_mysql: Starting connect to MySQL server for #4
rlm_sql (sql): Connected new DB handle, #4
rlm_sql (sql): Processing generate_sql_clients
rlm_sql (sql) in generate_sql_clients: query is SELECT id,nasname,shortname,type,secret FROM nas
rlm_sql (sql): Reserving sql socket id: 4
rlm_sql_mysql: query: SELECT id,nasname,shortname,type,secret FROM nas
[skip]
rlm_sql (sql): Released sql socket id: 4
Module: Linked to module rlm_attr_filter
Module: Instantiating attr_filter.accounting_response
attr_filter attr_filter.accounting_response {
attrsfile = "/etc/freeradius/attrs.accounting_response"
key = "%{User-Name}"
}
Module: Checking session {...} for more modules to load
Module: Checking post-auth {...} for more modules to load
Module: Instantiating reply_log
detail reply_log {
detailfile = "/var/log/freeradius/radacct/%{Client-IP-Address}/reply-detail-%Y%m%d"
header = "%t"
detailperm = 384
dirperm = 493
locking = no
log_packet_header = no
}
Module: Instantiating abills_postauth
exec abills_postauth {
wait = yes
program = "/usr/abills/libexec/rauth.pl post_auth"
input_pairs = "request"
output_pairs = "config"
shell_escape = yes
}
}
}
radiusd: #### Opening IP addresses and Ports ####
listen {
type = "auth"
ipaddr = *
port = 0
}
listen {
type = "acct"
ipaddr = *
port = 0
}
main {
snmp = no
smux_password = ""
snmp_write_access = no
}
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Ready to process requests.
----------------

sopov
Сообщения: 610
Зарегистрирован: Вс апр 02, 2006 7:13 pm

Re: прокол ssh брутфорсом Abills версии 0.51

Сообщение sopov »

У вас просто радиус не правильно настроен...

yariks7
Сообщения: 10
Зарегистрирован: Вт мар 30, 2010 12:41 pm

Re: прокол ssh брутфорсом Abills версии 0.51

Сообщение yariks7 »

sopov писал(а):У вас просто радиус не правильно настроен...
точно! :D Чемь обоснуешь ?
До этого 3 месяца работал нормально.

Да и сейчас при проверке конекта не пускает с левыми паролями
Auth: Invalid user: [root/apache] (from client Router_1 port 0 cli

sopov
Сообщения: 610
Зарегистрирован: Вс апр 02, 2006 7:13 pm

Re: прокол ssh брутфорсом Abills версии 0.51

Сообщение sopov »

Какой-то глупый топик. Что вы хотите показать? О каком проколе вобще речь? Какое отношение имеет ssh к биллингу?

gekz
Сообщения: 169
Зарегистрирован: Пн май 17, 2010 7:30 am

Re: прокол ssh брутфорсом Abills версии 0.51

Сообщение gekz »

смените пароль на рута
проверьте кто кроме вас ещё на серваке командой who

поставьте брутеблок чтобы лочил обезьянок
у меня каждый день живёт около десятка днём и около 20 ночью
и чё людям не спится )))

это текущее заполнение 100-й таблицы айпишниками дебилоидов
таблице никуда низзя :D

Код: Выделить всё

server# ipfw table 100 list
61.49.18.189/32 1276838397
68.101.37.77/32 1276838712
83.218.216.254/32 1276838683
89.120.242.95/32 1276839654
91.149.187.135/32 1276839578
116.55.226.131/32 1276838937
174.142.116.10/32 1276839125
194.149.27.238/32 1276838958
200.178.187.18/32 1276839796
201.227.239.11/32 1276839311
203.64.18.7/32 1276838528
211.100.49.195/32 1276839062
213.97.79.60/32 1276839368
219.151.4.74/32 1276838651
220.225.80.135/32 1276839715
221.11.1.82/32 1276839309

yariks7
Сообщения: 10
Зарегистрирован: Вт мар 30, 2010 12:41 pm

Re: прокол ssh брутфорсом Abills версии 0.51

Сообщение yariks7 »

sopov писал(а):Какой-то глупый топик. Что вы хотите показать? О каком проколе вобще речь? Какое отношение имеет ssh к биллингу?
Ок, для тех кто в танке. Есть рутеры, свитчи с авторизацией и биллингом через abills.
Авторизация пользователей по связке ip+mac адрес+порт свитча. все работает как часики.
Кроме того - есть возможность входа на роутер/свитч через ssh.
В сети есть обезьянки , которые пытаются подобрать пароли брутфорсом. По нескольку раз в минуту...
Во время такого перебора связка Linux Debian 5.0.1 +FreeRADIUS 2.0.4+Mysql 5.0.51a+ perl 5.10.0+apache 2.2.9 и дала сбой.
выдала Auth: Login OK: на несуществующего пользователя.
Было всего один раз - но это не значит, что такая ситуация не повторится еще раз где-нибудь.
Хотел предупредить всех, кто использует подобную связку.
gekz писал(а): смените пароль на рута... поставьте брутеблок чтобы лочил обезьянок
нету на роутере пользователя root совсем - я о чем и пытаюсь втолковать
и стоит брутлок вида
iptables -A INPUT -p tcp -m tcp --dport 2222 -m state --state NEW -m recent --set --name SSH -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 2222 -m recent --update --seconds 60 --hitcount 4 --rttl --name SSH -j LOG --log-prefix "SSH_brute_force "
iptables -A INPUT -p tcp -m tcp --dport 2222 -m recent --update --seconds 60 --hitcount 4 --rttl --name SSH -j DROP

sopov
Сообщения: 610
Зарегистрирован: Вс апр 02, 2006 7:13 pm

Re: прокол ssh брутфорсом Abills версии 0.51

Сообщение sopov »

Ок, для кулхацкеров вне танка... Вы в своем уме? Какое, мля, отношение имеют ваши свичи и роутеры к вашему радиусу7 У вас автризация по ssh тоже через радиус происходит? Или всетаки через passwd с хешированием и задержкой по времени. И даже если вы клептоман - читайте мануалы, а не копипастите все подряд с opennet.ru. И не пишите бредятину... Тут всетаки сетевые инженеры есть....
P.S. Даже если не можете пользоваться фаером, погуглите про влан управления.

yariks7
Сообщения: 10
Зарегистрирован: Вт мар 30, 2010 12:41 pm

Re: прокол ssh брутфорсом Abills версии 0.51

Сообщение yariks7 »

sopov писал(а): Какое, мля, отношение имеют ваши свичи и роутеры к вашему радиусу7 У вас автризация по ssh тоже через радиус происходит?
Самое прямое.Авторизация по ssh в том числе. Нада внимательно читать -я ж в первом сообщение кусок radius.log вставил.
Закрыть полностью нельзя, для админов аутсорсовых и дежурных оставлена возможность входа извне.

А брутлок с iptables - для примера,на микротиках вот такой стоит.
===========
/ip firewall filter
add action=drop chain=input comment="drop ssh brute forcers" disabled=no dst-port=2222 protocol=tcp src-address-list=ssh_blacklist
add action=add-src-to-address-list address-list=ssh_blacklist address-list-timeout=1w3d chain=input comment="" connection-state=new disabled=no dst-port=2222 protocol=tcp src-address-list=ssh_stage3
add action=add-src-to-address-list address-list=ssh_stage3 address-list-timeout=1m chain=input comment="" connection-state=new disabled=no dst-port=2222 protocol=tcp src-address-list=ssh_stage2
add action=add-src-to-address-list address-list=ssh_stage2 address-list-timeout=1m chain=input comment="" connection-state=new disabled=no dst-port=2222 protocol=tcp src-address-list=ssh_stage1
add action=add-src-to-address-list address-list=ssh_stage1 address-list-timeout=1m chain=input comment="" connection-state=new disabled=no dst-port=2222 protocol=tcp
===========
Вопрос остался открытым - при переборе паролей возможен прокол.
А тему можно закрывать - вместо конструктивного диалога - одни понты.

Ответить