Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash script for automating cntlm proxy password generation

I want to use the tool cntlm to authenticate via basic authentication against our corporate proxy server, which uses the ntlm protocol.

CNTLM uses a cntlm.conf file to get your proxy authentication credentials. If you don't want to use your password in plain text, you can generate hashes with the command. (That's what I want!)

cntlm -u <user> -d <domain> -f -H.

The problem here is, that we use a rolling password policy here and I want to write a bash script for automating the hash generation, inserting in the config file and restarting the cntlm service.

Unfortunately the above shown command generates the password hashes interactively and I couldn't find a way to wrap this in a bash script.

I am a bash scripting newbie though and could use some advice here ;)

like image 704
uloco Avatar asked Feb 24 '26 09:02

uloco


1 Answers

For my cntlm version (0.92.3) a simple echo pipe works like charm:

echo "PASSWORD" | cntlm -u USER -d DOMAIN -f -H

like image 61
Tim Malich Avatar answered Feb 27 '26 03:02

Tim Malich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!