Ms-Chap + NT-Password

classic Classic list List threaded Threaded
18 messages Options
| Threaded
Open this post in threaded view
|

Ms-Chap + NT-Password

Anton Kiryushkin
Hello.

I'm sorry for the odd question.
I have a freeradius installation with version 3.0.15.
Approximately a year ago I configured the next scheme:
- all users contained in MySQL;
- all users have an NTLM-hash as a password;
- when the user tries to auth to a radius, radius-server was hashed the
incoming password to NTLM-hash and check it.

Now I can't repeat it, and I don't know why.

I see the next error in my log:

Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:   NT-Password :=
0x696e616d6974414c545a694e3039393021
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: FROM 1 TO 1 MAX 2
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: Examining NT-Password
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: OVERWRITING
NT-Password FROM 0 TO 0
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: TO in 1 out 1
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: to[0] = NT-Password
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ... falling-through to
profile processing
Thu Dec 20 01:10:08 2018 : Debug: rlm_sql (sql-wifi): Released connection
(19)
Thu Dec 20 01:10:08 2018 : Info: Need 1 more connections to reach min
connections (5)
Thu Dec 20 01:10:08 2018 : Info: rlm_sql (sql-wifi): Opening additional
connection (30), 1 of 6 pending slots used
Thu Dec 20 01:10:08 2018 : Debug: rlm_sql_mysql: Starting connect to MySQL
server
Thu Dec 20 01:10:08 2018 : Debug: rlm_sql_mysql: Connected to database
'my_table' on 127.0.0.1 via TCP/IP, server version 5.7.19-17-log, protocol
version 10
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]:
returned from sql-wifi (rlm_sql)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [sql-wifi] = ok
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]: calling
pap (rlm_pap)
Thu Dec 20 01:10:08 2018 : WARNING: (138) pap: Auth-Type already set.  Not
setting to PAP
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]:
returned from pap (rlm_pap)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [pap] = noop
Thu Dec 20 01:10:08 2018 : Debug: (138)     } # authorize = updated
Thu Dec 20 01:10:08 2018 : Debug: (138)   Found Auth-Type = eap
Thu Dec 20 01:10:08 2018 : Debug: (138)   # Executing group from file
/etc/raddb/sites-enabled/default
Thu Dec 20 01:10:08 2018 : Debug: (138)     authenticate {
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authenticate]:
calling eap (rlm_eap)
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Expiring EAP session with
state 0x0d5314a80d540ec8
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Finished EAP session with
state 0x0d5314a80d540ec8
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Previous EAP request found for
state 0x0d5314a80d540ec8, released from the list
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Peer sent packet with method
EAP MSCHAPv2 (26)
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Calling submodule eap_mschapv2
to process data
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_mschapv2: # Executing group
from file /etc/raddb/sites-enabled/default
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_mschapv2:   Auth-Type MS-CHAP {
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_mschapv2:
 modsingle[authenticate]: calling mschap (rlm_mschap)
Thu Dec 20 01:10:08 2018 : WARNING: (138) mschap: NT-Password found but
incorrect length, expected 16 bytes got 17 bytes.  Authentication may fail
Thu Dec 20 01:10:08 2018 : WARNING: (138) mschap: No Cleartext-Password
configured.  Cannot create NT-Password
Thu Dec 20 01:10:08 2018 : WARNING: (138) mschap: No Cleartext-Password
configured.  Cannot create LM-Password
Thu Dec 20 01:10:08 2018 : Debug: (138) mschap: Creating challenge hash
with username: y.lilekov
Thu Dec 20 01:10:08 2018 : Debug: (138) mschap: Client is using MS-CHAPv2
Thu Dec 20 01:10:08 2018 : ERROR: (138) mschap: FAILED: No NT/LM-Password.
Cannot perform authentication
Thu Dec 20 01:10:08 2018 : ERROR: (138) mschap: MS-CHAP2-Response is
incorrect

For the authorize_check_query and authorize_reply_query I'm using the next
queries:

authorize_check_query = "\
        SELECT wifi_id as id, username, 'NT-Password' as attribute,
pass_hash, ':=' as  op \
        FROM ${authcheck_table} \
        WHERE username = '%{SQL-User-Name}' \
        ORDER BY id"

authorize_reply_query = "\
        SELECT wifi_id as id, username, 'NT-Password' as attribute,
pass_hash, ':=' as  op \
        FROM ${authcheck_table} \
        WHERE username = '%{SQL-User-Name}' \
        ORDER BY id"


The error is logical. But I can't remember how it could be work a year
ago...
I'll happy to read any suggestion.

--
Best regards,
Anton Kiryushkin
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Matthew Newton-3
On Thu, 2018-12-20 at 02:22 +0000, Anton Kiryushkin wrote:
> Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:   NT-Password :=
> 0x696e616d6974414c545a694e3039393021

That hash entirely consists of printable characters, which seems
improbable...

> Thu Dec 20 01:10:08 2018 : WARNING: (138) mschap: NT-Password found
> but
> incorrect length, expected 16 bytes got 17 bytes.  Authentication may
> fail

...and is not the correct length either.

Your password hash isn't good.

--
Matthew


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Anton Kiryushkin
Hello, Matthew.

Yes, I have the same fear about the hash.
I made it in the two ways:
- hash=$(printf '%s' "${pass}" | iconv -t utf16le | openssl md4 2>/dev/null
| awk '{print $NF}')
- smbencrypt

Both ways are equal.  Which method is right in my case?

чт, 20 дек. 2018 г. в 02:30, Matthew Newton <[hidden email]>:

> On Thu, 2018-12-20 at 02:22 +0000, Anton Kiryushkin wrote:
> > Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:   NT-Password :=
> > 0x696e616d6974414c545a694e3039393021
>
> That hash entirely consists of printable characters, which seems
> improbable...
>
> > Thu Dec 20 01:10:08 2018 : WARNING: (138) mschap: NT-Password found
> > but
> > incorrect length, expected 16 bytes got 17 bytes.  Authentication may
> > fail
>
> ...and is not the correct length either.
>
> Your password hash isn't good.
>
> --
> Matthew
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html



--
Best regards,
Anton Kiryushkin
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Alan DeKok-2
On Dec 20, 2018, at 2:47 AM, Anton Kiryushkin <[hidden email]> wrote:

>
> Hello, Matthew.
>
> Yes, I have the same fear about the hash.
> I made it in the two ways:
> - hash=$(printf '%s' "${pass}" | iconv -t utf16le | openssl md4 2>/dev/null
> | awk '{print $NF}')
> - smbencrypt
>
> Both ways are equal.  Which method is right in my case?

  smbencrypt it preferred.  I use:

$ smbencrypt hello
LM Hash NT Hash
-------------------------------- --------------------------------
FDA95FBECA288D44AAD3B435B51404EE 066DDFD4EF0E9CD7C256FE77191EF43C

  And the use the NT hash.

  There is just no way that an input password ends up being *all* ASCII characters after hashing.  It looks like you've taken the input password, and then tried to use that as the NT hash.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Anton Kiryushkin
Hello, Alan.

I checked it.

Let me show you full log:

Thu Dec 20 01:10:08 2018 : Debug: (138)   User-Name = "
[hidden email]"
Thu Dec 20 01:10:08 2018 : Debug: (138)   Chargeable-User-Identity = 0x00
Thu Dec 20 01:10:08 2018 : Debug: (138)   Location-Capable = Civic-Location
Thu Dec 20 01:10:08 2018 : Debug: (138)   Calling-Station-Id =
"38-2b-78-03-ee-70"
Thu Dec 20 01:10:08 2018 : Debug: (138)   Called-Station-Id =
"cc-46-d6-09-ed-50:BD"
Thu Dec 20 01:10:08 2018 : Debug: (138)   NAS-Port = 13
Thu Dec 20 01:10:08 2018 : Debug: (138)   Cisco-AVPair =
"audit-session-id=c0a807c8000000015ba9aa3b"
Thu Dec 20 01:10:08 2018 : Debug: (138)   Acct-Session-Id =
"5ba9aa3b/38:2b:78:03:ee:70/1"
Thu Dec 20 01:10:08 2018 : Debug: (138)   NAS-IP-Address = 192.168.1.200
Thu Dec 20 01:10:08 2018 : Debug: (138)   NAS-Identifier = "wc-5508"
Thu Dec 20 01:10:08 2018 : Debug: (138)   Airespace-Wlan-Id = 14
Thu Dec 20 01:10:08 2018 : Debug: (138)   Service-Type = Framed-User
Thu Dec 20 01:10:08 2018 : Debug: (138)   Framed-MTU = 1300
Thu Dec 20 01:10:08 2018 : Debug: (138)   NAS-Port-Type = Wireless-802.11
Thu Dec 20 01:10:08 2018 : Debug: (138)   Tunnel-Type:0 = VLAN
Thu Dec 20 01:10:08 2018 : Debug: (138)   Tunnel-Medium-Type:0 = IEEE-802
Thu Dec 20 01:10:08 2018 : Debug: (138)   Tunnel-Private-Group-Id:0 = "14"
Thu Dec 20 01:10:08 2018 : Debug: (138)   EAP-Message =
0x0207007b19001703020070493c43a0045e1a736402d6353c2ebfd02b02b3da47074e8043e42814d384055eb07d8a3fdf5fc763651fee8a9c19e2525e0450f5bee24195a432757be658ec4fec63f0d1a904eaed55de4f98bc097aca893e67f8761a530e374122b3ba2c61eab23cf1af3ecd9ab8edf2907b
Thu Dec 20 01:10:08 2018 : Debug: (138)   State =
0x9a0fd4fc9e08cd9b875e606333810d4e
Thu Dec 20 01:10:08 2018 : Debug: (138)   Message-Authenticator =
0x3b8a82762eef0a453f82a36821b263f2
Thu Dec 20 01:10:08 2018 : Debug: (138) session-state: No cached attributes
Thu Dec 20 01:10:08 2018 : Debug: (138) # Executing section authorize from
file /etc/raddb/sites-enabled/default
Thu Dec 20 01:10:08 2018 : Debug: (138)   authorize {
Thu Dec 20 01:10:08 2018 : Debug: (138)     if (!control:Cleartext-Password
&& &User-Password) {
Thu Dec 20 01:10:08 2018 : Debug: (138)     if (!control:Cleartext-Password
&& &User-Password)  -> FALSE
Thu Dec 20 01:10:08 2018 : Debug: (138)     if (config:User-Password &&
config:Cleartext-Password) {
Thu Dec 20 01:10:08 2018 : Debug: (138)     if (config:User-Password &&
config:Cleartext-Password)  -> FALSE
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: calling
preprocess (rlm_preprocess)
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: returned
from preprocess (rlm_preprocess)
Thu Dec 20 01:10:08 2018 : Debug: (138)     [preprocess] = ok
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: calling
chap (rlm_chap)
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: returned
from chap (rlm_chap)
Thu Dec 20 01:10:08 2018 : Debug: (138)     [chap] = noop
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: calling
mschap (rlm_mschap)
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: returned
from mschap (rlm_mschap)
Thu Dec 20 01:10:08 2018 : Debug: (138)     [mschap] = noop
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: calling
suffix (rlm_realm)
Thu Dec 20 01:10:08 2018 : Debug: (138) suffix: Checking for suffix after
"@"
Thu Dec 20 01:10:08 2018 : Debug: (138) suffix: Looking up realm "
espressif.com" for User-Name = "[hidden email]"
Thu Dec 20 01:10:08 2018 : Debug: (138) suffix: No such realm "espressif.com
"
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: returned
from suffix (rlm_realm)
Thu Dec 20 01:10:08 2018 : Debug: (138)     [suffix] = noop
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: calling
eap (rlm_eap)
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Peer sent EAP Response (code
2) ID 7 length 123
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Continuing tunnel setup
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authorize]: returned
from eap (rlm_eap)
Thu Dec 20 01:10:08 2018 : Debug: (138)     [eap] = ok
Thu Dec 20 01:10:08 2018 : Debug: (138)   } # authorize = ok
Thu Dec 20 01:10:08 2018 : Debug: (138) Found Auth-Type = eap
Thu Dec 20 01:10:08 2018 : Debug: (138) # Executing group from file
/etc/raddb/sites-enabled/default
Thu Dec 20 01:10:08 2018 : Debug: (138)   authenticate {
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authenticate]:
calling eap (rlm_eap)
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Expiring EAP session with
state 0x0d5314a80d540ec8
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Finished EAP session with
state 0x9a0fd4fc9e08cd9b
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Previous EAP request found for
state 0x9a0fd4fc9e08cd9b, released from the list
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Peer sent packet with method
EAP PEAP (25)
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Calling submodule eap_peap to
process data
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Continuing EAP-TLS
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Peer sent flags ---
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: [eaptls verify] = ok
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Done initial handshake
Thu Dec 20 01:10:08 2018 : Debug: Ignoring cbtls_msg call with pseudo
content type 256, version 0
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: [eaptls process] = ok
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Session established.
Decoding tunneled attributes
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: PEAP state phase2
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: EAP method MSCHAPv2 (26)
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Got tunneled request
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   EAP-Message =
0x020700441a0207003f3199f6449a50fa3b50be389565dde6ae4b0000000000000000e78496d30625840ded712d0b260d96bead07a7fdd950530a00792e6c696c656b6f76
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Setting User-Name to
testlogin
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Sending tunneled request
to default
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   EAP-Message =
0x020700441a0207003f3199f6449a50fa3b50be389565dde6ae4b0000000000000000e78496d30625840ded712d0b260d96bead07a7fdd950530a00792e6c696c656b6f76
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   FreeRADIUS-Proxied-To =
127.0.0.1
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   User-Name = “testlogin"
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   State =
0x0d5314a80d540ec8eca17483a9cfe203
Thu Dec 20 01:10:08 2018 : Debug: (138) Virtual server default received
request
Thu Dec 20 01:10:08 2018 : Debug: (138)   EAP-Message =
0x020700441a0207003f3199f6449a50fa3b50be389565dde6ae4b0000000000000000e78496d30625840ded712d0b260d96bead07a7fdd950530a00792e6c696c656b6f76
Thu Dec 20 01:10:08 2018 : Debug: (138)   FreeRADIUS-Proxied-To = 127.0.0.1
Thu Dec 20 01:10:08 2018 : Debug: (138)   User-Name = "testlogin "
Thu Dec 20 01:10:08 2018 : Debug: (138)   State =
0x0d5314a80d540ec8eca17483a9cfe203
Thu Dec 20 01:10:08 2018 : Debug: (138) server default {
Thu Dec 20 01:10:08 2018 : Debug: (138)   session-state: No cached
attributes
Thu Dec 20 01:10:08 2018 : Debug: (138)   # Executing section authorize
from file /etc/raddb/sites-enabled/default
Thu Dec 20 01:10:08 2018 : Debug: (138)     authorize {
Thu Dec 20 01:10:08 2018 : Debug: (138)       if
(!control:Cleartext-Password && &User-Password) {
Thu Dec 20 01:10:08 2018 : Debug: (138)       if
(!control:Cleartext-Password && &User-Password)  -> FALSE
Thu Dec 20 01:10:08 2018 : Debug: (138)       if (config:User-Password &&
config:Cleartext-Password) {
Thu Dec 20 01:10:08 2018 : Debug: (138)       if (config:User-Password &&
config:Cleartext-Password)  -> FALSE
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]: calling
preprocess (rlm_preprocess)
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]:
returned from preprocess (rlm_preprocess)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [preprocess] = ok
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]: calling
chap (rlm_chap)
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]:
returned from chap (rlm_chap)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [chap] = noop
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]: calling
mschap (rlm_mschap)
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]:
returned from mschap (rlm_mschap)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [mschap] = noop
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]: calling
suffix (rlm_realm)
Thu Dec 20 01:10:08 2018 : Debug: (138) suffix: Checking for suffix after
"@"
Thu Dec 20 01:10:08 2018 : Debug: (138) suffix: No '@' in User-Name =
“testlogin", looking up realm NULL
Thu Dec 20 01:10:08 2018 : Debug: (138) suffix: No such realm "NULL"
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]:
returned from suffix (rlm_realm)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [suffix] = noop
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]: calling
eap (rlm_eap)
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Peer sent EAP Response (code
2) ID 7 length 68
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: No EAP Start, assuming it's an
on-going EAP conversation
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]:
returned from eap (rlm_eap)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [eap] = updated
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]: calling
sql-wifi (rlm_sql)
Thu Dec 20 01:10:08 2018 : Debug: %{User-Name}
Thu Dec 20 01:10:08 2018 : Debug: Parsed xlat tree:
Thu Dec 20 01:10:08 2018 : Debug: attribute --> User-Name
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: EXPAND %{User-Name}
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:    --> testlogin
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: SQL-User-Name set to
’testlogin'
Thu Dec 20 01:10:08 2018 : Info: rlm_sql (sql-wifi): Closing connection
(28): Hit idle_timeout, was idle for 80 seconds
Thu Dec 20 01:10:08 2018 : Debug: rlm_sql (sql-wifi): You probably need to
lower "min"
Thu Dec 20 01:10:08 2018 : Debug: rlm_sql_mysql: Socket destructor called,
closing socket
Thu Dec 20 01:10:08 2018 : Debug: rlm_sql (sql-wifi): Reserved connection
(19)
Thu Dec 20 01:10:08 2018 : Debug: SELECT wifi_id as id, UserName,
'NT-Password' as attribute, pass_hash, ':=' as  op FROM userstable WHERE
username = '%{SQL-User-Name}' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: Parsed xlat tree:
Thu Dec 20 01:10:08 2018 : Debug: literal --> SELECT wifi_id as id,
UserName, 'NT-Password' as attribute, pass_hash, ':=' as  op FROM
userstable WHERE username = '
Thu Dec 20 01:10:08 2018 : Debug: attribute --> SQL-User-Name
Thu Dec 20 01:10:08 2018 : Debug: literal --> ' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: EXPAND SELECT wifi_id as
id, UserName, 'NT-Password' as attribute, pass_hash, ':=' as  op FROM
userstable WHERE username = '%{SQL-User-Name}' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:    --> SELECT wifi_id as
id, UserName, 'NT-Password' as attribute, pass_hash, ':=' as  op FROM
userstable  WHERE username = ’testlogin' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: Executing select query:
SELECT wifi_id as id, UserName, 'NT-Password' as attribute, pass_hash, ':='
as  op FROM userstable WHERE username = ’testlogin' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: User found in radcheck
table
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: Conditional check items
matched, merging assignment check items
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:   NT-Password :=
0x3161666532333532663366363365333136376163646230306136646366386235
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: FROM 1 TO 1 MAX 2
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: Examining NT-Password
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: APPENDING NT-Password
FROM 0 TO 1
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: TO in 1 out 1
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: to[0] = Auth-Type
Thu Dec 20 01:10:08 2018 : Debug: SELECT wifi_id as id, username,
'NT-Password' as attribute, pass_hash, ':=' as  op FROM userstable WHERE
username = '%{SQL-User-Name}' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: Parsed xlat tree:
Thu Dec 20 01:10:08 2018 : Debug: literal --> SELECT wifi_id as id,
username, 'NT-Password' as attribute, pass_hash, ':=' as  op FROM
userstable WHERE username = '
Thu Dec 20 01:10:08 2018 : Debug: attribute --> SQL-User-Name
Thu Dec 20 01:10:08 2018 : Debug: literal --> ' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: EXPAND SELECT wifi_id as
id, username, 'NT-Password' as attribute, pass_hash, ':=' as  op FROM
userstable WHERE username = '%{SQL-User-Name}' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:    --> SELECT wifi_id as
id, username, 'NT-Password' as attribute, pass_hash, ':=' as  op FROM
userstable WHERE username = ’testlogin' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: Executing select query:
SELECT wifi_id as id, username, 'NT-Password' as attribute, pass_hash, ':='
as  op FROM userstable WHERE username = ’testlogin' ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: User found in radreply
table, merging reply items
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:   NT-Password :=
0x3161666532333532663366363365333136376163646230306136646366386235
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: FROM 1 TO 0 MAX 1
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: Examining NT-Password
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: APPENDING NT-Password
FROM 0 TO 0
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: TO in 0 out 0
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ... falling-through to
group processing
Thu Dec 20 01:10:08 2018 : Debug: SELECT 'OfficeWifi' as GroupName FROM
userstable WHERE UserName='%{SQL-User-Name}'
Thu Dec 20 01:10:08 2018 : Debug: Parsed xlat tree:
Thu Dec 20 01:10:08 2018 : Debug: literal --> SELECT 'OfficeWifi' as
GroupName FROM userstable WHERE UserName='
Thu Dec 20 01:10:08 2018 : Debug: attribute --> SQL-User-Name
Thu Dec 20 01:10:08 2018 : Debug: literal --> '
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: EXPAND SELECT
'OfficeWifi' as GroupName FROM userstable WHERE UserName='%{SQL-User-Name}'
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:    --> SELECT
'OfficeWifi' as GroupName FROM userstable WHERE UserName='testlogin'
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: Executing select query:
SELECT 'OfficeWifi' as GroupName FROM userstable WHERE UserName='testlogin'
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: User found in the group
table
Thu Dec 20 01:10:08 2018 : Debug: SELECT wifi_id as id, 'OfficeWifi' as
GroupName, 'NT-Password' as attribute, password, ':=' as op FROM userstable
          WHERE Username = '%{SQL-User-Name}'           ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: Parsed xlat tree:
