Hello! I use Freeradius 3.0.13 and to be able to search back any peoples identity who made anything illegal, I would like to make a script which creates CUI for all of the usernames exisiting in the DB and compare it with the user who is suspicious made something bad. For this, I found the algorithm which calculates the CUI for users in /etc/raddb/policy.d/cui Chargeable-User-Identity := "%{sha1:${policy.cui_hash_key}%{tolower:%{User-Name}%{%{outer.request:Operator-Name}:-}}}" Than, I put the strings after each other with no space on my debian linux and gave it to sha1sum, but the CUI calculated by Freeradius and calculated with sha1sum seems quite different. My command was: echo "<mystringwhichisnotrevealed>" | sha1sum Code with sha1sum: baf4d4546ed4665e4d5e141bc9e8e728a7a934ab Code with Freeradius: 0x38393465333261356361356239306362353834323337323435363634373735386531393266613933 Can you help me fixing my calculation or process?
On 16 Jan 2019, at 13:52, Fekete Tamás <fektom@gmail.com> wrote:
echo "<mystringwhichisnotrevealed>" | sha1sum
Try using 'echo -n' echo has an implicit newline unless you tell it otherwise. Adam Bishop gpg: E75B 1F92 6407 DFDF 9F1C BF10 C993 2504 6609 D460 jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800. Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.
This and also the value shown by freeradius output is a hex dump of an ASCII encoded string. So 38393465333261356361356239306362353834323337323435363634373735386531393266613933 is 894e32a5ca5b90cb5842372456647758e192fa93 Adam Bishop <Adam.Bishop@jisc.ac.uk> wrote
On 16 Jan 2019, at 13:52, Fekete Tamás <fektom@gmail.com> wrote:
echo "<mystringwhichisnotrevealed>" | sha1sum
Try using 'echo -n'
echo has an implicit newline unless you tell it otherwise.
This, and also the value shown by freeradius output is a hex dump of an ASCII encoded string. So 38393465333261356361356239306362353834323337323435363634373735386531393266613933 is 894e32a5ca5b90cb5842372456647758e192fa93
Succeed!
Try using 'echo -n' Yes, -n has to be used with echo, this was one of the fault.
This, and also the value shown by freeradius output is a hex dump of an ASCII encoded string. Yes, this was the second thing I made.
And I also found a typo in the secret I gave to echo -n, so after all I changed all errors, got the proper value. Thank you! Brian Julin <BJulin@clarku.edu> ezt írta (időpont: 2019. jan. 16., Sze, 15:46):
This and also the value shown by freeradius output is a hex dump of an ASCII encoded string. So 38393465333261356361356239306362353834323337323435363634373735386531393266613933 is 894e32a5ca5b90cb5842372456647758e192fa93
Adam Bishop <Adam.Bishop@jisc.ac.uk> wrote
On 16 Jan 2019, at 13:52, Fekete Tamás <fektom@gmail.com> wrote:
echo "<mystringwhichisnotrevealed>" | sha1sum
Try using 'echo -n'
echo has an implicit newline unless you tell it otherwise.
This, and also the value shown by freeradius output is a hex dump of an ASCII encoded string. So 38393465333261356361356239306362353834323337323435363634373735386531393266613933 is 894e32a5ca5b90cb5842372456647758e192fa93
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Adam Bishop -
Brian Julin -
Fekete Tamás