Thu Dec 20 01:10:08 2018 : Debug: literal --> SELECT wifi_id as id,
'OfficeWifi' as GroupName, 'NT-Password' as attribute, password, ':='
as op FROM
userstable           WHERE Username = '
Thu Dec 20 01:10:08 2018 : Debug: attribute --> SQL-User-Name
Thu Dec 20 01:10:08 2018 : Debug: literal --> '           ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: EXPAND SELECT wifi_id as
id, 'OfficeWifi' as GroupName, 'NT-Password' as attribute, password, ':='
as op FROM userstable           WHERE Username = '%{SQL-User-Name}'
  ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:    --> SELECT wifi_id as
id, 'OfficeWifi' as GroupName, 'NT-Password' as attribute, password, ':='
as op FROM userstable           WHERE Username = ’testlogin'
ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: Executing select query:
SELECT wifi_id as id, 'OfficeWifi' as GroupName, 'NT-Password' as
attribute, password, ':=' as op FROM userstable           WHERE Username =
'testlogin'           ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: Group "OfficeWifi":
Conditional check items matched
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: Group "OfficeWifi":
Merging assignment check items
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:   NT-Password :=
0x696e616d6974414c545a694e3039393021
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: FROM 1 TO 2 MAX 3
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: Examining NT-Password
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: OVERWRITING
NT-Password FROM 0 TO 1
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: TO in 2 out 2
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: to[0] = Auth-Type
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: to[1] = NT-Password
Thu Dec 20 01:10:08 2018 : Debug: SELECT wifi_id as id, 'OfficeWifi' as
GroupName, 'NT-Password' as attribute, password, ':=' as op         FROM
userstable           WHERE Username = '%{SQL-User-Name}'           ORDER BY
id
Thu Dec 20 01:10:08 2018 : Debug: Parsed xlat tree:
Thu Dec 20 01:10:08 2018 : Debug: literal --> SELECT wifi_id as id,
'OfficeWifi' as GroupName, 'NT-Password' as attribute, password, ':=' as op
        FROM userstable           WHERE Username = '
Thu Dec 20 01:10:08 2018 : Debug: attribute --> SQL-User-Name
Thu Dec 20 01:10:08 2018 : Debug: literal --> '           ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: EXPAND SELECT wifi_id as
id, 'OfficeWifi' as GroupName, 'NT-Password' as attribute, password, ':='
as op         FROM userstable           WHERE Username = '%{SQL-User-Name}'
          ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:    --> SELECT wifi_id as
id, 'OfficeWifi' as GroupName, 'NT-Password' as attribute, password, ':='
as op         FROM userstable           WHERE Username = 'testlogin'
    ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: Executing select query:
SELECT wifi_id as id, 'OfficeWifi' as GroupName, 'NT-Password' as
attribute, password, ':=' as op         FROM userstable           WHERE
Username = 'testlogin'           ORDER BY id
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: Group "OfficeWifi":
Merging reply items
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:   NT-Password :=
0x696e616d6974414c545a694e3039393021
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: FROM 1 TO 1 MAX 2
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: Examining NT-Password
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: OVERWRITING
NT-Password FROM 0 TO 0
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: TO in 1 out 1
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ::: to[0] = NT-Password
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi: ... falling-through to
profile processing
Thu Dec 20 01:10:08 2018 : Debug: rlm_sql (sql-wifi): Released connection
(19)
Thu Dec 20 01:10:08 2018 : Info: Need 1 more connections to reach min
connections (5)
Thu Dec 20 01:10:08 2018 : Info: rlm_sql (sql-wifi): Opening additional
connection (30), 1 of 6 pending slots used
Thu Dec 20 01:10:08 2018 : Debug: rlm_sql_mysql: Starting connect to MySQL
server
Thu Dec 20 01:10:08 2018 : Debug: rlm_sql_mysql: Connected to database
'vpn_wifi' on 127.0.0.1 via TCP/IP, server version 5.7.19-17-log, protocol
version 10
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]:
returned from sql-wifi (rlm_sql)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [sql-wifi] = ok
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]: calling
pap (rlm_pap)
Thu Dec 20 01:10:08 2018 : WARNING: (138) pap: Auth-Type already set.  Not
setting to PAP
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authorize]:
returned from pap (rlm_pap)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [pap] = noop
Thu Dec 20 01:10:08 2018 : Debug: (138)     } # authorize = updated
Thu Dec 20 01:10:08 2018 : Debug: (138)   Found Auth-Type = eap
Thu Dec 20 01:10:08 2018 : Debug: (138)   # Executing group from file
/etc/raddb/sites-enabled/default
Thu Dec 20 01:10:08 2018 : Debug: (138)     authenticate {
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authenticate]:
calling eap (rlm_eap)
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Expiring EAP session with
state 0x0d5314a80d540ec8
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Finished EAP session with
state 0x0d5314a80d540ec8
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Previous EAP request found for
state 0x0d5314a80d540ec8, released from the list
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Peer sent packet with method
EAP MSCHAPv2 (26)
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Calling submodule eap_mschapv2
to process data
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_mschapv2: # Executing group
from file /etc/raddb/sites-enabled/default
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_mschapv2:   Auth-Type MS-CHAP {
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_mschapv2:
modsingle[authenticate]: calling mschap (rlm_mschap)
Thu Dec 20 01:10:08 2018 : WARNING: (138) mschap: NT-Password found but
incorrect length, expected 16 bytes got 17 bytes.  Authentication may fail
Thu Dec 20 01:10:08 2018 : WARNING: (138) mschap: No Cleartext-Password
configured.  Cannot create NT-Password
Thu Dec 20 01:10:08 2018 : WARNING: (138) mschap: No Cleartext-Password
configured.  Cannot create LM-Password
Thu Dec 20 01:10:08 2018 : Debug: (138) mschap: Creating challenge hash
with username: testlogin
Thu Dec 20 01:10:08 2018 : Debug: (138) mschap: Client is using MS-CHAPv2
Thu Dec 20 01:10:08 2018 : ERROR: (138) mschap: FAILED: No NT/LM-Password.
Cannot perform authentication
Thu Dec 20 01:10:08 2018 : ERROR: (138) mschap: MS-CHAP2-Response is
incorrect
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authenticate]:
returned from mschap (rlm_mschap)
Thu Dec 20 01:10:08 2018 : Debug: (138)     [mschap] = reject
Thu Dec 20 01:10:08 2018 : Debug: (138)   } # Auth-Type MS-CHAP = reject
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Sending EAP Failure (code 4)
ID 7 length 4
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Freeing handler
Thu Dec 20 01:10:08 2018 : Debug: (138)       modsingle[authenticate]:
returned from eap (rlm_eap)
Thu Dec 20 01:10:08 2018 : Debug: (138)       [eap] = reject
Thu Dec 20 01:10:08 2018 : Debug: (138)     } # authenticate = reject
Thu Dec 20 01:10:08 2018 : Debug: (138)   Failed to authenticate the user
Thu Dec 20 01:10:08 2018 : Debug: (138)   Using Post-Auth-Type Reject
Thu Dec 20 01:10:08 2018 : Debug: (138)   Post-Auth-Type sub-section not
found.  Ignoring.
Thu Dec 20 01:10:08 2018 : Auth: (138)   Login incorrect (mschap: FAILED:
No NT/LM-Password.  Cannot perform authentication): [testlogin/<via
Auth-Type = eap>] (from client WC-5508_ port 0 via TLS tunnel)
Thu Dec 20 01:10:08 2018 : Debug: (138) } # server default
Thu Dec 20 01:10:08 2018 : Debug: (138) Virtual server sending reply
Thu Dec 20 01:10:08 2018 : Debug: (138)   NT-Password =
0x696e616d6974414c545a694e3039393021
Thu Dec 20 01:10:08 2018 : Debug: (138)   MS-CHAP-Error = "\007E=691 R=1
C=86e3f7442e804d519197bbbf0301334f V=3 M=Authentication rejected"
Thu Dec 20 01:10:08 2018 : Debug: (138)   EAP-Message = 0x04070004
Thu Dec 20 01:10:08 2018 : Debug: (138)   Message-Authenticator =
0x00000000000000000000000000000000
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Got tunneled reply code 3
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   NT-Password =
0x696e616d6974414c545a694e3039393021
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   MS-CHAP-Error =
"\007E=691 R=1 C=86e3f7442e804d519197bbbf0301334f V=3 M=Authentication
rejected"
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   EAP-Message = 0x04070004
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   Message-Authenticator =
0x00000000000000000000000000000000
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Got tunneled reply RADIUS
code 3
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   NT-Password =
0x696e616d6974414c545a694e3039393021
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   MS-CHAP-Error =
"\007E=691 R=1 C=86e3f7442e804d519197bbbf0301334f V=3 M=Authentication
rejected"
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   EAP-Message = 0x04070004
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap:   Message-Authenticator =
0x00000000000000000000000000000000
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: Tunneled authentication
was rejected
Thu Dec 20 01:10:08 2018 : Debug: (138) eap_peap: FAILURE
Thu Dec 20 01:10:08 2018 : Debug: Ignoring cbtls_msg call with pseudo
content type 256, version 0
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: Sending EAP Request (code 1)
ID 8 length 59
Thu Dec 20 01:10:08 2018 : Debug: (138) eap: EAP session adding
&reply:State = 0x9a0fd4fc9f07cd9b
Thu Dec 20 01:10:08 2018 : Debug: (138)     modsingle[authenticate]:
returned from eap (rlm_eap)
Thu Dec 20 01:10:08 2018 : Debug: (138)     [eap] = handled
Thu Dec 20 01:10:08 2018 : Debug: (138)   } # authenticate = handled
Thu Dec 20 01:10:08 2018 : Debug: (138) Using Post-Auth-Type Challenge
Thu Dec 20 01:10:08 2018 : Debug: (138) Post-Auth-Type sub-section not
found.  Ignoring.
Thu Dec 20 01:10:08 2018 : Debug: (138) session-state: Nothing to cache

Could you please explain, what for you mean with "It looks like you've
taken the input password, and then tried to use that as the NT hash."?
Which way I have to use for my case?
And what exactly meaning strings below:

Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:   NT-Password :=
0x696e616d6974414c545a694e3039393021
Thu Dec 20 01:10:08 2018 : Debug: (138) sql-wifi:   NT-Password :=
0x3161666532333532663366363365333136376163646230306136646366386235

That isn't my real hashes. Yes, I used the same hash as you provided via
smbencrypt.
I can provide with you my full configuration file as well is it could help.



чт, 20 дек. 2018 г. в 11:40, Alan DeKok <[hidden email]>:

> On Dec 20, 2018, at 2:47 AM, Anton Kiryushkin <[hidden email]> wrote:
> >
> > Hello, Matthew.
> >
> > Yes, I have the same fear about the hash.
> > I made it in the two ways:
> > - hash=$(printf '%s' "${pass}" | iconv -t utf16le | openssl md4
> 2>/dev/null
> > | awk '{print $NF}')
> > - smbencrypt
> >
> > Both ways are equal.  Which method is right in my case?
>
>   smbencrypt it preferred.  I use:
>
> $ smbencrypt hello
> LM Hash                         NT Hash
> --------------------------------        --------------------------------
> FDA95FBECA288D44AAD3B435B51404EE        066DDFD4EF0E9CD7C256FE77191EF43C
>
>   And the use the NT hash.
>
>   There is just no way that an input password ends up being *all* ASCII
> characters after hashing.  It looks like you've taken the input password,
> and then tried to use that as the NT hash.
>
>   Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html



--
Best regards,
Anton Kiryushkin
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Alan DeKok-2
On Dec 20, 2018, at 3:52 PM, Anton Kiryushkin <[hidden email]> wrote:
>
> Hello, Alan.
>
> I checked it.
>
> Let me show you full log:
>
> Thu Dec 20 01:10:08 2018 : Debug: (138)   User-Name = "
> [hidden email]"

  Please post the log from "radiusd -X" as suggested *EVERYWHERE* in the documentation.

  For some unknown reason people recently seem to be ignoring all of the documentation that says to post "radiusd -X".  This is mentioned in the "man" page, the Wiki, and in the email you get when you join the list.

  Out of general principle, I'm going to ignore messages which fail to follow the documentation.

  Re-post this with the *correct* debug log, and I will read it.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Anton Kiryushkin
Hello, Alan.

You're right. My fault. Please see log below:

(9)   User-Name = "testlogin"
(9)   NAS-Port = 215
(9)   State = 0x5d9ac8cb5bb0d1b476356bca7bc2305b
(9)   EAP-Message =
0x022a00681900170303005d0000000000000002301470a7306238a494e48f971e6c3870bb09639041141c00594ceaf49ffe07ac3d0ecdb68988c165ca8f370152e4cc61bf8065410eb9cf70432c800237bc3f4b089aaa37633688a6abe470d7f72aacf17e16110ef7
(9)   Message-Authenticator = 0x3a5c65e42a9d0494a1805e850396ff75
(9)   Acct-Session-Id = "8O2.1x811d36760006c7c6"
(9)   NAS-Port-Id = "ge-3/0/40.0"
(9)   Calling-Station-Id = "2c-4d-54-65-19-3b"
(9)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(9)   NAS-IP-Address = 192.168.7.2
(9)   NAS-Identifier = "sw-ex6210"
(9)   NAS-Port-Type = Ethernet
(9) session-state: No cached attributes
(9) # Executing section authorize from file /etc/raddb/sites-enabled/default
(9)   authorize {
(9)     if (!control:Cleartext-Password && &User-Password) {
(9)     if (!control:Cleartext-Password && &User-Password)  -> FALSE
(9)     if (config:User-Password && config:Cleartext-Password) {
(9)     if (config:User-Password && config:Cleartext-Password)  -> FALSE
(9)     [preprocess] = ok
(9)     [chap] = noop
(9)     [mschap] = noop
(9) suffix: Checking for suffix after "@"
(9) suffix: No '@' in User-Name = "testlogin", looking up realm NULL
(9) suffix: No such realm "NULL"
(9)     [suffix] = noop
(9) eap: Peer sent EAP Response (code 2) ID 42 length 104
(9) eap: Continuing tunnel setup
(9)     [eap] = ok
(9)   } # authorize = ok
(9) Found Auth-Type = eap
(9) # Executing group from file /etc/raddb/sites-enabled/default
(9)   authenticate {
(9) eap: Expiring EAP session with state 0x1b445c8e1b6e4610
(9) eap: Finished EAP session with state 0x5d9ac8cb5bb0d1b4
(9) eap: Previous EAP request found for state 0x5d9ac8cb5bb0d1b4, released
from the list
(9) eap: Peer sent packet with method EAP PEAP (25)
(9) eap: Calling submodule eap_peap to process data
(9) eap_peap: Continuing EAP-TLS
(9) eap_peap: [eaptls verify] = ok
(9) eap_peap: Done initial handshake
(9) eap_peap: [eaptls process] = ok
(9) eap_peap: Session established.  Decoding tunneled attributes
(9) eap_peap: PEAP state phase2
(9) eap_peap: EAP method MSCHAPv2 (26)
(9) eap_peap: Got tunneled request
(9) eap_peap:   EAP-Message =
0x022a00491a022a0044314bdbebd0c0d0e6a8932b5fcdc388361a00000000000000004318685452e8005b97b446f5c1c0d23265bc1198557b1aa900646d697472792e616e616e796576
(9) eap_peap: Setting User-Name to testlogin
(9) eap_peap: Sending tunneled request to default
(9) eap_peap:   EAP-Message =
0x022a00491a022a0044314bdbebd0c0d0e6a8932b5fcdc388361a00000000000000004318685452e8005b97b446f5c1c0d23265bc1198557b1aa900646d697472792e616e616e796576
(9) eap_peap:   FreeRADIUS-Proxied-To = 127.0.0.1
(9) eap_peap:   User-Name = "testlogin"
(9) eap_peap:   State = 0x1b445c8e1b6e4610f294f492105a1239
(9) Virtual server default received request
(9)   EAP-Message =
0x022a00491a022a0044314bdbebd0c0d0e6a8932b5fcdc388361a00000000000000004318685452e8005b97b446f5c1c0d23265bc1198557b1aa900646d697472792e616e616e796576
(9)   FreeRADIUS-Proxied-To = 127.0.0.1
(9)   User-Name = "testlogin"
(9)   State = 0x1b445c8e1b6e4610f294f492105a1239
(9) WARNING: Outer and inner identities are the same.  User privacy is
compromised.
(9) server default {
(9)   session-state: No cached attributes
(9)   # Executing section authorize from file
/etc/raddb/sites-enabled/default
(9)     authorize {
(9)       if (!control:Cleartext-Password && &User-Password) {
(9)       if (!control:Cleartext-Password && &User-Password)  -> FALSE
(9)       if (config:User-Password && config:Cleartext-Password) {
(9)       if (config:User-Password && config:Cleartext-Password)  -> FALSE
(9)       [preprocess] = ok
(9)       [chap] = noop
(9)       [mschap] = noop
(9) suffix: Checking for suffix after "@"
(9) suffix: No '@' in User-Name = "testlogin", looking up realm NULL
(9) suffix: No such realm "NULL"
(9)       [suffix] = noop
(9) eap: Peer sent EAP Response (code 2) ID 42 length 73
(9) eap: No EAP Start, assuming it's an on-going EAP conversation
(9)       [eap] = updated
(9) sql-wifi: EXPAND %{User-Name}
(9) sql-wifi:    --> testlogin
(9) sql-wifi: SQL-User-Name set to 'testlogin'
rlm_sql (sql-wifi): Reserved connection (2)
(9) sql-wifi: EXPAND SELECT wifi_id as id, username, 'NT-Password' as
attribute, pass_hash, ':=' as  op FROM userstable WHERE username =
'%{SQL-User-Name}' ORDER BY id
(9) sql-wifi:    --> SELECT wifi_id as id, username, 'NT-Password' as
attribute, pass_hash, ':=' as  op FROM userstable WHERE username =
'testlogin' ORDER BY id
(9) sql-wifi: Executing select query: SELECT wifi_id as id, username,
'NT-Password' as attribute, pass_hash, ':=' as  op FROM userstable WHERE
username = 'testlogin' ORDER BY id
(9) sql-wifi: User found in radcheck table
(9) sql-wifi: Conditional check items matched, merging assignment check
items
(9) sql-wifi:   NT-Password :=
0x6336623331333036323736373866653636626166393538616561356566363138
(9) sql-wifi: EXPAND SELECT wifi_id as id, username, 'NT-Password' as
attribute, pass_hash, ':=' as  op FROM userstable WHERE username =
'%{SQL-User-Name}' ORDER BY id
(9) sql-wifi:    --> SELECT wifi_id as id, username, 'NT-Password' as
attribute, pass_hash, ':=' as  op FROM userstable WHERE username =
'testlogin' ORDER BY id
(9) sql-wifi: Executing select query: SELECT wifi_id as id, username,
'NT-Password' as attribute, pass_hash, ':=' as  op FROM userstable WHERE
username = 'testlogin' ORDER BY id
(9) sql-wifi: User found in radreply table, merging reply items
(9) sql-wifi:   NT-Password :=
0x6336623331333036323736373866653636626166393538616561356566363138
(9) sql-wifi: EXPAND SELECT 'OfficeWifi' as GroupName FROM userstable WHERE
UserName='%{SQL-User-Name}'
(9) sql-wifi:    --> SELECT 'OfficeWifi' as GroupName FROM userstable WHERE
UserName='testlogin'
(9) sql-wifi: Executing select query: SELECT 'OfficeWifi' as GroupName FROM
userstable WHERE UserName='testlogin'
(9) sql-wifi: User found in the group table
(9) sql-wifi: EXPAND SELECT wifi_id as id, 'OfficeWifi' as GroupName,
'NT-Password' as attribute, password, ':=' as op FROM userstable
WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(9) sql-wifi:    --> SELECT wifi_id as id, 'OfficeWifi' as GroupName,
'NT-Password' as attribute, password, ':=' as op FROM userstable
WHERE Username = 'testlogin'           ORDER BY id
(9) sql-wifi: Executing select query: SELECT wifi_id as id, 'OfficeWifi' as
GroupName, 'NT-Password' as attribute, password, ':=' as op FROM userstable
          WHERE Username = 'testlogin'           ORDER BY id
(9) sql-wifi: Group "OfficeWifi": Conditional check items matched
(9) sql-wifi: Group "OfficeWifi": Merging assignment check items
(9) sql-wifi:   NT-Password := 0x61675648496e73416b666d41
(9) sql-wifi: EXPAND SELECT wifi_id as id, 'OfficeWifi' as GroupName,
'NT-Password' as attribute, password, ':=' as op         FROM userstable
        WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(9) sql-wifi:    --> SELECT wifi_id as id, 'OfficeWifi' as GroupName,
'NT-Password' as attribute, password, ':=' as op         FROM userstable
        WHERE Username = 'testlogin'           ORDER BY id
(9) sql-wifi: Executing select query: SELECT wifi_id as id, 'OfficeWifi' as
GroupName, 'NT-Password' as attribute, password, ':=' as op         FROM
userstable           WHERE Username = 'testlogin'           ORDER BY id
(9) sql-wifi: Group "OfficeWifi": Merging reply items
(9) sql-wifi:   NT-Password := 0x61675648496e73416b666d41
rlm_sql (sql-wifi): Released connection (2)
(9)       [sql-wifi] = ok
(9) pap: WARNING: Auth-Type already set.  Not setting to PAP
(9)       [pap] = noop
(9)     } # authorize = updated
(9)   Found Auth-Type = eap
(9)   # Executing group from file /etc/raddb/sites-enabled/default
(9)     authenticate {
(9) eap: Expiring EAP session with state 0x1b445c8e1b6e4610
(9) eap: Finished EAP session with state 0x1b445c8e1b6e4610
(9) eap: Previous EAP request found for state 0x1b445c8e1b6e4610, released
from the list
(9) eap: Peer sent packet with method EAP MSCHAPv2 (26)
(9) eap: Calling submodule eap_mschapv2 to process data
(9) eap_mschapv2: # Executing group from file
/etc/raddb/sites-enabled/default
(9) eap_mschapv2:   Auth-Type MS-CHAP {
(9) mschap: WARNING: NT-Password found but incorrect length, expected 16
bytes got 12 bytes.  Authentication may fail
(9) mschap: WARNING: No Cleartext-Password configured.  Cannot create
NT-Password
(9) mschap: WARNING: No Cleartext-Password configured.  Cannot create
LM-Password
(9) mschap: Creating challenge hash with username: testlogin
(9) mschap: Client is using MS-CHAPv2
(9) mschap: ERROR: FAILED: No NT/LM-Password.  Cannot perform authentication
(9) mschap: ERROR: MS-CHAP2-Response is incorrect
(9)     [mschap] = reject
(9)   } # Auth-Type MS-CHAP = reject


чт, 20 дек. 2018 г. в 21:06, Alan DeKok <[hidden email]>:

> On Dec 20, 2018, at 3:52 PM, Anton Kiryushkin <[hidden email]> wrote:
> >
> > Hello, Alan.
> >
> > I checked it.
> >
> > Let me show you full log:
> >
> > Thu Dec 20 01:10:08 2018 : Debug: (138)   User-Name = "
> > [hidden email]"
>
>   Please post the log from "radiusd -X" as suggested *EVERYWHERE* in the
> documentation.
>
>   For some unknown reason people recently seem to be ignoring all of the
> documentation that says to post "radiusd -X".  This is mentioned in the
> "man" page, the Wiki, and in the email you get when you join the list.
>
>   Out of general principle, I'm going to ignore messages which fail to
> follow the documentation.
>
>   Re-post this with the *correct* debug log, and I will read it.
>
>   Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html



--
Best regards,
Anton Kiryushkin
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Alan DeKok-2
On Dec 20, 2018, at 6:18 PM, Anton Kiryushkin <[hidden email]> wrote:
> You're right. My fault. Please see log below:

  Thanks.
> ...
> (9) sql-wifi: Conditional check items matched, merging assignment check
> items
> (9) sql-wifi:   NT-Password :=
> 0x6336623331333036323736373866653636626166393538616561356566363138

  Again... that's all ASCII data.  You've taken the hex form of the string:

c6b3130627678fe66baf958aea5ef618

  And instead of just putting this into SQL:

        NT-Password := 0xc6b3130627678fe66baf958aea5ef618

  You've converted the ASCII representation to hex again... and then set that as the NT password.

  Don't do that.

> ...
> (9) eap_mschapv2:   Auth-Type MS-CHAP {
> (9) mschap: WARNING: NT-Password found but incorrect length, expected 16
> bytes got 12 bytes.  Authentication may fail

  And the NT password is mangled, as noted above.

  Why are you converting the hex string to ASCII *twice*?  Just take the output of smbencrypt, put a "0x" in front of it, and set it as NT-Password in the database:

  Again:

$ smbencrypt hello
LM Hash NT Hash
-------------------------------- --------------------------------
FDA95FBECA288D44AAD3B435B51404EE 066DDFD4EF0E9CD7C256FE77191EF43C

  And then:

        NT-Password := 0x066DDFD4EF0E9CD7C256FE77191EF43C

  You *don't* have to hex-encode the hex output of smbencrypt.

  Alan DeKok.

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Anton Kiryushkin
Hello, Alan!

Thank you very much for your explanation. I fixed one of my problems. But
there is one more, unfortunately. Could you please tell me why some clients
still can't log in:

(100)   User-Name = "userlogin"
(100)   NAS-Port = 158
(100)   State = 0xdfe5d421d9edcd166308d87da9087b41
(100)   EAP-Message =
0x020800351900170303002abc4c2d588a812994d7637b8cf7c8e557548e904bb34346565f494f3aaa80e6d18234158a7c557d7aa815
(100)   Message-Authenticator = 0x2234a8c507c202ab49305ca9dfd9cd31
(100)   Acct-Session-Id = "8O2.1x811d6dbc00069635"
(100)   NAS-Port-Id = "ge-6/0/25.0"
(100)   Calling-Station-Id = "68-05-ca-1c-a5-b0"
(100)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(100)   NAS-IP-Address = 192.168.7.2
(100)   NAS-Identifier = "sw-ex6210"
(100)   NAS-Port-Type = Ethernet
(100) session-state: No cached attributes
(100) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(100)   authorize {
(100)     if (!control:Cleartext-Password && &User-Password) {
(100)     if (!control:Cleartext-Password && &User-Password)  -> FALSE
(100)     if (config:User-Password && config:Cleartext-Password) {
(100)     if (config:User-Password && config:Cleartext-Password)  -> FALSE
(100)     [preprocess] = ok
(100)     [chap] = noop
(100)     [mschap] = noop
(100) suffix: Checking for suffix after "@"
(100) suffix: No '@' in User-Name = "userlogin", looking up realm NULL
(100) suffix: No such realm "NULL"
(100)     [suffix] = noop
(100) eap: Peer sent EAP Response (code 2) ID 8 length 53
(100) eap: Continuing tunnel setup
(100)     [eap] = ok
(100)   } # authorize = ok
(100) Found Auth-Type = eap
(100) # Executing group from file /etc/raddb/sites-enabled/default
(100)   authenticate {
(100) eap: Expiring EAP session with state 0xf92482fcf82c861b
(100) eap: Finished EAP session with state 0xdfe5d421d9edcd16
(100) eap: Previous EAP request found for state 0xdfe5d421d9edcd16,
released from the list
(100) eap: Peer sent packet with method EAP PEAP (25)
(100) eap: Calling submodule eap_peap to process data
(100) eap_peap: Continuing EAP-TLS
(100) eap_peap: [eaptls verify] = ok
(100) eap_peap: Done initial handshake
(100) eap_peap: [eaptls process] = ok
(100) eap_peap: Session established.  Decoding tunneled attributes
(100) eap_peap: PEAP state phase2
(100) eap_peap: EAP method MD5 (4)
(100) eap_peap: Got tunneled request
(100) eap_peap:   EAP-Message =
0x0208001604103e503e5f6c109089add772abaf6ec360
(100) eap_peap: Setting User-Name to userlogin
(100) eap_peap: Sending tunneled request to default
(100) eap_peap:   EAP-Message =
0x0208001604103e503e5f6c109089add772abaf6ec360
(100) eap_peap:   FreeRADIUS-Proxied-To = 127.0.0.1
(100) eap_peap:   User-Name = "userlogin"
(100) eap_peap:   State = 0xf92482fcf82c861be33a289febd6a3c6
(100) Virtual server default received request
(100)   EAP-Message = 0x0208001604103e503e5f6c109089add772abaf6ec360
(100)   FreeRADIUS-Proxied-To = 127.0.0.1
(100)   User-Name = "userlogin"
(100)   State = 0xf92482fcf82c861be33a289febd6a3c6
(100) WARNING: Outer and inner identities are the same.  User privacy is
compromised.
(100) server default {
(100)   session-state: No cached attributes
(100)   # Executing section authorize from file
/etc/raddb/sites-enabled/default
(100)     authorize {
(100)       if (!control:Cleartext-Password && &User-Password) {
(100)       if (!control:Cleartext-Password && &User-Password)  -> FALSE
(100)       if (config:User-Password && config:Cleartext-Password) {
(100)       if (config:User-Password && config:Cleartext-Password)  -> FALSE
(100)       [preprocess] = ok
(100)       [chap] = noop
(100)       [mschap] = noop
(100) suffix: Checking for suffix after "@"
(100) suffix: No '@' in User-Name = "userlogin", looking up realm NULL
(100) suffix: No such realm "NULL"
(100)       [suffix] = noop
(100) eap: Peer sent EAP Response (code 2) ID 8 length 22
(100) eap: No EAP Start, assuming it's an on-going EAP conversation
(100)       [eap] = updated
(100) sql-wifi: EXPAND %{User-Name}
(100) sql-wifi:    --> userlogin
(100) sql-wifi: SQL-User-Name set to 'userlogin'
rlm_sql (sql-wifi): Reserved connection (0)
(100) sql-wifi: EXPAND SELECT wifi_id as id, username, 'NT-Password' as
attribute, pass_hash, ':=' as  op FROM wifiusers WHERE username =
'%{SQL-User-Name}' ORDER BY id
(100) sql-wifi:    --> SELECT wifi_id as id, username, 'NT-Password' as
attribute, pass_hash, ':=' as  op FROM wifiusers WHERE username =
'userlogin' ORDER BY id
(100) sql-wifi: Executing select query: SELECT wifi_id as id, username,
'NT-Password' as attribute, pass_hash, ':=' as  op FROM wifiusers WHERE
username = 'userlogin' ORDER BY id
(100) sql-wifi: User found in radcheck table
(100) sql-wifi: Conditional check items matched, merging assignment check
items
(100) sql-wifi:   NT-Password := 0xc6fd69aa559296b7835e39ef243c7304
(100) sql-wifi: EXPAND SELECT id, UserName, Attribute, Value, op FROM
msk_wifi_attrs WHERE username = '%{SQL-User-Name}' ORDER BY id
(100) sql-wifi:    --> SELECT id, UserName, Attribute, Value, op FROM
msk_wifi_attrs WHERE username = 'userlogin' ORDER BY id
(100) sql-wifi: Executing select query: SELECT id, UserName, Attribute,
Value, op FROM msk_wifi_attrs WHERE username = 'userlogin' ORDER BY id
(100) sql-wifi: EXPAND SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='%{SQL-User-Name}'
(100) sql-wifi:    --> SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='userlogin'
(100) sql-wifi: Executing select query: SELECT 'Officewifi' as GroupName
FROM wifiusers WHERE UserName='userlogin'
(100) sql-wifi: User found in the group table
(100) sql-wifi: EXPAND SELECT wifi_id as id, 'Officewifi' as GroupName,
'NT-Password' as attribute, pass_hash, ':=' as op FROM wifiusers
WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(100) sql-wifi:    --> SELECT wifi_id as id, 'Officewifi' as GroupName,
'NT-Password' as attribute, pass_hash, ':=' as op FROM wifiusers
WHERE Username = 'userlogin'           ORDER BY id
(100) sql-wifi: Executing select query: SELECT wifi_id as id, 'Officewifi'
as GroupName, 'NT-Password' as attribute, pass_hash, ':=' as op FROM
wifiusers           WHERE Username = 'userlogin'           ORDER BY id
(100) sql-wifi: Group "Officewifi": Conditional check items matched
(100) sql-wifi: Group "Officewifi": Merging assignment check items
(100) sql-wifi:   NT-Password := 0xc6fd69aa559296b7835e39ef243c7304
(100) sql-wifi: EXPAND SELECT wifi_id as id, 'Officewifi' as GroupName,
'NT-Password' as attribute, pass_hash, ':=' as op         FROM wifiusers
        WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(100) sql-wifi:    --> SELECT wifi_id as id, 'Officewifi' as GroupName,
'NT-Password' as attribute, pass_hash, ':=' as op         FROM wifiusers
        WHERE Username = 'userlogin'           ORDER BY id
(100) sql-wifi: Executing select query: SELECT wifi_id as id, 'Officewifi'
as GroupName, 'NT-Password' as attribute, pass_hash, ':=' as op
FROM wifiusers           WHERE Username = 'userlogin'           ORDER BY id
(100) sql-wifi: Group "Officewifi": Merging reply items
(100) sql-wifi:   NT-Password := 0xc6fd69aa559296b7835e39ef243c7304
rlm_sql (sql-wifi): Released connection (0)
(100)       [sql-wifi] = ok
(100) pap: WARNING: Auth-Type already set.  Not setting to PAP
(100)       [pap] = noop
(100)     } # authorize = updated
(100)   Found Auth-Type = eap
(100)   # Executing group from file /etc/raddb/sites-enabled/default
(100)     authenticate {
(100) eap: Expiring EAP session with state 0xf92482fcf82c861b
(100) eap: Finished EAP session with state 0xf92482fcf82c861b
(100) eap: Previous EAP request found for state 0xf92482fcf82c861b,
released from the list
(100) eap: Peer sent packet with method EAP MD5 (4)
(100) eap: Calling submodule eap_md5 to process data
(100) eap_md5: ERROR: Cleartext-Password is required for EAP-MD5
authentication
(100) eap: ERROR: Failed continuing EAP MD5 (4) session.  EAP sub-module
failed
(100) eap: Sending EAP Failure (code 4) ID 8 length 4
(100) eap: Failed in EAP select
(100)       [eap] = invalid
(100)     } # authenticate = invalid
(100)   Failed to authenticate the user

I suppose, the main problem from this string:

(100) eap_peap: EAP method MD5 (4)

But, I haven't enabled this type of authorization:

eap {
default_eap_type = peap

Neither in ttls-section as well:

ttls {
tls = tls-common
default_eap_type = peap
copy_request_to_tunnel = yes
use_tunneled_reply = yes
virtual_server = "inner-tunnel"
}

Probably I should have two versions of hashes for wifi and ethernet
authorization?


пт, 21 дек. 2018 г. в 00:13, Alan DeKok <[hidden email]>:

> On Dec 20, 2018, at 6:18 PM, Anton Kiryushkin <[hidden email]> wrote:
> > You're right. My fault. Please see log below:
>
>   Thanks.
> > ...
> > (9) sql-wifi: Conditional check items matched, merging assignment check
> > items
> > (9) sql-wifi:   NT-Password :=
> > 0x6336623331333036323736373866653636626166393538616561356566363138
>
>   Again... that's all ASCII data.  You've taken the hex form of the string:
>
> c6b3130627678fe66baf958aea5ef618
>
>   And instead of just putting this into SQL:
>
>         NT-Password := 0xc6b3130627678fe66baf958aea5ef618
>
>   You've converted the ASCII representation to hex again... and then set
> that as the NT password.
>
>   Don't do that.
>
> > ...
> > (9) eap_mschapv2:   Auth-Type MS-CHAP {
> > (9) mschap: WARNING: NT-Password found but incorrect length, expected 16
> > bytes got 12 bytes.  Authentication may fail
>
>   And the NT password is mangled, as noted above.
>
>   Why are you converting the hex string to ASCII *twice*?  Just take the
> output of smbencrypt, put a "0x" in front of it, and set it as NT-Password
> in the database:
>
>   Again:
>
> $ smbencrypt hello
> LM Hash                         NT Hash
> --------------------------------        --------------------------------
> FDA95FBECA288D44AAD3B435B51404EE        066DDFD4EF0E9CD7C256FE77191EF43C
>
>   And then:
>
>         NT-Password := 0x066DDFD4EF0E9CD7C256FE77191EF43C
>
>   You *don't* have to hex-encode the hex output of smbencrypt.
>
>   Alan DeKok.
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html



--
Best regards,
Anton Kiryushkin
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Alan DeKok-2
On Dec 21, 2018, at 6:28 PM, Anton Kiryushkin <[hidden email]> wrote:
>
> Thank you very much for your explanation. I fixed one of my problems. But
> there is one more, unfortunately. Could you please tell me why some clients
> still can't log in:

  The debug messages are clear...
>
> (100) eap: Peer sent packet with method EAP MD5 (4)
> (100) eap: Calling submodule eap_md5 to process data
> (100) eap_md5: ERROR: Cleartext-Password is required for EAP-MD5
> authentication

  You need a Cleartext-Password to do EAP-MD5.

  The rest of the debug messages make it clear that the EAP-MD5 method is being used *inside* of PEAP.

> I suppose, the main problem from this string:
>
> (100) eap_peap: EAP method MD5 (4)
>
> But, I haven't enabled this type of authorization:

  Yes, you have.  You've listed "md5" inside of the "eap" module configuration.  If you didn't list "md5" there, then FreeRADIUS would complain that EAP-MD5 wasn't permitted.  Instead, it runs EAP-MD5.

> Probably I should have two versions of hashes for wifi and ethernet
> authorization?

  The debug log says you need the Cleartext-Password, not a hashed password.  And once you have that, FreeRADIUS can do PEAP/MS-CHAP, too.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Anton Kiryushkin
Hello, Alan.

As I understand I need two sites for authorizing clients via wifi and
ethernet. I made a different site, and I wrote a rule to redirect users.
But. When I'm checking this solution I can't understand why freeradius
expecting Cleartext-Password instead MD5-password (Please see log below):

(9) Received Access-Request Id 143 from 127.0.0.1:45799 to 127.0.0.1:1812
length 72
(9)   User-Name = “testier"
(9)   User-Password = “password"
(9)   NAS-IP-Address = 127.0.0.1
(9) # Executing section authorize from file
/etc/raddb/sites-enabled/inner-tunnel
(9)   authorize {
(9)     if (!control:Cleartext-Password && &User-Password) {
(9)     if (!control:Cleartext-Password && &User-Password)  -> TRUE
(9)     if (!control:Cleartext-Password && &User-Password)  {
(9)       update control {
(9)         EXPAND %{control:User-Password}
(9)            -->
(9)         Password-With-Header :=
(9)         EXPAND %{control:User-Password}
(9)            -->
(9)         control:Cleartext-Password :=
(9)         User-Password := ""
(9)       } # update control = noop
(9)       update reply {
(9)         EXPAND %{control:User-Password}
(9)            -->
(9)         User-Password -=
(9)       } # update reply = noop
(9)     } # if (!control:Cleartext-Password && &User-Password)  = noop
(9)     if (config:User-Password && config:Cleartext-Password) {
(9)     if (config:User-Password && config:Cleartext-Password)  -> TRUE
(9)     if (config:User-Password && config:Cleartext-Password)  {
(9)       update config {
(9)         User-Password !* ANY
(9)       } # update config = noop
(9)     } # if (config:User-Password && config:Cleartext-Password)  = noop
(9)     [preprocess] = ok
(9)     [chap] = noop
(9)     [mschap] = noop
(9) suffix: Checking for suffix after "@"
(9) suffix: No '@' in User-Name = "testuser", looking up realm NULL
(9) suffix: No such realm "NULL"
(9)     [suffix] = noop
(9)     update control {
(9)       Proxy-To-Realm := LOCAL
(9)     } # update control = noop
(9) eap: No EAP-Message, not doing EAP
(9)     [eap] = noop
(9)     if (NAS-IP-Address == 127.0.0.1) {
(9)     if (NAS-IP-Address == 127.0.0.1)  -> TRUE
(9)     if (NAS-IP-Address == 127.0.0.1)  {
(9) sql-wifi-ethernet: EXPAND %{User-Name}
(9) sql-wifi-ethernet:    --> testuser
(9) sql-wifi-ethernet: SQL-User-Name set to 'testuser'
rlm_sql (sql-wifi-ethernet): Reserved connection (13)
(9) sql-wifi-ethernet: EXPAND SELECT wifi_id as id, username,
'MD5-Password' as attribute, md5_hash, ':=' as  op FROM wifiusers WHERE
username = '%{SQL-User-Name}' ORDER BY id
(9) sql-wifi-ethernet:    --> SELECT wifi_id as id, username,
'MD5-Password' as attribute, md5_hash, ':=' as  op FROM wifiusers WHERE
username = 'testuser' ORDER BY id
(9) sql-wifi-ethernet: Executing select query: SELECT wifi_id as id,
username, 'MD5-Password' as attribute, md5_hash, ':=' as  op FROM wifiusers
WHERE username = 'testuser' ORDER BY id
(9) sql-wifi-ethernet: User found in radcheck table
(9) sql-wifi-ethernet: Conditional check items matched, merging assignment
check items
(9) sql-wifi-ethernet:   MD5-Password :=
0x6c375752517179667431416e4c4f6462714d365679413d3d
(9) sql-wifi-ethernet: EXPAND SELECT id, UserName, Attribute, Value, op
FROM msk_wifi_attrs WHERE username = '%{SQL-User-Name}' ORDER BY id
(9) sql-wifi-ethernet:    --> SELECT id, UserName, Attribute, Value, op
FROM msk_wifi_attrs WHERE username = 'testuser' ORDER BY id
(9) sql-wifi-ethernet: Executing select query: SELECT id, UserName,
Attribute, Value, op FROM msk_wifi_attrs WHERE username = 'testuser' ORDER
BY id
(9) sql-wifi-ethernet: EXPAND SELECT 'Officewifi' as GroupName FROM
wifiusers WHERE UserName='%{SQL-User-Name}'
(9) sql-wifi-ethernet:    --> SELECT 'Officewifi' as GroupName FROM
wifiusers WHERE UserName='testuser'
(9) sql-wifi-ethernet: Executing select query: SELECT 'Officewifi' as
GroupName FROM wifiusers WHERE UserName='testuser'
(9) sql-wifi-ethernet: User found in the group table
(9) sql-wifi-ethernet: EXPAND SELECT wifi_id as id, 'Officewifi' as
GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op FROM wifiusers
          WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(9) sql-wifi-ethernet:    --> SELECT wifi_id as id, 'Officewifi' as
GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op FROM wifiusers
          WHERE Username = 'testuser'           ORDER BY id
(9) sql-wifi-ethernet: Executing select query: SELECT wifi_id as id,
'Officewifi' as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op
 FROM wifiusers           WHERE Username = 'testuser'           ORDER BY id
(9) sql-wifi-ethernet: Group "Officewifi": Conditional check items matched
(9) sql-wifi-ethernet: Group "Officewifi": Merging assignment check items
(9) sql-wifi-ethernet:   MD5-Password :=
0x6c375752517179667431416e4c4f6462714d365679413d3d
(9) sql-wifi-ethernet: EXPAND SELECT wifi_id as id, 'Officewifi' as
GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op         FROM
wifiusers           WHERE Username = '%{SQL-User-Name}'           ORDER BY
id
(9) sql-wifi-ethernet:    --> SELECT wifi_id as id, 'Officewifi' as
GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op         FROM
wifiusers           WHERE Username = 'testuser'           ORDER BY id
(9) sql-wifi-ethernet: Executing select query: SELECT wifi_id as id,
'Officewifi' as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as
op         FROM wifiusers           WHERE Username = 'testuser'
ORDER BY id
(9) sql-wifi-ethernet: Group "Officewifi": Merging reply items
(9) sql-wifi-ethernet:   MD5-Password :=
0x6c375752517179667431416e4c4f6462714d365679413d3d
rlm_sql (sql-wifi-ethernet): Released connection (13)
(9)       [sql-wifi-ethernet] = ok
(9)     } # if (NAS-IP-Address == 127.0.0.1)  = ok
(9)     ... skipping else: Preceding "if" was taken
(9)     [files] = noop
(9)     [expiration] = noop
(9)     [logintime] = noop
(9) pap: WARNING: Config already contains a "known good" password
(&control:Cleartext-Password).  Ignoring &config:Password-With-Header
(9) pap: Normalizing MD5-Password from base64 encoding, 24 bytes -> 16 bytes
(9)     [pap] = updated
(9)   } # authorize = updated
(9) Found Auth-Type = PAP
(9) # Executing group from file /etc/raddb/sites-enabled/inner-tunnel
(9)   Auth-Type PAP {
(9) pap: Login attempt with password
(9) pap: Comparing with "known good" Cleartext-Password
(9) pap: ERROR: Cleartext password does not match "known good" password
(9) pap: Passwords don't match
(9)     [pap] = reject
(9)   } # Auth-Type PAP = reject
(9) Failed to authenticate the user
(9) Using Post-Auth-Type Reject
(9) # Executing group from file /etc/raddb/sites-enabled/inner-tunnel
(9)   Post-Auth-Type REJECT {
(9) attr_filter.access_reject: EXPAND %{User-Name}
(9) attr_filter.access_reject:    --> testuser
(9) attr_filter.access_reject: Matched entry DEFAULT at line 11
(9)     [attr_filter.access_reject] = updated
(9)   } # Post-Auth-Type REJECT = updated

I wish you Happy New Year. Thanks for the future answer.

сб, 22 дек. 2018 г. в 13:43, Alan DeKok <[hidden email]>:

> On Dec 21, 2018, at 6:28 PM, Anton Kiryushkin <[hidden email]> wrote:
> >
> > Thank you very much for your explanation. I fixed one of my problems. But
> > there is one more, unfortunately. Could you please tell me why some
> clients
> > still can't log in:
>
>   The debug messages are clear...
> >
> > (100) eap: Peer sent packet with method EAP MD5 (4)
> > (100) eap: Calling submodule eap_md5 to process data
> > (100) eap_md5: ERROR: Cleartext-Password is required for EAP-MD5
> > authentication
>
>   You need a Cleartext-Password to do EAP-MD5.
>
>   The rest of the debug messages make it clear that the EAP-MD5 method is
> being used *inside* of PEAP.
>
> > I suppose, the main problem from this string:
> >
> > (100) eap_peap: EAP method MD5 (4)
> >
> > But, I haven't enabled this type of authorization:
>
>   Yes, you have.  You've listed "md5" inside of the "eap" module
> configuration.  If you didn't list "md5" there, then FreeRADIUS would
> complain that EAP-MD5 wasn't permitted.  Instead, it runs EAP-MD5.
>
> > Probably I should have two versions of hashes for wifi and ethernet
> > authorization?
>
>   The debug log says you need the Cleartext-Password, not a hashed
> password.  And once you have that, FreeRADIUS can do PEAP/MS-CHAP, too.
>
>   Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html



--
Best regards,
Anton Kiryushkin
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Anton Kiryushkin
In other words, how can I make a different way to authorisation users by
per controllers?
I found the option virtual_server, but when I read a log I saw that client
goes through a dedicated site with an md5-hashed password and after comes
back to default site.
What is this hash:
 MD5-Password := 0x6c375752517179667431416e4c4f6462714d365679413d3d
I saved in my database other hashed via next script:

#! /usr/bin/perl -w
use strict;
use Digest::MD5;
use MIME::Base64;
unless($ARGV[0]){
 print "Please supply a password to create a MD5 hash from.\n";
 exit;
}
my $ctx = Digest::MD5->new;
$ctx->add($ARGV[0]);
print encode_base64($ctx->digest,'')."\n";

And passwords hashed in that way are working with VPN-site.

пн, 31 дек. 2018 г. в 14:56, Anton Kiryushkin <[hidden email]>:

> Hello, Alan.
>
> As I understand I need two sites for authorizing clients via wifi and
> ethernet. I made a different site, and I wrote a rule to redirect users.
> But. When I'm checking this solution I can't understand why freeradius
> expecting Cleartext-Password instead MD5-password (Please see log below):
>
> (9) Received Access-Request Id 143 from 127.0.0.1:45799 to 127.0.0.1:1812
> length 72
> (9)   User-Name = “testier"
> (9)   User-Password = “password"
> (9)   NAS-IP-Address = 127.0.0.1
> (9) # Executing section authorize from file
> /etc/raddb/sites-enabled/inner-tunnel
> (9)   authorize {
> (9)     if (!control:Cleartext-Password && &User-Password) {
> (9)     if (!control:Cleartext-Password && &User-Password)  -> TRUE
> (9)     if (!control:Cleartext-Password && &User-Password)  {
> (9)       update control {
> (9)         EXPAND %{control:User-Password}
> (9)            -->
> (9)         Password-With-Header :=
> (9)         EXPAND %{control:User-Password}
> (9)            -->
> (9)         control:Cleartext-Password :=
> (9)         User-Password := ""
> (9)       } # update control = noop
> (9)       update reply {
> (9)         EXPAND %{control:User-Password}
> (9)            -->
> (9)         User-Password -=
> (9)       } # update reply = noop
> (9)     } # if (!control:Cleartext-Password && &User-Password)  = noop
> (9)     if (config:User-Password && config:Cleartext-Password) {
> (9)     if (config:User-Password && config:Cleartext-Password)  -> TRUE
> (9)     if (config:User-Password && config:Cleartext-Password)  {
> (9)       update config {
> (9)         User-Password !* ANY
> (9)       } # update config = noop
> (9)     } # if (config:User-Password && config:Cleartext-Password)  = noop
> (9)     [preprocess] = ok
> (9)     [chap] = noop
> (9)     [mschap] = noop
> (9) suffix: Checking for suffix after "@"
> (9) suffix: No '@' in User-Name = "testuser", looking up realm NULL
> (9) suffix: No such realm "NULL"
> (9)     [suffix] = noop
> (9)     update control {
> (9)       Proxy-To-Realm := LOCAL
> (9)     } # update control = noop
> (9) eap: No EAP-Message, not doing EAP
> (9)     [eap] = noop
> (9)     if (NAS-IP-Address == 127.0.0.1) {
> (9)     if (NAS-IP-Address == 127.0.0.1)  -> TRUE
> (9)     if (NAS-IP-Address == 127.0.0.1)  {
> (9) sql-wifi-ethernet: EXPAND %{User-Name}
> (9) sql-wifi-ethernet:    --> testuser
> (9) sql-wifi-ethernet: SQL-User-Name set to 'testuser'
> rlm_sql (sql-wifi-ethernet): Reserved connection (13)
> (9) sql-wifi-ethernet: EXPAND SELECT wifi_id as id, username,
> 'MD5-Password' as attribute, md5_hash, ':=' as  op FROM wifiusers WHERE
> username = '%{SQL-User-Name}' ORDER BY id
> (9) sql-wifi-ethernet:    --> SELECT wifi_id as id, username,
> 'MD5-Password' as attribute, md5_hash, ':=' as  op FROM wifiusers WHERE
> username = 'testuser' ORDER BY id
> (9) sql-wifi-ethernet: Executing select query: SELECT wifi_id as id,
> username, 'MD5-Password' as attribute, md5_hash, ':=' as  op FROM wifiusers
> WHERE username = 'testuser' ORDER BY id
> (9) sql-wifi-ethernet: User found in radcheck table
> (9) sql-wifi-ethernet: Conditional check items matched, merging assignment
> check items
> (9) sql-wifi-ethernet:   MD5-Password :=
> 0x6c375752517179667431416e4c4f6462714d365679413d3d
> (9) sql-wifi-ethernet: EXPAND SELECT id, UserName, Attribute, Value, op
> FROM msk_wifi_attrs WHERE username = '%{SQL-User-Name}' ORDER BY id
> (9) sql-wifi-ethernet:    --> SELECT id, UserName, Attribute, Value, op
> FROM msk_wifi_attrs WHERE username = 'testuser' ORDER BY id
> (9) sql-wifi-ethernet: Executing select query: SELECT id, UserName,
> Attribute, Value, op FROM msk_wifi_attrs WHERE username = 'testuser' ORDER
> BY id
> (9) sql-wifi-ethernet: EXPAND SELECT 'Officewifi' as GroupName FROM
> wifiusers WHERE UserName='%{SQL-User-Name}'
> (9) sql-wifi-ethernet:    --> SELECT 'Officewifi' as GroupName FROM
> wifiusers WHERE UserName='testuser'
> (9) sql-wifi-ethernet: Executing select query: SELECT 'Officewifi' as
> GroupName FROM wifiusers WHERE UserName='testuser'
> (9) sql-wifi-ethernet: User found in the group table
> (9) sql-wifi-ethernet: EXPAND SELECT wifi_id as id, 'Officewifi' as
> GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op FROM
> wifiusers           WHERE Username = '%{SQL-User-Name}'           ORDER BY
> id
> (9) sql-wifi-ethernet:    --> SELECT wifi_id as id, 'Officewifi' as
> GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op FROM
> wifiusers           WHERE Username = 'testuser'           ORDER BY id
> (9) sql-wifi-ethernet: Executing select query: SELECT wifi_id as id,
> 'Officewifi' as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op
>  FROM wifiusers           WHERE Username = 'testuser'           ORDER BY
> id
> (9) sql-wifi-ethernet: Group "Officewifi": Conditional check items matched
> (9) sql-wifi-ethernet: Group "Officewifi": Merging assignment check items
> (9) sql-wifi-ethernet:   MD5-Password :=
> 0x6c375752517179667431416e4c4f6462714d365679413d3d
> (9) sql-wifi-ethernet: EXPAND SELECT wifi_id as id, 'Officewifi' as
> GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op         FROM
> wifiusers           WHERE Username = '%{SQL-User-Name}'           ORDER BY
> id
> (9) sql-wifi-ethernet:    --> SELECT wifi_id as id, 'Officewifi' as
> GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op         FROM
> wifiusers           WHERE Username = 'testuser'           ORDER BY id
> (9) sql-wifi-ethernet: Executing select query: SELECT wifi_id as id,
> 'Officewifi' as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as
> op         FROM wifiusers           WHERE Username = 'testuser'
> ORDER BY id
> (9) sql-wifi-ethernet: Group "Officewifi": Merging reply items
> (9) sql-wifi-ethernet:   MD5-Password :=
> 0x6c375752517179667431416e4c4f6462714d365679413d3d
> rlm_sql (sql-wifi-ethernet): Released connection (13)
> (9)       [sql-wifi-ethernet] = ok
> (9)     } # if (NAS-IP-Address == 127.0.0.1)  = ok
> (9)     ... skipping else: Preceding "if" was taken
> (9)     [files] = noop
> (9)     [expiration] = noop
> (9)     [logintime] = noop
> (9) pap: WARNING: Config already contains a "known good" password
> (&control:Cleartext-Password).  Ignoring &config:Password-With-Header
> (9) pap: Normalizing MD5-Password from base64 encoding, 24 bytes -> 16
> bytes
> (9)     [pap] = updated
> (9)   } # authorize = updated
> (9) Found Auth-Type = PAP
> (9) # Executing group from file /etc/raddb/sites-enabled/inner-tunnel
> (9)   Auth-Type PAP {
> (9) pap: Login attempt with password
> (9) pap: Comparing with "known good" Cleartext-Password
> (9) pap: ERROR: Cleartext password does not match "known good" password
> (9) pap: Passwords don't match
> (9)     [pap] = reject
> (9)   } # Auth-Type PAP = reject
> (9) Failed to authenticate the user
> (9) Using Post-Auth-Type Reject
> (9) # Executing group from file /etc/raddb/sites-enabled/inner-tunnel
> (9)   Post-Auth-Type REJECT {
> (9) attr_filter.access_reject: EXPAND %{User-Name}
> (9) attr_filter.access_reject:    --> testuser
> (9) attr_filter.access_reject: Matched entry DEFAULT at line 11
> (9)     [attr_filter.access_reject] = updated
> (9)   } # Post-Auth-Type REJECT = updated
>
> I wish you Happy New Year. Thanks for the future answer.
>
> сб, 22 дек. 2018 г. в 13:43, Alan DeKok <[hidden email]>:
>
>> On Dec 21, 2018, at 6:28 PM, Anton Kiryushkin <[hidden email]> wrote:
>> >
>> > Thank you very much for your explanation. I fixed one of my problems.
>> But
>> > there is one more, unfortunately. Could you please tell me why some
>> clients
>> > still can't log in:
>>
>>   The debug messages are clear...
>> >
>> > (100) eap: Peer sent packet with method EAP MD5 (4)
>> > (100) eap: Calling submodule eap_md5 to process data
>> > (100) eap_md5: ERROR: Cleartext-Password is required for EAP-MD5
>> > authentication
>>
>>   You need a Cleartext-Password to do EAP-MD5.
>>
>>   The rest of the debug messages make it clear that the EAP-MD5 method is
>> being used *inside* of PEAP.
>>
>> > I suppose, the main problem from this string:
>> >
>> > (100) eap_peap: EAP method MD5 (4)
>> >
>> > But, I haven't enabled this type of authorization:
>>
>>   Yes, you have.  You've listed "md5" inside of the "eap" module
>> configuration.  If you didn't list "md5" there, then FreeRADIUS would
>> complain that EAP-MD5 wasn't permitted.  Instead, it runs EAP-MD5.
>>
>> > Probably I should have two versions of hashes for wifi and ethernet
>> > authorization?
>>
>>   The debug log says you need the Cleartext-Password, not a hashed
>> password.  And once you have that, FreeRADIUS can do PEAP/MS-CHAP, too.
>>
>>   Alan DeKok.
>>
>>
>> -
>> List info/subscribe/unsubscribe? See
>> http://www.freeradius.org/list/users.html
>
>
>
> --
> Best regards,
> Anton Kiryushkin
>
>

--
Best regards,
Anton Kiryushkin
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Herwin Weststrate
On 31-12-18 16:22, Anton Kiryushkin wrote:

> In other words, how can I make a different way to authorisation users by
> per controllers?
> I found the option virtual_server, but when I read a log I saw that client
> goes through a dedicated site with an md5-hashed password and after comes
> back to default site.
> What is this hash:
>  MD5-Password := 0x6c375752517179667431416e4c4f6462714d365679413d3d
> I saved in my database other hashed via next script:
>
> #! /usr/bin/perl -w
> use strict;
> use Digest::MD5;
> use MIME::Base64;
> unless($ARGV[0]){
>  print "Please supply a password to create a MD5 hash from.\n";
>  exit;
> }
> my $ctx = Digest::MD5->new;
> $ctx->add($ARGV[0]);
> print encode_base64($ctx->digest,'')."\n";

That doesn't result in a MD5 hash, but in a base64-encoded MD5 hash. You
can replace the last line with:

  print $ctx->hexdigest."\n";

(Or just use something like `echo -n "secret" | md5sum` in bash)

> And passwords hashed in that way are working with VPN-site.

Theoretically, FreeRADIUS will be able to use it as well, after
performing a number of operations on it. It's probably easier to check
if the VPN-thingy supports the output of hexdigest as well.

--
Herwin Weststrate
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Anton Kiryushkin
Hi, Herwin.

Yes, I’ve tried your suggestion as well, and it doesn't work.

On Mon, 31 Dec 2018 at 15:32, Herwin Weststrate <[hidden email]>
wrote:

> On 31-12-18 16:22, Anton Kiryushkin wrote:
> > In other words, how can I make a different way to authorisation users by
> > per controllers?
> > I found the option virtual_server, but when I read a log I saw that
> client
> > goes through a dedicated site with an md5-hashed password and after comes
> > back to default site.
> > What is this hash:
> >  MD5-Password := 0x6c375752517179667431416e4c4f6462714d365679413d3d
> > I saved in my database other hashed via next script:
> >
> > #! /usr/bin/perl -w
> > use strict;
> > use Digest::MD5;
> > use MIME::Base64;
> > unless($ARGV[0]){
> >  print "Please supply a password to create a MD5 hash from.\n";
> >  exit;
> > }
> > my $ctx = Digest::MD5->new;
> > $ctx->add($ARGV[0]);
> > print encode_base64($ctx->digest,'')."\n";
>
> That doesn't result in a MD5 hash, but in a base64-encoded MD5 hash. You
> can replace the last line with:
>
>   print $ctx->hexdigest."\n";
>
> (Or just use something like `echo -n "secret" | md5sum` in bash)
>
> > And passwords hashed in that way are working with VPN-site.
>
> Theoretically, FreeRADIUS will be able to use it as well, after
> performing a number of operations on it. It's probably easier to check
> if the VPN-thingy supports the output of hexdigest as well.
>
> --
> Herwin Weststrate
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html

--
Best regards,
Anton Kiryushkin
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Alan DeKok-2
In reply to this post by Anton Kiryushkin
On Dec 31, 2018, at 9:56 AM, Anton Kiryushkin <[hidden email]> wrote:
> As I understand I need two sites for authorizing clients via wifi and
> ethernet.

  What's a "site" ?

  Please use *standard* words for things.

> I made a different site, and I wrote a rule to redirect users.
> But. When I'm checking this solution I can't understand why freeradius
> expecting Cleartext-Password instead MD5-password (Please see log below):

  Because you configured multiple passwords for the user.

> (9) pap: WARNING: Config already contains a "known good" password
> (&control:Cleartext-Password).  Ignoring &config:Password-With-Header
> (9) pap: Normalizing MD5-Password from base64 encoding, 24 bytes -> 16 bytes

  You've configured the user with:

        Cleartext-Password
        Password-With-Header
        MD5-Password

  Why?

  It's your configuration.  You should know what you've configured.  None of that is in the default config.

> (9)     [pap] = updated
> (9)   } # authorize = updated
> (9) Found Auth-Type = PAP
> (9) # Executing group from file /etc/raddb/sites-enabled/inner-tunnel
> (9)   Auth-Type PAP {
> (9) pap: Login attempt with password
> (9) pap: Comparing with "known good" Cleartext-Password
> (9) pap: ERROR: Cleartext password does not match "known good" password
> (9) pap: Passwords don't match

  Which seems to be clear.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Alan DeKok-2
In reply to this post by Anton Kiryushkin
On Dec 31, 2018, at 10:22 AM, Anton Kiryushkin <[hidden email]> wrote:
>
> In other words, how can I make a different way to authorisation users by
> per controllers?

  Read raddb/sites-available/README

  It describes how to map clients to different virtual servers.

> I found the option virtual_server, but when I read a log I saw that client
> goes through a dedicated site with an md5-hashed password and after comes
> back to default site.

  Which is what you configured it to do...

  The default configuration doesn't do that.

> And passwords hashed in that way are working with VPN-site.

  Don't invent new words.  It's confusing.  It also means that you're not thinking about the configuration correctly.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Anton Kiryushkin
Hello, everyone.

Now I read the documentation, but I still don't understand why server
choose one method instead of others (I've read about attempts predict). So,
I have next config file and I try to understand why it's don't working:
(Unfortunately, I don't understand the reason why it has working for
mschapv2 and don't work for eap)

FreeRADIUS Version 3.0.16
Copyright (C) 1999-2017 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
For more information about these matters, see the file named COPYRIGHT
Starting - reading configuration files ...
including dictionary file /usr/share/freeradius/dictionary
including dictionary file /usr/share/freeradius/dictionary.dhcp
including dictionary file /usr/share/freeradius/dictionary.vqp
including dictionary file /etc/raddb/dictionary
including configuration file /etc/raddb/radiusd.conf
including configuration file /etc/raddb/proxy.conf
including configuration file /etc/raddb/clients.conf
including files in directory /etc/raddb/mods-enabled/
including configuration file /etc/raddb/mods-enabled/ntlm_auth
including configuration file /etc/raddb/mods-enabled/unix
including configuration file /etc/raddb/mods-enabled/radutmp
including configuration file /etc/raddb/mods-enabled/sql-ethernet
including configuration file /etc/raddb/mods-enabled/expr
including configuration file /etc/raddb/mods-enabled/logintime
including configuration file /etc/raddb/mods-enabled/digest
including configuration file /etc/raddb/mods-enabled/replicate
including configuration file /etc/raddb/mods-enabled/exec
including configuration file /etc/raddb/mods-enabled/always
including configuration file /etc/raddb/mods-enabled/sradutmp
including configuration file /etc/raddb/mods-enabled/pap
including configuration file /etc/raddb/mods-enabled/chap
including configuration file /etc/raddb/mods-enabled/files
including configuration file /etc/raddb/mods-enabled/expiration
including configuration file /etc/raddb/mods-enabled/sql.conf
including configuration file /etc/raddb/mods-enabled/dynamic_clients
including configuration file /etc/raddb/mods-enabled/sql-wifi.conf
including configuration file /etc/raddb/mods-enabled/utf8
including configuration file /etc/raddb/mods-enabled/realm
including configuration file /etc/raddb/mods-enabled/mschap
including configuration file /etc/raddb/mods-enabled/dhcp
including configuration file /etc/raddb/mods-enabled/unpack
including configuration file /etc/raddb/mods-enabled/eap
including configuration file /etc/raddb/mods-enabled/linelog
including configuration file /etc/raddb/mods-enabled/passwd
including configuration file /etc/raddb/mods-enabled/cache_eap
including configuration file /etc/raddb/mods-enabled/detail
including configuration file /etc/raddb/mods-enabled/echo
including configuration file /etc/raddb/mods-enabled/preprocess
including configuration file /etc/raddb/mods-enabled/attr_filter
including configuration file /etc/raddb/mods-enabled/date
including configuration file /etc/raddb/mods-enabled/detail.log
including configuration file /etc/raddb/mods-enabled/soh
including files in directory /etc/raddb/policy.d/
including configuration file /etc/raddb/policy.d/cui
including configuration file /etc/raddb/policy.d/filter
including configuration file /etc/raddb/policy.d/moonshot-targeted-ids
including configuration file /etc/raddb/policy.d/control
including configuration file /etc/raddb/policy.d/debug
including configuration file /etc/raddb/policy.d/accounting
including configuration file /etc/raddb/policy.d/dhcp
including configuration file /etc/raddb/policy.d/eap
including configuration file /etc/raddb/policy.d/operator-name
including configuration file /etc/raddb/policy.d/abfab-tr
including configuration file /etc/raddb/policy.d/canonicalization
including files in directory /etc/raddb/sites-enabled/
including configuration file /etc/raddb/sites-enabled/office-vpn
including configuration file /etc/raddb/sites-enabled/default
including configuration file /etc/raddb/sites-enabled/vpn-test
including configuration file /etc/raddb/sites-enabled/inner-tunnel
main {
 security {
  allow_core_dumps = yes
 }
name = "radiusd"
prefix = "/usr"
localstatedir = "/var"
logdir = "/var/log/radius"
run_dir = "/var/run/radiusd"
}
Core dumps are enabled
main {
name = "radiusd"
prefix = "/usr"
localstatedir = "/var"
sbindir = "/usr/sbin"
logdir = "/var/log/radius"
run_dir = "/var/run/radiusd"
libdir = "/usr/lib64/freeradius"
radacctdir = "/var/log/radius/radacct"
panic_action = "gdb %e %p"
hostname_lookups = no
max_request_time = 30
cleanup_delay = 5
max_requests = 16384
pidfile = "/var/run/radiusd/radiusd.pid"
checkrad = "/usr/sbin/checkrad"
debug_level = 0
proxy_requests = yes
 log {
  stripped_names = no
  auth = yes
  auth_badpass = yes
  auth_goodpass = yes
  colourise = yes
  msg_denied = "You are already logged in - access denied"
 }
 resources {
 }
 security {
  max_attributes = 200
  reject_delay = 1.000000
  status_server = yes
  allow_vulnerable_openssl = "no"
 }
}
radiusd: #### Loading Realms and Home Servers ####
 proxy server {
  retry_delay = 5
  retry_count = 3
  default_fallback = yes
  dead_time = 120
  wake_all_if_all_dead = no
 }
 realm LOCAL {
authhost = LOCAL
accthost = LOCAL
 }
radiusd: #### Loading Clients ####
 client 192.168.0.2 {
  ipv4addr = 192.168.0.2
  require_message_authenticator = no
  secret = <<< secret >>>
  shortname = "EX6210"
  limit {
  max_connections = 16
  lifetime = 0
  idle_timeout = 30
  }
Debugger not attached
 # Creating Auth-Type = eap
 # Creating Auth-Type = PAP
 # Creating Auth-Type = CHAP
 # Creating Auth-Type = MS-CHAP
radiusd: #### Instantiating modules ####
 modules {
  # Loaded module rlm_exec
  # Loading module "ntlm_auth" from file /etc/raddb/mods-enabled/ntlm_auth
  exec ntlm_auth {
  wait = yes
  program = "/usr/bin/ntlm_auth --request-nt-key --domain=MYDOMAIN
--username=%{mschap:User-Name} --password=%{User-Password}"
  shell_escape = yes
  }
  # Loaded module rlm_unix
  # Loading module "unix" from file /etc/raddb/mods-enabled/unix
  unix {
  radwtmp = "/var/log/radius/radwtmp"
  }
Creating attribute Unix-Group
  # Loaded module rlm_radutmp
  # Loading module "radutmp" from file /etc/raddb/mods-enabled/radutmp
  radutmp {
  filename = "/var/log/radius/radutmp"
  username = "%{User-Name}"
  case_sensitive = yes
  check_with_nas = yes
  permissions = 384
  caller_id = yes
  }
  # Loaded module rlm_sql
  # Loading module "sql-ethernet" from file
/etc/raddb/mods-enabled/sql-ethernet
  sql sql-ethernet {
  driver = "rlm_sql_mysql"
  server = "127.0.0.1"
  port = 0
  login = "radius"
  password = <<< secret >>>
  radius_db = "vpn_wifi"
  read_groups = yes
  read_profiles = yes
  read_clients = no
  delete_stale_sessions = yes
  sql_user_name = "%{User-Name}"
  default_user_profile = ""
  client_query = "SELECT id,nasname,shortname,type,secret FROM nas"
  authorize_check_query = "SELECT wifi_id as id, username, 'MD5-Password'
as attribute, md5_hash, ':=' as  op FROM wifiusers WHERE username =
'%{SQL-User-Name}' ORDER BY id"
  authorize_reply_query = "SELECT id, UserName, Attribute, Value, op FROM
wifi_attrs WHERE username = '%{SQL-User-Name}' ORDER BY id"
  authorize_group_check_query = "SELECT wifi_id as id, 'Officewifi' as
GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op FROM wifiusers
          WHERE Username = '%{SQL-User-Name}'           ORDER BY id"
  authorize_group_reply_query = "SELECT wifi_id as id, 'Officewifi' as
GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op         FROM
wifiusers           WHERE Username = '%{SQL-User-Name}'           ORDER BY
id"
  group_membership_query = "SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='%{SQL-User-Name}'"
  simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName,
                       NASIPAddress, NASPortId, FramedIPAddress,
                     CallingStationId, FramedProtocol
         FROM wifiusers                                WHERE
UserName='%{SQL-User-Name}'                                AND AcctStopTime
= 0"
  safe_characters =
"@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
   accounting {
    reference = ".query"
    type {
     accounting-on {
     }
     accounting-off {
     }
     start {
     }
     interim-update {
     }
     stop {
     }
    }
   }
   post-auth {
    reference = ".query"
   }
  }
rlm_sql (sql-ethernet): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded
and linked
Creating attribute sql-ethernet-SQL-Group
  # Loaded module rlm_expr
  # Loading module "expr" from file /etc/raddb/mods-enabled/expr
  expr {
  safe_characters =
"@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_:
/äéöüàâæçèéêëîïôœùûüaÿÄÉÖÜßÀÂÆÇÈÉÊËÎÏÔŒÙÛÜŸ"
  }
  # Loaded module rlm_logintime
  # Loading module "logintime" from file /etc/raddb/mods-enabled/logintime
  logintime {
  minimum_timeout = 60
  }
  # Loaded module rlm_digest
  # Loading module "digest" from file /etc/raddb/mods-enabled/digest
  # Loaded module rlm_replicate
  # Loading module "replicate" from file /etc/raddb/mods-enabled/replicate
  # Loading module "exec" from file /etc/raddb/mods-enabled/exec
  exec {
  wait = no
  input_pairs = "request"
  shell_escape = yes
  timeout = 10
  }
  # Loaded module rlm_always
  # Loading module "reject" from file /etc/raddb/mods-enabled/always
  always reject {
  rcode = "reject"
  simulcount = 0
  mpp = no
  }
  # Loading module "fail" from file /etc/raddb/mods-enabled/always
  always fail {
  rcode = "fail"
  simulcount = 0
  mpp = no
  }
  # Loading module "ok" from file /etc/raddb/mods-enabled/always
  always ok {
  rcode = "ok"
  simulcount = 0
  mpp = no
  }
  # Loading module "handled" from file /etc/raddb/mods-enabled/always
  always handled {
  rcode = "handled"
  simulcount = 0
  mpp = no
  }
  # Loading module "invalid" from file /etc/raddb/mods-enabled/always
  always invalid {
  rcode = "invalid"
  simulcount = 0
  mpp = no
  }
  # Loading module "userlock" from file /etc/raddb/mods-enabled/always
  always userlock {
  rcode = "userlock"
  simulcount = 0
  mpp = no
  }
  # Loading module "notfound" from file /etc/raddb/mods-enabled/always
  always notfound {
  rcode = "notfound"
  simulcount = 0
  mpp = no
  }
  # Loading module "noop" from file /etc/raddb/mods-enabled/always
  always noop {
  rcode = "noop"
  simulcount = 0
  mpp = no
  }
  # Loading module "updated" from file /etc/raddb/mods-enabled/always
  always updated {
  rcode = "updated"
  simulcount = 0
  mpp = no
  }
  # Loading module "sradutmp" from file /etc/raddb/mods-enabled/sradutmp
  radutmp sradutmp {
  filename = "/var/log/radius/sradutmp"
  username = "%{User-Name}"
  case_sensitive = yes
  check_with_nas = yes
  permissions = 420
  caller_id = no
  }
  # Loaded module rlm_pap
  # Loading module "pap" from file /etc/raddb/mods-enabled/pap
  pap {
  normalise = yes
  }
  # Loaded module rlm_chap
  # Loading module "chap" from file /etc/raddb/mods-enabled/chap
  # Loaded module rlm_files
  # Loading module "files" from file /etc/raddb/mods-enabled/files
  files {
  filename = "/etc/raddb/mods-config/files/authorize"
  acctusersfile = "/etc/raddb/mods-config/files/accounting"
  preproxy_usersfile = "/etc/raddb/mods-config/files/pre-proxy"
  }
  # Loaded module rlm_expiration
  # Loading module "expiration" from file /etc/raddb/mods-enabled/expiration
  # Loading module "sql" from file /etc/raddb/mods-enabled/sql.conf
  sql sql {
  driver = "rlm_sql_mysql"
  server = "127.0.0.1"
  port = 0
  login = "radius"
  password = <<< secret >>>
  radius_db = "vpn_wifi"
  read_groups = yes
  read_profiles = yes
  read_clients = no
  delete_stale_sessions = yes
  sql_user_name = "%{User-Name}"
  default_user_profile = ""
  client_query = "SELECT id,nasname,shortname,type,secret FROM nas"
  authorize_check_query = "SELECT vpn_id as id, vpn_username as UserName,
'MD5-Password' as attribute, pass_hash as value, ':=' as op           FROM
vpnusers           WHERE (vpn_username = '%{SQL-User-Name}' AND msk='1')
        ORDER BY id"
  authorize_reply_query = "SELECT id, UserName, Attribute, Value, op
    FROM vpnacl           WHERE Username = '%{SQL-User-Name}'
ORDER BY id"
  authorize_group_check_query = "SELECT
radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupcheck.Value,radgroupcheck.op
 FROM radgroupcheck,vpnusergroup WHERE vpnusergroup.Username =
'%{SQL-User-Name}' AND vpnusergroup.GroupName = radgroupcheck.GroupName
ORDER BY radgroupcheck.id"
  authorize_group_reply_query = "SELECT
radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgroupreply.Value,radgroupreply.op
 FROM radgroupreply,vpnusergroup WHERE vpnusergroup.Username =
'%{SQL-User-Name}' AND vpnusergroup.GroupName = radgroupreply.GroupName
ORDER BY radgroupreply.id"
  group_membership_query = "SELECT GroupName FROM vpnusergroup WHERE
UserName='%{SQL-User-Name}'"
  simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName,
                       NASIPAddress, NASPortId, FramedIPAddress,
                     CallingStationId, FramedProtocol
         FROM vpnusers                                WHERE
UserName='%{SQL-User-Name}'                                AND AcctStopTime
= 0"
  safe_characters =
"@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
   accounting {
    reference = ".query"
    type {
     accounting-on {
     }
     accounting-off {
     }
     start {
     }
     interim-update {
     }
     stop {
     }
    }
   }
   post-auth {
    reference = ".query"
   }
  }
rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
Creating attribute sql-SQL-Group
  # Loaded module rlm_dynamic_clients
  # Loading module "dynamic_clients" from file
/etc/raddb/mods-enabled/dynamic_clients
  # Loading module "sql-wifi" from file
/etc/raddb/mods-enabled/sql-wifi.conf
  sql sql-wifi {
  driver = "rlm_sql_mysql"
  server = "127.0.0.1"
  port = 0
  login = "radius"
  password = <<< secret >>>
  radius_db = "vpn_wifi"
  read_groups = yes
  read_profiles = yes
  read_clients = no
  delete_stale_sessions = yes
  sql_user_name = "%{User-Name}"
  default_user_profile = ""
  client_query = "SELECT id,nasname,shortname,type,secret FROM nas"
  authorize_check_query = "SELECT wifi_id as id, username, 'NT-Password' as
attribute, pass_hash, ':=' as  op FROM wifiusers WHERE username =
'%{SQL-User-Name}' ORDER BY id"
  authorize_reply_query = "SELECT id, UserName, Attribute, Value, op FROM
wifi_attrs WHERE username = '%{SQL-User-Name}' ORDER BY id"
  authorize_group_check_query = "SELECT wifi_id as id, 'Officewifi' as
GroupName, 'NT-Password' as attribute, pass_hash, ':=' as op FROM wifiusers
          WHERE Username = '%{SQL-User-Name}'           ORDER BY id"
  authorize_group_reply_query = "SELECT wifi_id as id, 'Officewifi' as
GroupName, 'NT-Password' as attribute, pass_hash, ':=' as op         FROM
wifiusers           WHERE Username = '%{SQL-User-Name}'           ORDER BY
id"
  group_membership_query = "SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='%{SQL-User-Name}'"
  simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName,
                       NASIPAddress, NASPortId, FramedIPAddress,
                     CallingStationId, FramedProtocol
         FROM wifiusers                                WHERE
UserName='%{SQL-User-Name}'                                AND AcctStopTime
= 0"
  safe_characters =
"@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
   accounting {
    reference = ".query"
    type {
     accounting-on {
     }
     accounting-off {
     }
     start {
     }
     interim-update {
     }
     stop {
     }
    }
   }
   post-auth {
    reference = ".query"
   }
  }
rlm_sql (sql-wifi): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and
linked
Creating attribute sql-wifi-SQL-Group
  # Loaded module rlm_utf8
  # Loading module "utf8" from file /etc/raddb/mods-enabled/utf8
  # Loaded module rlm_realm
  # Loading module "IPASS" from file /etc/raddb/mods-enabled/realm
  realm IPASS {
  format = "prefix"
  delimiter = "/"
  ignore_default = no
  ignore_null = no
  }
  # Loading module "suffix" from file /etc/raddb/mods-enabled/realm
  realm suffix {
  format = "suffix"
  delimiter = "@"
  ignore_default = no
  ignore_null = no
  }
  # Loading module "realmpercent" from file /etc/raddb/mods-enabled/realm
  realm realmpercent {
  format = "suffix"
  delimiter = "%"
  ignore_default = no
  ignore_null = no
  }
  # Loading module "ntdomain" from file /etc/raddb/mods-enabled/realm
  realm ntdomain {
  format = "prefix"
  delimiter = "\\"
  ignore_default = no
  ignore_null = no
  }
  # Loaded module rlm_mschap
  # Loading module "mschap" from file /etc/raddb/mods-enabled/mschap
  mschap {
  use_mppe = yes
  require_encryption = no
  require_strong = no
  with_ntdomain_hack = yes
   passchange {
   }
  allow_retry = yes
  winbind_retry_with_normalised_username = no
  }
  # Loaded module rlm_dhcp
  # Loading module "dhcp" from file /etc/raddb/mods-enabled/dhcp
  # Loaded module rlm_unpack
  # Loading module "unpack" from file /etc/raddb/mods-enabled/unpack
  # Loaded module rlm_eap
  # Loading module "eap" from file /etc/raddb/mods-enabled/eap
  eap {
  default_eap_type = "md5"
  timer_expire = 60
  ignore_unknown_eap_types = no
  cisco_accounting_username_bug = yes
  max_sessions = 16384
  }
  # Loaded module rlm_linelog
  # Loading module "linelog" from file /etc/raddb/mods-enabled/linelog
  linelog {
  filename = "/var/log/radius/linelog"
  escape_filenames = no
  syslog_severity = "info"
  permissions = 384
  format = "This is a log message for %{User-Name}"
  reference = "messages.%{%{reply:Packet-Type}:-default}"
  }
  # Loading module "log_accounting" from file
/etc/raddb/mods-enabled/linelog
  linelog log_accounting {
  filename = "/var/log/radius/linelog-accounting"
  escape_filenames = no
  syslog_severity = "info"
  permissions = 384
  format = ""
  reference = "Accounting-Request.%{%{Acct-Status-Type}:-unknown}"
  }
  # Loaded module rlm_passwd
  # Loading module "etc_passwd" from file /etc/raddb/mods-enabled/passwd
  passwd etc_passwd {
  filename = "/etc/passwd"
  format = "*User-Name:Crypt-Password:"
  delimiter = ":"
  ignore_nislike = no
  ignore_empty = yes
  allow_multiple_keys = no
  hash_size = 100
  }
  # Loaded module rlm_cache
  # Loading module "cache_eap" from file /etc/raddb/mods-enabled/cache_eap
  cache cache_eap {
  driver = "rlm_cache_rbtree"
  key = "%{%{control:State}:-%{%{reply:State}:-%{State}}}"
  ttl = 15
  max_entries = 0
  epoch = 0
  add_stats = no
  }
  # Loaded module rlm_detail
  # Loading module "detail" from file /etc/raddb/mods-enabled/detail
  detail {
  filename =
"/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d"
  header = "%t"
  permissions = 384
  locking = no
  escape_filenames = no
  log_packet_header = no
  }
  # Loading module "echo" from file /etc/raddb/mods-enabled/echo
  exec echo {
  wait = yes
  program = "/bin/echo %{User-Name}"
  input_pairs = "request"
  output_pairs = "reply"
  shell_escape = yes
  }
  # Loaded module rlm_preprocess
  # Loading module "preprocess" from file /etc/raddb/mods-enabled/preprocess
  preprocess {
  huntgroups = "/etc/raddb/mods-config/preprocess/huntgroups"
  hints = "/etc/raddb/mods-config/preprocess/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
  }
  # Loaded module rlm_attr_filter
  # Loading module "attr_filter.post-proxy" from file
/etc/raddb/mods-enabled/attr_filter
  attr_filter attr_filter.post-proxy {
  filename = "/etc/raddb/mods-config/attr_filter/post-proxy"
  key = "%{Realm}"
  relaxed = no
  }
  # Loading module "attr_filter.pre-proxy" from file
/etc/raddb/mods-enabled/attr_filter
  attr_filter attr_filter.pre-proxy {
  filename = "/etc/raddb/mods-config/attr_filter/pre-proxy"
  key = "%{Realm}"
  relaxed = no
  }
  # Loading module "attr_filter.access_reject" from file
/etc/raddb/mods-enabled/attr_filter
  attr_filter attr_filter.access_reject {
  filename = "/etc/raddb/mods-config/attr_filter/access_reject"
  key = "%{User-Name}"
  relaxed = no
  }
  # Loading module "attr_filter.access_challenge" from file
/etc/raddb/mods-enabled/attr_filter
  attr_filter attr_filter.access_challenge {
  filename = "/etc/raddb/mods-config/attr_filter/access_challenge"
  key = "%{User-Name}"
  relaxed = no
  }
  # Loading module "attr_filter.accounting_response" from file
/etc/raddb/mods-enabled/attr_filter
  attr_filter attr_filter.accounting_response {
  filename = "/etc/raddb/mods-config/attr_filter/accounting_response"
  key = "%{User-Name}"
  relaxed = no
  }
  # Loaded module rlm_date
  # Loading module "date" from file /etc/raddb/mods-enabled/date
  date {
  format = "%b %e %Y %H:%M:%S %Z"
  utc = no
  }
  # Loading module "auth_log" from file /etc/raddb/mods-enabled/detail.log
  detail auth_log {
  filename =
"/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/auth-detail-%Y%m%d"
  header = "%t"
  permissions = 384
  locking = no
  escape_filenames = no
  log_packet_header = no
  }
  # Loading module "reply_log" from file /etc/raddb/mods-enabled/detail.log
  detail reply_log {
  filename =
"/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/reply-detail-%Y%m%d"
  header = "%t"
  permissions = 384
  locking = no
  escape_filenames = no
  log_packet_header = no
  }
  # Loading module "pre_proxy_log" from file
/etc/raddb/mods-enabled/detail.log
  detail pre_proxy_log {
  filename =
"/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/pre-proxy-detail-%Y%m%d"
  header = "%t"
  permissions = 384
  locking = no
  escape_filenames = no
  log_packet_header = no
  }
  # Loading module "post_proxy_log" from file
/etc/raddb/mods-enabled/detail.log
  detail post_proxy_log {
  filename =
"/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/post-proxy-detail-%Y%m%d"
  header = "%t"
  permissions = 384
  locking = no
  escape_filenames = no
  log_packet_header = no
  }
  # Loaded module rlm_soh
  # Loading module "soh" from file /etc/raddb/mods-enabled/soh
  soh {
  dhcp = yes
  }
  instantiate {
  }
  # Instantiating module "sql-ethernet" from file
/etc/raddb/mods-enabled/sql-ethernet
rlm_sql_mysql: libmysql version: 10.0.34-MariaDB
   mysql {
    tls {
    }
    warnings = "auto"
   }
rlm_sql (sql-ethernet): Attempting to connect to database "vpn_wifi"
rlm_sql (sql-ethernet): Initialising connection pool
   pool {
    start = 5
    min = 5
    max = 10
    spare = 3
    uses = 0
    lifetime = 0
    cleanup_interval = 30
    idle_timeout = 60
    retry_delay = 1
    spread = no
   }
rlm_sql (sql-ethernet): Opening additional connection (0), 1 of 10 pending
slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql-ethernet): Opening additional connection (1), 1 of 9 pending
slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql-ethernet): Opening additional connection (2), 1 of 8 pending
slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql-ethernet): Opening additional connection (3), 1 of 7 pending
slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql-ethernet): Opening additional connection (4), 1 of 6 pending
slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
  # Instantiating module "logintime" from file
/etc/raddb/mods-enabled/logintime
  # Instantiating module "reject" from file /etc/raddb/mods-enabled/always
  # Instantiating module "fail" from file /etc/raddb/mods-enabled/always
  # Instantiating module "ok" from file /etc/raddb/mods-enabled/always
  # Instantiating module "handled" from file /etc/raddb/mods-enabled/always
  # Instantiating module "invalid" from file /etc/raddb/mods-enabled/always
  # Instantiating module "userlock" from file /etc/raddb/mods-enabled/always
  # Instantiating module "notfound" from file /etc/raddb/mods-enabled/always
  # Instantiating module "noop" from file /etc/raddb/mods-enabled/always
  # Instantiating module "updated" from file /etc/raddb/mods-enabled/always
  # Instantiating module "pap" from file /etc/raddb/mods-enabled/pap
  # Instantiating module "files" from file /etc/raddb/mods-enabled/files
reading pairlist file /etc/raddb/mods-config/files/authorize
reading pairlist file /etc/raddb/mods-config/files/accounting
reading pairlist file /etc/raddb/mods-config/files/pre-proxy
  # Instantiating module "expiration" from file
/etc/raddb/mods-enabled/expiration
  # Instantiating module "sql" from file /etc/raddb/mods-enabled/sql.conf
   mysql {
    tls {
    }
    warnings = "auto"
   }
rlm_sql (sql): Attempting to connect to database "vpn_wifi"
rlm_sql (sql): Initialising connection pool
   pool {
    start = 5
    min = 5
    max = 10
    spare = 3
    uses = 0
    lifetime = 0
    cleanup_interval = 30
    idle_timeout = 60
    retry_delay = 1
    spread = no
   }
rlm_sql (sql): Opening additional connection (0), 1 of 10 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql): Opening additional connection (1), 1 of 9 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql): Opening additional connection (2), 1 of 8 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql): Opening additional connection (3), 1 of 7 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql): Opening additional connection (4), 1 of 6 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
  # Instantiating module "sql-wifi" from file
/etc/raddb/mods-enabled/sql-wifi.conf
   mysql {
    tls {
    }
    warnings = "auto"
   }
rlm_sql (sql-wifi): Attempting to connect to database "vpn_wifi"
rlm_sql (sql-wifi): Initialising connection pool
   pool {
    start = 5
    min = 5
    max = 10
    spare = 3
    uses = 0
    lifetime = 0
    cleanup_interval = 30
    idle_timeout = 60
    retry_delay = 1
    spread = no
   }
rlm_sql (sql-wifi): Opening additional connection (0), 1 of 10 pending
slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql-wifi): Opening additional connection (1), 1 of 9 pending slots
used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql-wifi): Opening additional connection (2), 1 of 8 pending slots
used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql-wifi): Opening additional connection (3), 1 of 7 pending slots
used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
rlm_sql (sql-wifi): Opening additional connection (4), 1 of 6 pending slots
used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'vpn_wifi' on 127.0.0.1 via TCP/IP,
server version 5.7.19-17-log, protocol version 10
  # Instantiating module "IPASS" from file /etc/raddb/mods-enabled/realm
  # Instantiating module "suffix" from file /etc/raddb/mods-enabled/realm
  # Instantiating module "realmpercent" from file
/etc/raddb/mods-enabled/realm
  # Instantiating module "ntdomain" from file /etc/raddb/mods-enabled/realm
  # Instantiating module "mschap" from file /etc/raddb/mods-enabled/mschap
rlm_mschap (mschap): using internal authentication
  # Instantiating module "eap" from file /etc/raddb/mods-enabled/eap
   # Linked to sub-module rlm_eap_md5
   # Linked to sub-module rlm_eap_leap
   # Linked to sub-module rlm_eap_gtc
   gtc {
    challenge = "Password: "
    auth_type = "PAP"
   }
   # Linked to sub-module rlm_eap_mschapv2
   mschapv2 {
    with_ntdomain_hack = no
    send_error = no
   }
   # Linked to sub-module rlm_eap_tls
   tls {
    tls = "tls-common"
   }
   tls-config tls-common {
    verify_depth = 0
    pem_file_type = yes
    private_key_file = "/etc/raddb/certs/wifi-pk.pem"
    certificate_file = "/etc/raddb/certs/wifi-pk.pem"
    ca_file = "/etc/raddb/certs/cacert.pem"
    private_key_password = <<< secret >>>
    dh_file = "/etc/raddb/certs/dh_2048"
    random_file = "/dev/urandom"
    fragment_size = 1024
    include_length = yes
    auto_chain = yes
    check_crl = no
    check_all_crl = no
    ecdh_curve = "prime256v1"
    tls_max_version = ""
    tls_min_version = "1.0"
    cache {
    enable = yes
    lifetime = 24
    name = "EAP module"
    max_entries = 255
    }
    verify {
    skip_if_ocsp_ok = no
    }
    ocsp {
    enable = no
    override_cert_url = yes
    url = "http://127.0.0.1/ocsp/"
    use_nonce = yes
    timeout = 0
    softfail = no
    }
   }
   # Linked to sub-module rlm_eap_ttls
   ttls {
    tls = "tls-common"
    default_eap_type = "md5"
    copy_request_to_tunnel = yes
    use_tunneled_reply = yes
    virtual_server = "inner-tunnel"
    include_length = yes
    require_client_cert = no
   }
tls: Using cached TLS configuration from previous invocation
   # Linked to sub-module rlm_eap_peap
   peap {
    tls = "tls-common"
    default_eap_type = "mschapv2"
    copy_request_to_tunnel = no
    use_tunneled_reply = no
    proxy_tunneled_request_as_eap = yes
    virtual_server = "default"
    soh = no
    require_client_cert = no
   }
tls: Using cached TLS configuration from previous invocation
   # Linked to sub-module rlm_eap_mschapv2
   mschapv2 {
    with_ntdomain_hack = no
    send_error = no
   }
  # Instantiating module "linelog" from file /etc/raddb/mods-enabled/linelog
  # Instantiating module "log_accounting" from file
/etc/raddb/mods-enabled/linelog
  # Instantiating module "etc_passwd" from file
/etc/raddb/mods-enabled/passwd
rlm_passwd: nfields: 3 keyfield 0(User-Name) listable: no
  # Instantiating module "cache_eap" from file
/etc/raddb/mods-enabled/cache_eap
rlm_cache (cache_eap): Driver rlm_cache_rbtree (module rlm_cache_rbtree)
loaded and linked
  # Instantiating module "detail" from file /etc/raddb/mods-enabled/detail
  # Instantiating module "preprocess" from file
/etc/raddb/mods-enabled/preprocess
reading pairlist file /etc/raddb/mods-config/preprocess/huntgroups
reading pairlist file /etc/raddb/mods-config/preprocess/hints
  # Instantiating module "attr_filter.post-proxy" from file
/etc/raddb/mods-enabled/attr_filter
reading pairlist file /etc/raddb/mods-config/attr_filter/post-proxy
  # Instantiating module "attr_filter.pre-proxy" from file
/etc/raddb/mods-enabled/attr_filter
reading pairlist file /etc/raddb/mods-config/attr_filter/pre-proxy
  # Instantiating module "attr_filter.access_reject" from file
/etc/raddb/mods-enabled/attr_filter
reading pairlist file /etc/raddb/mods-config/attr_filter/access_reject
  # Instantiating module "attr_filter.access_challenge" from file
/etc/raddb/mods-enabled/attr_filter
reading pairlist file /etc/raddb/mods-config/attr_filter/access_challenge
  # Instantiating module "attr_filter.accounting_response" from file
/etc/raddb/mods-enabled/attr_filter
reading pairlist file /etc/raddb/mods-config/attr_filter/accounting_response
  # Instantiating module "auth_log" from file
/etc/raddb/mods-enabled/detail.log
rlm_detail (auth_log): 'User-Password' suppressed, will not appear in
detail output
  # Instantiating module "reply_log" from file
/etc/raddb/mods-enabled/detail.log
  # Instantiating module "pre_proxy_log" from file
/etc/raddb/mods-enabled/detail.log
  # Instantiating module "post_proxy_log" from file
/etc/raddb/mods-enabled/detail.log
 } # modules
radiusd: #### Loading Virtual Servers ####
server { # from file /etc/raddb/radiusd.conf
} # server
server msk-vpn { # from file /etc/raddb/sites-enabled/office-vpn
 # Loading authenticate {...}
 # Loading authorize {...}
 # Loading preacct {...}
 # Loading accounting {...}
 # Loading session {...}
 # Loading post-proxy {...}
 # Loading post-auth {...}
} # server msk-vpn
server default { # from file /etc/raddb/sites-enabled/default
 # Loading authenticate {...}
 # Loading authorize {...}
 # Loading preacct {...}
 # Loading accounting {...}
 # Loading session {...}
 # Loading post-proxy {...}
} # server default
server vpn-test { # from file /etc/raddb/sites-enabled/vpn-test
 # Loading authenticate {...}
 # Loading authorize {...}
 # Loading preacct {...}
 # Loading accounting {...}
 # Loading session {...}
 # Loading post-proxy {...}
 # Loading post-auth {...}
} # server vpn-test
server inner-tunnel { # from file /etc/raddb/sites-enabled/inner-tunnel
 # Loading authenticate {...}
 # Loading authorize {...}
 # Loading session {...}
 # Loading post-proxy {...}
 # Loading post-auth {...}
} # server inner-tunnel
radiusd: #### Opening IP addresses and Ports ####
listen {
  type = "auth"
  ipaddr = *
  port = 0
}
listen {
  type = "acct"
  ipaddr = *
  port = 0
   limit {
    max_connections = 16
    lifetime = 0
    idle_timeout = 30
   }
}
Listening on auth address * port 1812 bound to server default
Listening on acct address * port 1813 bound to server default

# cat default
server default {
listen {
type = auth
ipaddr = *
}
listen {
ipaddr = *
port = 0
type = acct
limit {
}
}
authorize {
preprocess

chap
mschap
suffix
eap {
ok = return
}
sql-ethernet
pap
}
authenticate {
Auth-Type PAP {
pap
}
Auth-Type CHAP {
chap
}
Auth-Type MS-CHAP {
mschap
}
eap
}
preacct {
preprocess
acct_unique
suffix
files
}
accounting {
detail
radutmp
}
session {
radutmp
}
post-auth {
}
pre-proxy {
}
post-proxy {
eap
}
}

server inner-tunnel {
authorize {
        preprocess

chap
mschap
suffix
update control {
       Proxy-To-Realm := LOCAL
}
eap {
ok = return
}
        sql-ethernet
files
expiration
logintime
pap
}
authenticate {
Auth-Type PAP {
pap
}
Auth-Type CHAP {
chap
}
Auth-Type MS-CHAP {
mschap
}
eap
}
session {
radutmp
}
post-auth {
Post-Auth-Type REJECT {
attr_filter.access_reject
}
}
pre-proxy {
}
post-proxy {
eap
}
}


(283) Received Access-Request Id 86 from 192.168.0.2:50542 to
192.168.0.1:1812 length 163
(283)   User-Name = "username"
(283)   NAS-Port = 371
(283)   EAP-Message = 0x020000090174766264
(283)   Message-Authenticator = 0xf29ec21696014501bbf787df82d04c66
(283)   Acct-Session-Id = "8O2.1x811d9e92000679a2"
(283)   NAS-Port-Id = "ge-9/0/21.0"
(283)   Calling-Station-Id = "94-c6-91-17-01-2f"
(283)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(283)   NAS-IP-Address = 192.168.0.2
(283)   NAS-Identifier = "sw-ex6210"
(283)   NAS-Port-Type = Ethernet
(283) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(283)   authorize {
(283)     [preprocess] = ok
(283)     [chap] = noop
(283)     [mschap] = noop
(283) suffix: Checking for suffix after "@"
(283) suffix: No '@' in User-Name = "username", looking up realm NULL
(283) suffix: No such realm "NULL"
(283)     [suffix] = noop
(283) eap: Peer sent EAP Response (code 2) ID 0 length 9
(283) eap: EAP-Identity reply, returning 'ok' so we can short-circuit the
rest of authorize
(283)     [eap] = ok
(283)   } # authorize = ok
(283) Found Auth-Type = eap
(283) # Executing group from file /etc/raddb/sites-enabled/default
(283)   authenticate {
(283) eap: Peer sent packet with method EAP Identity (1)
(283) eap: Calling submodule eap_md5 to process data
(283) eap_md5: Issuing MD5 Challenge
(283) eap: Sending EAP Request (code 1) ID 1 length 22
(283) eap: EAP session adding &reply:State = 0x37a1d54d37a0d1f3
(283)     [eap] = handled
(283)   } # authenticate = handled
(283) Using Post-Auth-Type Challenge
(283) Post-Auth-Type sub-section not found.  Ignoring.
(283) Sent Access-Challenge Id 86 from 192.168.0.1:1812 to 192.168.0.2:50542
length 0
(283)   EAP-Message = 0x01010016041013d5e99f42771f09c9fdf65863180f8d
(283)   Message-Authenticator = 0x00000000000000000000000000000000
(283)   State = 0x37a1d54d37a0d1f3254ca9eee8b76bbc
(283) Finished request
Waking up in 0.1 seconds.
(284) Received Access-Request Id 79 from 192.168.0.2:50542 to
192.168.0.1:1812 length 178
(284)   User-Name = "username"
(284)   NAS-Port = 371
(284)   State = 0x37a1d54d37a0d1f3254ca9eee8b76bbc
(284)   EAP-Message = 0x020100060319
(284)   Message-Authenticator = 0x343153c013c830e55f807c3e1679bbd7
(284)   Acct-Session-Id = "8O2.1x811d9e92000679a2"
(284)   NAS-Port-Id = "ge-9/0/21.0"
(284)   Calling-Station-Id = "94-c6-91-17-01-2f"
(284)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(284)   NAS-IP-Address = 192.168.0.2
(284)   NAS-Identifier = "sw-ex6210"
(284)   NAS-Port-Type = Ethernet
(284) session-state: No cached attributes
(284) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(284)   authorize {
(284)     [preprocess] = ok
(284)     [chap] = noop
(284)     [mschap] = noop
(284) suffix: Checking for suffix after "@"
(284) suffix: No '@' in User-Name = "username", looking up realm NULL
(284) suffix: No such realm "NULL"
(284)     [suffix] = noop
(284) eap: Peer sent EAP Response (code 2) ID 1 length 6
(284) eap: No EAP Start, assuming it's an on-going EAP conversation
(284)     [eap] = updated
(284) sql-wifi: EXPAND %{User-Name}
(284) sql-wifi:    --> username
(284) sql-wifi: SQL-User-Name set to 'username'
rlm_sql (sql-wifi): Reserved connection (4)
(284) sql-wifi: EXPAND SELECT wifi_id as id, username, 'MD5-Password' as
attribute, md5_hash, ':=' as  op FROM wifiusers WHERE username =
'%{SQL-User-Name}' ORDER BY id
(284) sql-wifi:    --> SELECT wifi_id as id, username, 'MD5-Password' as
attribute, md5_hash, ':=' as  op FROM wifiusers WHERE username = 'username'
ORDER BY id
(284) sql-wifi: Executing select query: SELECT wifi_id as id, username,
'MD5-Password' as attribute, md5_hash, ':=' as  op FROM wifiusers WHERE
username = 'username' ORDER BY id
(284) sql-wifi: User found in radcheck table
(284) sql-wifi: Conditional check items matched, merging assignment check
items
(284) sql-wifi:   MD5-Password := 0x06d9ded822ff50138cda74ee2e771082
(284) sql-wifi: EXPAND SELECT id, UserName, Attribute, Value, op FROM
wifi_attrs WHERE username = '%{SQL-User-Name}' ORDER BY id
(284) sql-wifi:    --> SELECT id, UserName, Attribute, Value, op FROM
wifi_attrs WHERE username = 'username' ORDER BY id
(284) sql-wifi: Executing select query: SELECT id, UserName, Attribute,
Value, op FROM wifi_attrs WHERE username = 'username' ORDER BY id
(284) sql-wifi: EXPAND SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='%{SQL-User-Name}'
(284) sql-wifi:    --> SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='username'
(284) sql-wifi: Executing select query: SELECT 'Officewifi' as GroupName
FROM wifiusers WHERE UserName='username'
(284) sql-wifi: User found in the group table
(284) sql-wifi: EXPAND SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op FROM wifiusers
WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(284) sql-wifi:    --> SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op FROM wifiusers
WHERE Username = 'username'           ORDER BY id
(284) sql-wifi: Executing select query: SELECT wifi_id as id, 'Officewifi'
as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op FROM
wifiusers           WHERE Username = 'username'           ORDER BY id
(284) sql-wifi: Group "Officewifi": Conditional check items matched
(284) sql-wifi: Group "Officewifi": Merging assignment check items
(284) sql-wifi:   MD5-Password := 0x06d9ded822ff50138cda74ee2e771082
(284) sql-wifi: EXPAND SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op         FROM wifiusers
        WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(284) sql-wifi:    --> SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op         FROM wifiusers
        WHERE Username = 'username'           ORDER BY id
(284) sql-wifi: Executing select query: SELECT wifi_id as id, 'Officewifi'
as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op
FROM wifiusers           WHERE Username = 'username'           ORDER BY id
(284) sql-wifi: Group "Officewifi": Merging reply items
(284) sql-wifi:   MD5-Password := 0x06d9ded822ff50138cda74ee2e771082
rlm_sql (sql-wifi): Released connection (4)
(284)     [sql-wifi] = ok
(284) pap: WARNING: Auth-Type already set.  Not setting to PAP
(284)     [pap] = noop
(284)   } # authorize = updated
(284) Found Auth-Type = eap
(284) # Executing group from file /etc/raddb/sites-enabled/default
(284)   authenticate {
(284) eap: Expiring EAP session with state 0x37a1d54d37a0d1f3
(284) eap: Finished EAP session with state 0x37a1d54d37a0d1f3
(284) eap: Previous EAP request found for state 0x37a1d54d37a0d1f3,
released from the list
(284) eap: Peer sent packet with method EAP NAK (3)
(284) eap: Found mutually acceptable type PEAP (25)
(284) eap: Calling submodule eap_peap to process data
(284) eap_peap: Initiating new EAP-TLS session
(284) eap_peap: [eaptls start] = request
(284) eap: Sending EAP Request (code 1) ID 2 length 6
(284) eap: EAP session adding &reply:State = 0x37a1d54d36a3ccf3
(284)     [eap] = handled
(284)   } # authenticate = handled
(284) Using Post-Auth-Type Challenge
(284) Post-Auth-Type sub-section not found.  Ignoring.
(284) Sent Access-Challenge Id 79 from 192.168.0.1:1812 to 192.168.0.2:50542
length 0
(284)   EAP-Message = 0x010200061920
(284)   Message-Authenticator = 0x00000000000000000000000000000000
(284)   State = 0x37a1d54d36a3ccf3254ca9eee8b76bbc
(284) Finished request
Waking up in 0.1 seconds.
(285) Received Access-Request Id 67 from 192.168.0.2:50542 to
192.168.0.1:1812 length 517
(285)   User-Name = "username"
(285)   NAS-Port = 371
(285)   State = 0x37a1d54d36a3ccf3254ca9eee8b76bbc
(285)   EAP-Message =
0x0202015719800000014d16030101480100014403031184d8b374ef0c7060528fd2d29503285c25f5b1c63762dbefcbbb5978e59564203077f0831005a22762d737a3345a272e505c5b3dc79dc350af80d194bd6bfbc700aac030c02cc028c024c014c00a00a500a300a1009f006b006a00690068003900
(285)   Message-Authenticator = 0xb333f1edf67d1cc3cdbe3e1d12cf57e3
(285)   Acct-Session-Id = "8O2.1x811d9e92000679a2"
(285)   NAS-Port-Id = "ge-9/0/21.0"
(285)   Calling-Station-Id = "94-c6-91-17-01-2f"
(285)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(285)   NAS-IP-Address = 192.168.0.2
(285)   NAS-Identifier = "sw-ex6210"
(285)   NAS-Port-Type = Ethernet
(285) session-state: No cached attributes
(285) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(285)   authorize {
(285)     [preprocess] = ok
(285)     [chap] = noop
(285)     [mschap] = noop
(285) suffix: Checking for suffix after "@"
(285) suffix: No '@' in User-Name = "username", looking up realm NULL
(285) suffix: No such realm "NULL"
(285)     [suffix] = noop
(285) eap: Peer sent EAP Response (code 2) ID 2 length 343
(285) eap: Continuing tunnel setup
(285)     [eap] = ok
(285)   } # authorize = ok
(285) Found Auth-Type = eap
(285) # Executing group from file /etc/raddb/sites-enabled/default
(285)   authenticate {
(285) eap: Expiring EAP session with state 0x37a1d54d36a3ccf3
(285) eap: Finished EAP session with state 0x37a1d54d36a3ccf3
(285) eap: Previous EAP request found for state 0x37a1d54d36a3ccf3,
released from the list
(285) eap: Peer sent packet with method EAP PEAP (25)
(285) eap: Calling submodule eap_peap to process data
(285) eap_peap: Continuing EAP-TLS
(285) eap_peap: Peer indicated complete TLS record size will be 333 bytes
(285) eap_peap: Got complete TLS record (333 bytes)
(285) eap_peap: [eaptls verify] = length included
(285) eap_peap: (other): before/accept initialization
(285) eap_peap: TLS_accept: before/accept initialization
(285) eap_peap: <<< recv TLS 1.2  [length 0148]
(285) eap_peap: TLS_accept: SSLv3 read client hello A
(285) eap_peap: >>> send TLS 1.2  [length 005e]
(285) eap_peap: TLS_accept: SSLv3 write server hello A
(285) eap_peap: >>> send TLS 1.2  [length 0320]
(285) eap_peap: TLS_accept: SSLv3 write certificate A
(285) eap_peap: >>> send TLS 1.2  [length 014d]
(285) eap_peap: TLS_accept: SSLv3 write key exchange A
(285) eap_peap: >>> send TLS 1.2  [length 0004]
(285) eap_peap: TLS_accept: SSLv3 write server done A
(285) eap_peap: TLS_accept: SSLv3 flush data
(285) eap_peap: TLS_accept: SSLv3 read client certificate A
(285) eap_peap: TLS_accept: Need to read more data: SSLv3 read client key
exchange A
(285) eap_peap: TLS_accept: Need to read more data: SSLv3 read client key
exchange A
(285) eap_peap: In SSL Handshake Phase
(285) eap_peap: In SSL Accept mode
(285) eap_peap: [eaptls process] = handled
(285) eap: Sending EAP Request (code 1) ID 3 length 1004
(285) eap: EAP session adding &reply:State = 0x37a1d54d35a2ccf3
(285)     [eap] = handled
(285)   } # authenticate = handled
(285) Using Post-Auth-Type Challenge
(285) Post-Auth-Type sub-section not found.  Ignoring.
(285) Sent Access-Challenge Id 67 from 192.168.0.1:1812 to 192.168.0.2:50542
length 0
(285)   EAP-Message =
0x010303ec19c0000004e3160303005e0200005a030321aad0c08904171bab35ad216fec45b016580bf1c3ad89db14a5d24d8d6c948320e83e221ecd961bef05c2601d676550ca54478e079b5a8b05409cb35b0bea41f0c030000012ff01000100000b000403000102000f00010116030303200b00031c00
(285)   Message-Authenticator = 0x00000000000000000000000000000000
(285)   State = 0x37a1d54d35a2ccf3254ca9eee8b76bbc
(285) Finished request
Waking up in 0.1 seconds.
(286) Received Access-Request Id 106 from 192.168.0.2:50542 to
192.168.0.1:1812 length 178
(286)   User-Name = "username"
(286)   NAS-Port = 371
(286)   State = 0x37a1d54d35a2ccf3254ca9eee8b76bbc
(286)   EAP-Message = 0x020300061900
(286)   Message-Authenticator = 0x7f4ef0913ef212ec7d65b41c7e151aca
(286)   Acct-Session-Id = "8O2.1x811d9e92000679a2"
(286)   NAS-Port-Id = "ge-9/0/21.0"
(286)   Calling-Station-Id = "94-c6-91-17-01-2f"
(286)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(286)   NAS-IP-Address = 192.168.0.2
(286)   NAS-Identifier = "sw-ex6210"
(286)   NAS-Port-Type = Ethernet
(286) session-state: No cached attributes
(286) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(286)   authorize {
(286)     [preprocess] = ok
(286)     [chap] = noop
(286)     [mschap] = noop
(286) suffix: Checking for suffix after "@"
(286) suffix: No '@' in User-Name = "username", looking up realm NULL
(286) suffix: No such realm "NULL"
(286)     [suffix] = noop
(286) eap: Peer sent EAP Response (code 2) ID 3 length 6
(286) eap: Continuing tunnel setup
(286)     [eap] = ok
(286)   } # authorize = ok
(286) Found Auth-Type = eap
(286) # Executing group from file /etc/raddb/sites-enabled/default
(286)   authenticate {
(286) eap: Expiring EAP session with state 0x37a1d54d35a2ccf3
(286) eap: Finished EAP session with state 0x37a1d54d35a2ccf3
(286) eap: Previous EAP request found for state 0x37a1d54d35a2ccf3,
released from the list
(286) eap: Peer sent packet with method EAP PEAP (25)
(286) eap: Calling submodule eap_peap to process data
(286) eap_peap: Continuing EAP-TLS
(286) eap_peap: Peer ACKed our handshake fragment
(286) eap_peap: [eaptls verify] = request
(286) eap_peap: [eaptls process] = handled
(286) eap: Sending EAP Request (code 1) ID 4 length 263
(286) eap: EAP session adding &reply:State = 0x37a1d54d34a5ccf3
(286)     [eap] = handled
(286)   } # authenticate = handled
(286) Using Post-Auth-Type Challenge
(286) Post-Auth-Type sub-section not found.  Ignoring.
(286) Sent Access-Challenge Id 106 from 192.168.0.1:1812 to
192.168.0.2:50542 length 0
(286)   EAP-Message =
0x010401071900eb2e2f1c3dae5602765bdc9917211a751e06ca33708bc5b6d92f42e6a86ee2de884bb6ce7a56639a890cef3012c70621f0909bdaff5582832bb5423e78306f15adc2ec561e1b7436af0fc46d28911964e6a4361bb0f2eec6bb1d800eaaab5374635c3b9b42d1ce7a3d9f19177501ec39f2
(286)   Message-Authenticator = 0x00000000000000000000000000000000
(286)   State = 0x37a1d54d34a5ccf3254ca9eee8b76bbc
(286) Finished request
Waking up in 0.1 seconds.
(287) Received Access-Request Id 92 from 192.168.0.2:50542 to
192.168.0.1:1812 length 308
(287)   User-Name = "username"
(287)   NAS-Port = 371
(287)   State = 0x37a1d54d34a5ccf3254ca9eee8b76bbc
(287)   EAP-Message =
0x0204008819800000007e1603030046100000424104db118880dd65e08dcf900006169aa31a784a8af11e18be19f872beaadb2c0ccc2e130dab15ce0348fe54f0cfa9ccdad323368f82741c2a7cce9fa47e7ceb057914030300010116030300283287125d9a9eaa68398c0e4858768b88b65eb46799a1ec
(287)   Message-Authenticator = 0xe90f8ef5727de26ac0f012499e29f3fd
(287)   Acct-Session-Id = "8O2.1x811d9e92000679a2"
(287)   NAS-Port-Id = "ge-9/0/21.0"
(287)   Calling-Station-Id = "94-c6-91-17-01-2f"
(287)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(287)   NAS-IP-Address = 192.168.0.2
(287)   NAS-Identifier = "sw-ex6210"
(287)   NAS-Port-Type = Ethernet
(287) session-state: No cached attributes
(287) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(287)   authorize {
(287)     [preprocess] = ok
(287)     [chap] = noop
(287)     [mschap] = noop
(287) suffix: Checking for suffix after "@"
(287) suffix: No '@' in User-Name = "username", looking up realm NULL
(287) suffix: No such realm "NULL"
(287)     [suffix] = noop
(287) eap: Peer sent EAP Response (code 2) ID 4 length 136
(287) eap: Continuing tunnel setup
(287)     [eap] = ok
(287)   } # authorize = ok
(287) Found Auth-Type = eap
(287) # Executing group from file /etc/raddb/sites-enabled/default
(287)   authenticate {
(287) eap: Expiring EAP session with state 0x37a1d54d34a5ccf3
(287) eap: Finished EAP session with state 0x37a1d54d34a5ccf3
(287) eap: Previous EAP request found for state 0x37a1d54d34a5ccf3,
released from the list
(287) eap: Peer sent packet with method EAP PEAP (25)
(287) eap: Calling submodule eap_peap to process data
(287) eap_peap: Continuing EAP-TLS
(287) eap_peap: Peer indicated complete TLS record size will be 126 bytes
(287) eap_peap: Got complete TLS record (126 bytes)
(287) eap_peap: [eaptls verify] = length included
(287) eap_peap: <<< recv TLS 1.2  [length 0046]
(287) eap_peap: TLS_accept: SSLv3 read client key exchange A
(287) eap_peap: TLS_accept: SSLv3 read certificate verify A
(287) eap_peap: <<< recv TLS 1.2  [length 0001]
(287) eap_peap: <<< recv TLS 1.2  [length 0010]
(287) eap_peap: TLS_accept: SSLv3 read finished A
(287) eap_peap: >>> send TLS 1.2  [length 0001]
(287) eap_peap: TLS_accept: SSLv3 write change cipher spec A
(287) eap_peap: >>> send TLS 1.2  [length 0010]
(287) eap_peap: TLS_accept: SSLv3 write finished A
(287) eap_peap: TLS_accept: SSLv3 flush data
(287) eap_peap: (other): SSL negotiation finished successfully
(287) eap_peap: SSL Connection Established
(287) eap_peap: [eaptls process] = handled
(287) eap: Sending EAP Request (code 1) ID 5 length 57
(287) eap: EAP session adding &reply:State = 0x37a1d54d33a4ccf3
(287)     [eap] = handled
(287)   } # authenticate = handled
(287) Using Post-Auth-Type Challenge
(287) Post-Auth-Type sub-section not found.  Ignoring.
(287) Sent Access-Challenge Id 92 from 192.168.0.1:1812 to 192.168.0.2:50542
length 0
(287)   EAP-Message =
0x01050039190014030300010116030300289ee4618644ce7821481aeb9fd88f702a8fdfe4f5d77ccc6b6e936c911b7be363afe27a1705983230
(287)   Message-Authenticator = 0x00000000000000000000000000000000
(287)   State = 0x37a1d54d33a4ccf3254ca9eee8b76bbc
(287) Finished request
Waking up in 0.1 seconds.
(288) Received Access-Request Id 61 from 192.168.0.2:50542 to
192.168.0.1:1812 length 178
(288)   User-Name = "username"
(288)   NAS-Port = 371
(288)   State = 0x37a1d54d33a4ccf3254ca9eee8b76bbc
(288)   EAP-Message = 0x020500061900
(288)   Message-Authenticator = 0x5d10b0f935e81650373b53222e489cd3
(288)   Acct-Session-Id = "8O2.1x811d9e92000679a2"
(288)   NAS-Port-Id = "ge-9/0/21.0"
(288)   Calling-Station-Id = "94-c6-91-17-01-2f"
(288)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(288)   NAS-IP-Address = 192.168.0.2
(288)   NAS-Identifier = "sw-ex6210"
(288)   NAS-Port-Type = Ethernet
(288) session-state: No cached attributes
(288) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(288)   authorize {
(288)     [preprocess] = ok
(288)     [chap] = noop
(288)     [mschap] = noop
(288) suffix: Checking for suffix after "@"
(288) suffix: No '@' in User-Name = "username", looking up realm NULL
(288) suffix: No such realm "NULL"
(288)     [suffix] = noop
(288) eap: Peer sent EAP Response (code 2) ID 5 length 6
(288) eap: Continuing tunnel setup
(288)     [eap] = ok
(288)   } # authorize = ok
(288) Found Auth-Type = eap
(288) # Executing group from file /etc/raddb/sites-enabled/default
(288)   authenticate {
(288) eap: Expiring EAP session with state 0x37a1d54d33a4ccf3
(288) eap: Finished EAP session with state 0x37a1d54d33a4ccf3
(288) eap: Previous EAP request found for state 0x37a1d54d33a4ccf3,
released from the list
(288) eap: Peer sent packet with method EAP PEAP (25)
(288) eap: Calling submodule eap_peap to process data
(288) eap_peap: Continuing EAP-TLS
(288) eap_peap: Peer ACKed our handshake fragment.  handshake is finished
(288) eap_peap: [eaptls verify] = success
(288) eap_peap: [eaptls process] = success
(288) eap_peap: Session established.  Decoding tunneled attributes
(288) eap_peap: PEAP state TUNNEL ESTABLISHED
(288) eap: Sending EAP Request (code 1) ID 6 length 40
(288) eap: EAP session adding &reply:State = 0x37a1d54d32a7ccf3
(288)     [eap] = handled
(288)   } # authenticate = handled
(288) Using Post-Auth-Type Challenge
(288) Post-Auth-Type sub-section not found.  Ignoring.
(288) Sent Access-Challenge Id 61 from 192.168.0.1:1812 to 192.168.0.2:50542
length 0
(288)   EAP-Message =
0x010600281900170303001d9ee4618644ce78226a96766e139d882ba16031a8a12a1fcefe6361c404
(288)   Message-Authenticator = 0x00000000000000000000000000000000
(288)   State = 0x37a1d54d32a7ccf3254ca9eee8b76bbc
(288) Finished request
Waking up in 0.1 seconds.
(289) Received Access-Request Id 54 from 192.168.0.2:50542 to
192.168.0.1:1812 length 212
(289)   User-Name = "username"
(289)   NAS-Port = 371
(289)   State = 0x37a1d54d32a7ccf3254ca9eee8b76bbc
(289)   EAP-Message =
0x020600281900170303001d3287125d9a9eaa69055db9975bd480a44b3c766b3574437b24c8b74e0d
(289)   Message-Authenticator = 0x9ee8a9732cb2eccf9478870fa6a45aa5
(289)   Acct-Session-Id = "8O2.1x811d9e92000679a2"
(289)   NAS-Port-Id = "ge-9/0/21.0"
(289)   Calling-Station-Id = "94-c6-91-17-01-2f"
(289)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(289)   NAS-IP-Address = 192.168.0.2
(289)   NAS-Identifier = "sw-ex6210"
(289)   NAS-Port-Type = Ethernet
(289) session-state: No cached attributes
(289) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(289)   authorize {
(289)     [preprocess] = ok
(289)     [chap] = noop
(289)     [mschap] = noop
(289) suffix: Checking for suffix after "@"
(289) suffix: No '@' in User-Name = "username", looking up realm NULL
(289) suffix: No such realm "NULL"
(289)     [suffix] = noop
(289) eap: Peer sent EAP Response (code 2) ID 6 length 40
(289) eap: Continuing tunnel setup
(289)     [eap] = ok
(289)   } # authorize = ok
(289) Found Auth-Type = eap
(289) # Executing group from file /etc/raddb/sites-enabled/default
(289)   authenticate {
(289) eap: Expiring EAP session with state 0x37a1d54d32a7ccf3
(289) eap: Finished EAP session with state 0x37a1d54d32a7ccf3
(289) eap: Previous EAP request found for state 0x37a1d54d32a7ccf3,
released from the list
(289) eap: Peer sent packet with method EAP PEAP (25)
(289) eap: Calling submodule eap_peap to process data
(289) eap_peap: Continuing EAP-TLS
(289) eap_peap: [eaptls verify] = ok
(289) eap_peap: Done initial handshake
(289) eap_peap: [eaptls process] = ok
(289) eap_peap: Session established.  Decoding tunneled attributes
(289) eap_peap: PEAP state WAITING FOR INNER IDENTITY
(289) eap_peap: Identity - username
(289) eap_peap: Got inner identity 'username'
(289) eap_peap: Setting default EAP type for tunneled EAP session
(289) eap_peap: Got tunneled request
(289) eap_peap:   EAP-Message = 0x020600090174766264
(289) eap_peap: Setting User-Name to username
(289) eap_peap: Sending tunneled request to default
(289) eap_peap:   EAP-Message = 0x020600090174766264
(289) eap_peap:   FreeRADIUS-Proxied-To = 127.0.0.1
(289) eap_peap:   User-Name = "username"
(289) Virtual server default received request
(289)   EAP-Message = 0x020600090174766264
(289)   FreeRADIUS-Proxied-To = 127.0.0.1
(289)   User-Name = "username"
(289) WARNING: Outer and inner identities are the same.  User privacy is
compromised.
(289) server default {
(289)   # Executing section authorize from file
/etc/raddb/sites-enabled/default
(289)     authorize {
(289)       [preprocess] = ok
(289)       [chap] = noop
(289)       [mschap] = noop
(289) suffix: Checking for suffix after "@"
(289) suffix: No '@' in User-Name = "username", looking up realm NULL
(289) suffix: No such realm "NULL"
(289)       [suffix] = noop
(289) eap: Peer sent EAP Response (code 2) ID 6 length 9
(289) eap: EAP-Identity reply, returning 'ok' so we can short-circuit the
rest of authorize
(289)       [eap] = ok
(289)     } # authorize = ok
(289)   Found Auth-Type = eap
(289)   # Executing group from file /etc/raddb/sites-enabled/default
(289)     authenticate {
(289) eap: Peer sent packet with method EAP Identity (1)
(289) eap: Calling submodule eap_mschapv2 to process data
(289) eap_mschapv2: Issuing Challenge
(289) eap: Sending EAP Request (code 1) ID 7 length 43
(289) eap: EAP session adding &reply:State = 0x1294545212934e07
(289)       [eap] = handled
(289)     } # authenticate = handled
(289) } # server default
(289) Virtual server sending reply
(289)   EAP-Message =
0x0107002b1a010700261054859160ce5bd7de6beb6289cd884d38667265657261646975732d332e302e3136
(289)   Message-Authenticator = 0x00000000000000000000000000000000
(289)   State = 0x1294545212934e073a134cb638a0a056
(289) eap_peap: Got tunneled reply code 11
(289) eap_peap:   EAP-Message =
0x0107002b1a010700261054859160ce5bd7de6beb6289cd884d38667265657261646975732d332e302e3136
(289) eap_peap:   Message-Authenticator = 0x00000000000000000000000000000000
(289) eap_peap:   State = 0x1294545212934e073a134cb638a0a056
(289) eap_peap: Got tunneled reply RADIUS code 11
(289) eap_peap:   EAP-Message =
0x0107002b1a010700261054859160ce5bd7de6beb6289cd884d38667265657261646975732d332e302e3136
(289) eap_peap:   Message-Authenticator = 0x00000000000000000000000000000000
(289) eap_peap:   State = 0x1294545212934e073a134cb638a0a056
(289) eap_peap: Got tunneled Access-Challenge
(289) eap: Sending EAP Request (code 1) ID 7 length 74
(289) eap: EAP session adding &reply:State = 0x37a1d54d31a6ccf3
(289)     [eap] = handled
(289)   } # authenticate = handled
(289) Using Post-Auth-Type Challenge
(289) Post-Auth-Type sub-section not found.  Ignoring.
(289) Sent Access-Challenge Id 54 from 192.168.0.1:1812 to 192.168.0.2:50542
length 0
(289)   EAP-Message =
0x0107004a1900170303003f9ee4618644ce7823cba4c2f021317db6e7891366fafa87e1d88650de9e35e5630b39f256d4eca03b3e7a5ad72f0b825e78935401a44f8842dcf3a56af5de35
(289)   Message-Authenticator = 0x00000000000000000000000000000000
(289)   State = 0x37a1d54d31a6ccf3254ca9eee8b76bbc
(289) Finished request
(290) Received Access-Request Id 97 from 192.168.0.2:50542 to
192.168.0.1:1812 length 209
(290)   User-Name = "username"
(290)   NAS-Port = 371
(290)   State = 0x37a1d54d31a6ccf3254ca9eee8b76bbc
(290)   EAP-Message =
0x020700251900170303001a3287125d9a9eaa6ac84e209651c98eaf7a904156ed83cd0efa57
(290)   Message-Authenticator = 0x37a6000d83847b724a10531abe6a2327
(290)   Acct-Session-Id = "8O2.1x811d9e92000679a2"
(290)   NAS-Port-Id = "ge-9/0/21.0"
(290)   Calling-Station-Id = "94-c6-91-17-01-2f"
(290)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(290)   NAS-IP-Address = 192.168.0.2
(290)   NAS-Identifier = "sw-ex6210"
(290)   NAS-Port-Type = Ethernet
(290) session-state: No cached attributes
(290) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(290)   authorize {
(290)     [preprocess] = ok
(290)     [chap] = noop
(290)     [mschap] = noop
(290) suffix: Checking for suffix after "@"
(290) suffix: No '@' in User-Name = "username", looking up realm NULL
(290) suffix: No such realm "NULL"
(290)     [suffix] = noop
(290) eap: Peer sent EAP Response (code 2) ID 7 length 37
(290) eap: Continuing tunnel setup
(290)     [eap] = ok
(290)   } # authorize = ok
(290) Found Auth-Type = eap
(290) # Executing group from file /etc/raddb/sites-enabled/default
(290)   authenticate {
(290) eap: Expiring EAP session with state 0x1294545212934e07
(290) eap: Finished EAP session with state 0x37a1d54d31a6ccf3
(290) eap: Previous EAP request found for state 0x37a1d54d31a6ccf3,
released from the list
(290) eap: Peer sent packet with method EAP PEAP (25)
(290) eap: Calling submodule eap_peap to process data
(290) eap_peap: Continuing EAP-TLS
(290) eap_peap: [eaptls verify] = ok
(290) eap_peap: Done initial handshake
(290) eap_peap: [eaptls process] = ok
(290) eap_peap: Session established.  Decoding tunneled attributes
(290) eap_peap: PEAP state phase2
(290) eap_peap: EAP method NAK (3)
(290) eap_peap: Got tunneled request
(290) eap_peap:   EAP-Message = 0x020700060304
(290) eap_peap: Setting User-Name to username
(290) eap_peap: Sending tunneled request to default
(290) eap_peap:   EAP-Message = 0x020700060304
(290) eap_peap:   FreeRADIUS-Proxied-To = 127.0.0.1
(290) eap_peap:   User-Name = "username"
(290) eap_peap:   State = 0x1294545212934e073a134cb638a0a056
(290) Virtual server default received request
(290)   EAP-Message = 0x020700060304
(290)   FreeRADIUS-Proxied-To = 127.0.0.1
(290)   User-Name = "username"
(290)   State = 0x1294545212934e073a134cb638a0a056
(290) WARNING: Outer and inner identities are the same.  User privacy is
compromised.
(290) server default {
(290)   session-state: No cached attributes
(290)   # Executing section authorize from file
/etc/raddb/sites-enabled/default
(290)     authorize {
(290)       [preprocess] = ok
(290)       [chap] = noop
(290)       [mschap] = noop
(290) suffix: Checking for suffix after "@"
(290) suffix: No '@' in User-Name = "username", looking up realm NULL
(290) suffix: No such realm "NULL"
(290)       [suffix] = noop
(290) eap: Peer sent EAP Response (code 2) ID 7 length 6
(290) eap: No EAP Start, assuming it's an on-going EAP conversation
(290)       [eap] = updated
(290) sql-wifi: EXPAND %{User-Name}
(290) sql-wifi:    --> username
(290) sql-wifi: SQL-User-Name set to 'username'
rlm_sql (sql-wifi): Reserved connection (0)
(290) sql-wifi: EXPAND SELECT wifi_id as id, username, 'MD5-Password' as
attribute, md5_hash, ':=' as  op FROM wifiusers WHERE username =
'%{SQL-User-Name}' ORDER BY id
(290) sql-wifi:    --> SELECT wifi_id as id, username, 'MD5-Password' as
attribute, md5_hash, ':=' as  op FROM wifiusers WHERE username = 'username'
ORDER BY id
(290) sql-wifi: Executing select query: SELECT wifi_id as id, username,
'MD5-Password' as attribute, md5_hash, ':=' as  op FROM wifiusers WHERE
username = 'username' ORDER BY id
(290) sql-wifi: User found in radcheck table
(290) sql-wifi: Conditional check items matched, merging assignment check
items
(290) sql-wifi:   MD5-Password := 0x06d9ded822ff50138cda74ee2e771082
(290) sql-wifi: EXPAND SELECT id, UserName, Attribute, Value, op FROM
wifi_attrs WHERE username = '%{SQL-User-Name}' ORDER BY id
(290) sql-wifi:    --> SELECT id, UserName, Attribute, Value, op FROM
wifi_attrs WHERE username = 'username' ORDER BY id
(290) sql-wifi: Executing select query: SELECT id, UserName, Attribute,
Value, op FROM wifi_attrs WHERE username = 'username' ORDER BY id
(290) sql-wifi: EXPAND SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='%{SQL-User-Name}'
(290) sql-wifi:    --> SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='username'
(290) sql-wifi: Executing select query: SELECT 'Officewifi' as GroupName
FROM wifiusers WHERE UserName='username'
(290) sql-wifi: User found in the group table
(290) sql-wifi: EXPAND SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op FROM wifiusers
WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(290) sql-wifi:    --> SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op FROM wifiusers
WHERE Username = 'username'           ORDER BY id
(290) sql-wifi: Executing select query: SELECT wifi_id as id, 'Officewifi'
as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op FROM
wifiusers           WHERE Username = 'username'           ORDER BY id
(290) sql-wifi: Group "Officewifi": Conditional check items matched
(290) sql-wifi: Group "Officewifi": Merging assignment check items
(290) sql-wifi:   MD5-Password := 0x06d9ded822ff50138cda74ee2e771082
(290) sql-wifi: EXPAND SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op         FROM wifiusers
        WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(290) sql-wifi:    --> SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op         FROM wifiusers
        WHERE Username = 'username'           ORDER BY id
(290) sql-wifi: Executing select query: SELECT wifi_id as id, 'Officewifi'
as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op
FROM wifiusers           WHERE Username = 'username'           ORDER BY id
(290) sql-wifi: Group "Officewifi": Merging reply items
(290) sql-wifi:   MD5-Password := 0x06d9ded822ff50138cda74ee2e771082
rlm_sql (sql-wifi): Released connection (0)
(290)       [sql-wifi] = ok
(290) pap: WARNING: Auth-Type already set.  Not setting to PAP
(290)       [pap] = noop
(290)     } # authorize = updated
(290)   Found Auth-Type = eap
(290)   # Executing group from file /etc/raddb/sites-enabled/default
(290)     authenticate {
(290) eap: Expiring EAP session with state 0x1294545212934e07
(290) eap: Finished EAP session with state 0x1294545212934e07
(290) eap: Previous EAP request found for state 0x1294545212934e07,
released from the list
(290) eap: Peer sent packet with method EAP NAK (3)
(290) eap: Found mutually acceptable type MD5 (4)
(290) eap: Calling submodule eap_md5 to process data
(290) eap_md5: Issuing MD5 Challenge
(290) eap: Sending EAP Request (code 1) ID 8 length 22
(290) eap: EAP session adding &reply:State = 0x12945452139c5007
(290)       [eap] = handled
(290)     } # authenticate = handled
(290) } # server default
(290) Virtual server sending reply
(290)   MD5-Password = 0x06d9ded822ff50138cda74ee2e771082
(290)   EAP-Message = 0x010800160410f6777c6b7c5a20da7574b0ed5225d4e5
(290)   Message-Authenticator = 0x00000000000000000000000000000000
(290)   State = 0x12945452139c50073a134cb638a0a056
(290) eap_peap: Got tunneled reply code 11
(290) eap_peap:   MD5-Password = 0x06d9ded822ff50138cda74ee2e771082
(290) eap_peap:   EAP-Message =
0x010800160410f6777c6b7c5a20da7574b0ed5225d4e5
(290) eap_peap:   Message-Authenticator = 0x00000000000000000000000000000000
(290) eap_peap:   State = 0x12945452139c50073a134cb638a0a056
(290) eap_peap: Got tunneled reply RADIUS code 11
(290) eap_peap:   MD5-Password = 0x06d9ded822ff50138cda74ee2e771082
(290) eap_peap:   EAP-Message =
0x010800160410f6777c6b7c5a20da7574b0ed5225d4e5
(290) eap_peap:   Message-Authenticator = 0x00000000000000000000000000000000
(290) eap_peap:   State = 0x12945452139c50073a134cb638a0a056
(290) eap_peap: Got tunneled Access-Challenge
(290) eap: Sending EAP Request (code 1) ID 8 length 53
(290) eap: EAP session adding &reply:State = 0x37a1d54d30a9ccf3
(290)     [eap] = handled
(290)   } # authenticate = handled
(290) Using Post-Auth-Type Challenge
(290) Post-Auth-Type sub-section not found.  Ignoring.
(290) Sent Access-Challenge Id 97 from 192.168.0.1:1812 to 192.168.0.2:50542
length 0
(290)   EAP-Message =
0x010800351900170303002a9ee4618644ce782431765e8ef94f196f26301c0442b7cfab87160db0dc2f0feea3f4907a04bef62c5dc9
(290)   Message-Authenticator = 0x00000000000000000000000000000000
(290)   State = 0x37a1d54d30a9ccf3254ca9eee8b76bbc
(290) Finished request
(291) Received Access-Request Id 93 from 192.168.0.2:50542 to
192.168.0.1:1812 length 225
(291)   User-Name = "username"
(291)   NAS-Port = 371
(291)   State = 0x37a1d54d30a9ccf3254ca9eee8b76bbc
(291)   EAP-Message =
0x020800351900170303002a3287125d9a9eaa6bb3a115e3c927f4c41dbc5787ce5348e5060fe663f7f16758038b61609a37c88dccc7
(291)   Message-Authenticator = 0x648545a5f8800bb04e2afb49ec6fea31
(291)   Acct-Session-Id = "8O2.1x811d9e92000679a2"
(291)   NAS-Port-Id = "ge-9/0/21.0"
(291)   Calling-Station-Id = "94-c6-91-17-01-2f"
(291)   Called-Station-Id = "88-e0-f3-b0-d6-00"
(291)   NAS-IP-Address = 192.168.0.2
(291)   NAS-Identifier = "sw-ex6210"
(291)   NAS-Port-Type = Ethernet
(291) session-state: No cached attributes
(291) # Executing section authorize from file
/etc/raddb/sites-enabled/default
(291)   authorize {
(291)     [preprocess] = ok
(291)     [chap] = noop
(291)     [mschap] = noop
(291) suffix: Checking for suffix after "@"
(291) suffix: No '@' in User-Name = "username", looking up realm NULL
(291) suffix: No such realm "NULL"
(291)     [suffix] = noop
(291) eap: Peer sent EAP Response (code 2) ID 8 length 53
(291) eap: Continuing tunnel setup
(291)     [eap] = ok
(291)   } # authorize = ok
(291) Found Auth-Type = eap
(291) # Executing group from file /etc/raddb/sites-enabled/default
(291)   authenticate {
(291) eap: Expiring EAP session with state 0x12945452139c5007
(291) eap: Finished EAP session with state 0x37a1d54d30a9ccf3
(291) eap: Previous EAP request found for state 0x37a1d54d30a9ccf3,
released from the list
(291) eap: Peer sent packet with method EAP PEAP (25)
(291) eap: Calling submodule eap_peap to process data
(291) eap_peap: Continuing EAP-TLS
(291) eap_peap: [eaptls verify] = ok
(291) eap_peap: Done initial handshake
(291) eap_peap: [eaptls process] = ok
(291) eap_peap: Session established.  Decoding tunneled attributes
(291) eap_peap: PEAP state phase2
(291) eap_peap: EAP method MD5 (4)
(291) eap_peap: Got tunneled request
(291) eap_peap:   EAP-Message =
0x020800160410224064290bdfc309d1760647ff67415e
(291) eap_peap: Setting User-Name to username
(291) eap_peap: Sending tunneled request to default
(291) eap_peap:   EAP-Message =
0x020800160410224064290bdfc309d1760647ff67415e
(291) eap_peap:   FreeRADIUS-Proxied-To = 127.0.0.1
(291) eap_peap:   User-Name = "username"
(291) eap_peap:   State = 0x12945452139c50073a134cb638a0a056
(291) Virtual server default received request
(291)   EAP-Message = 0x020800160410224064290bdfc309d1760647ff67415e
(291)   FreeRADIUS-Proxied-To = 127.0.0.1
(291)   User-Name = "username"
(291)   State = 0x12945452139c50073a134cb638a0a056
(291) WARNING: Outer and inner identities are the same.  User privacy is
compromised.
(291) server default {
(291)   session-state: No cached attributes
(291)   # Executing section authorize from file
/etc/raddb/sites-enabled/default
(291)     authorize {
(291)       [preprocess] = ok
(291)       [chap] = noop
(291)       [mschap] = noop
(291) suffix: Checking for suffix after "@"
(291) suffix: No '@' in User-Name = "username", looking up realm NULL
(291) suffix: No such realm "NULL"
(291)       [suffix] = noop
(291) eap: Peer sent EAP Response (code 2) ID 8 length 22
(291) eap: No EAP Start, assuming it's an on-going EAP conversation
(291)       [eap] = updated
(291) sql-wifi: EXPAND %{User-Name}
(291) sql-wifi:    --> username
(291) sql-wifi: SQL-User-Name set to 'username'
rlm_sql (sql-wifi): Reserved connection (1)
(291) sql-wifi: EXPAND SELECT wifi_id as id, username, 'MD5-Password' as
attribute, md5_hash, ':=' as  op FROM wifiusers WHERE username =
'%{SQL-User-Name}' ORDER BY id
(291) sql-wifi:    --> SELECT wifi_id as id, username, 'MD5-Password' as
attribute, md5_hash, ':=' as  op FROM wifiusers WHERE username = 'username'
ORDER BY id
(291) sql-wifi: Executing select query: SELECT wifi_id as id, username,
'MD5-Password' as attribute, md5_hash, ':=' as  op FROM wifiusers WHERE
username = 'username' ORDER BY id
(291) sql-wifi: User found in radcheck table
(291) sql-wifi: Conditional check items matched, merging assignment check
items
(291) sql-wifi:   MD5-Password := 0x06d9ded822ff50138cda74ee2e771082
(291) sql-wifi: EXPAND SELECT id, UserName, Attribute, Value, op FROM
wifi_attrs WHERE username = '%{SQL-User-Name}' ORDER BY id
(291) sql-wifi:    --> SELECT id, UserName, Attribute, Value, op FROM
wifi_attrs WHERE username = 'username' ORDER BY id
(291) sql-wifi: Executing select query: SELECT id, UserName, Attribute,
Value, op FROM wifi_attrs WHERE username = 'username' ORDER BY id
(291) sql-wifi: EXPAND SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='%{SQL-User-Name}'
(291) sql-wifi:    --> SELECT 'Officewifi' as GroupName FROM wifiusers
WHERE UserName='username'
(291) sql-wifi: Executing select query: SELECT 'Officewifi' as GroupName
FROM wifiusers WHERE UserName='username'
(291) sql-wifi: User found in the group table
(291) sql-wifi: EXPAND SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op FROM wifiusers
WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(291) sql-wifi:    --> SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op FROM wifiusers
WHERE Username = 'username'           ORDER BY id
(291) sql-wifi: Executing select query: SELECT wifi_id as id, 'Officewifi'
as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op FROM
wifiusers           WHERE Username = 'username'           ORDER BY id
(291) sql-wifi: Group "Officewifi": Conditional check items matched
(291) sql-wifi: Group "Officewifi": Merging assignment check items
(291) sql-wifi:   MD5-Password := 0x06d9ded822ff50138cda74ee2e771082
(291) sql-wifi: EXPAND SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op         FROM wifiusers
        WHERE Username = '%{SQL-User-Name}'           ORDER BY id
(291) sql-wifi:    --> SELECT wifi_id as id, 'Officewifi' as GroupName,
'MD5-Password' as attribute, md5_hash, ':=' as op         FROM wifiusers
        WHERE Username = 'username'           ORDER BY id
(291) sql-wifi: Executing select query: SELECT wifi_id as id, 'Officewifi'
as GroupName, 'MD5-Password' as attribute, md5_hash, ':=' as op
FROM wifiusers           WHERE Username = 'username'           ORDER BY id
(291) sql-wifi: Group "Officewifi": Merging reply items
(291) sql-wifi:   MD5-Password := 0x06d9ded822ff50138cda74ee2e771082
rlm_sql (sql-wifi): Released connection (1)
(291)       [sql-wifi] = ok
(291) pap: WARNING: Auth-Type already set.  Not setting to PAP
(291)       [pap] = noop
(291)     } # authorize = updated
(291)   Found Auth-Type = eap
(291)   # Executing group from file /etc/raddb/sites-enabled/default
(291)     authenticate {
(291) eap: Expiring EAP session with state 0x12945452139c5007
(291) eap: Finished EAP session with state 0x12945452139c5007
(291) eap: Previous EAP request found for state 0x12945452139c5007,
released from the list
(291) eap: Peer sent packet with method EAP MD5 (4)
(291) eap: Calling submodule eap_md5 to process data
(291) eap_md5: ERROR: Cleartext-Password is required for EAP-MD5
authentication
(291) eap: ERROR: Failed continuing EAP MD5 (4) session.  EAP sub-module
failed
(291) eap: Sending EAP Failure (code 4) ID 8 length 4
(291) eap: Failed in EAP select
(291)       [eap] = invalid
(291)     } # authenticate = invalid
(291)   Failed to authenticate the user
(291)   Using Post-Auth-Type Reject
(291)   Post-Auth-Type sub-section not found.  Ignoring.



My question is why this client can't log in? I have correct md5-hash in a
database which added like "0x06d9ded822ff50138cda74ee2e771082".
The second question is do I have a possibility to check which module has
used: eap or mschap. I want to use a correct hash from the database in case
mschapv2 modules has been called.


пн, 31 дек. 2018 г. в 16:04, Alan DeKok <[hidden email]>:

> On Dec 31, 2018, at 10:22 AM, Anton Kiryushkin <[hidden email]> wrote:
> >
> > In other words, how can I make a different way to authorisation users by
> > per controllers?
>
>   Read raddb/sites-available/README
>
>   It describes how to map clients to different virtual servers.
>
> > I found the option virtual_server, but when I read a log I saw that
> client
> > goes through a dedicated site with an md5-hashed password and after comes
> > back to default site.
>
>   Which is what you configured it to do...
>
>   The default configuration doesn't do that.
>
> > And passwords hashed in that way are working with VPN-site.
>
>   Don't invent new words.  It's confusing.  It also means that you're not
> thinking about the configuration correctly.
>
>   Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html



--
Best regards,
Anton Kiryushkin
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Ms-Chap + NT-Password

Alan DeKok-2
On Jan 8, 2019, at 11:07 AM, Anton Kiryushkin <[hidden email]> wrote:
> Now I read the documentation, but I still don't understand why server
> choose one method instead of others (I've read about attempts predict).

  In most cases, the *client* chooses the authentication method.  The server is just configured to allow many different methods.

> So,
> I have next config file and I try to understand why it's don't working:
> (Unfortunately, I don't understand the reason why it has working for
> mschapv2 and don't work for eap)

  Read the debug log for MSCHAPv2, and see how it's different from EAP.

> (291) eap: Peer sent packet with method EAP MD5 (4)
> (291) eap: Calling submodule eap_md5 to process data
> (291) eap_md5: ERROR: Cleartext-Password is required for EAP-MD5
> authentication
> (291) eap: ERROR: Failed continuing EAP MD5 (4) session.  EAP sub-module
> failed
> (291) eap: Sending EAP Failure (code 4) ID 8 length 4
> (291) eap: Failed in EAP select
> (291)       [eap] = invalid
> (291)     } # authenticate = invalid
> (291)   Failed to authenticate the user
> (291)   Using Post-Auth-Type Reject
> (291)   Post-Auth-Type sub-section not found.  Ignoring.
>
> My question is why this client can't log in? I have correct md5-hash in a
> database which added like "0x06d9ded822ff50138cda74ee2e771082".

  The debug log *tells you* why it doesn't work.  See the text just above.  It tells you what's going wrong, and what the server needs.

> The second question is do I have a possibility to check which module has
> used: eap or mschap. I want to use a correct hash from the database in case
> mschapv2 modules has been called.

  Your best bet is to just use Cleartext-Password, and let the server figure out what to do.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html