Skip to content

Instantly share code, notes, and snippets.

@rajasharan
Last active July 31, 2022 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajasharan/dad23999aafd32e416e9f9e9017f1ae4 to your computer and use it in GitHub Desktop.
Save rajasharan/dad23999aafd32e416e9f9e9017f1ae4 to your computer and use it in GitHub Desktop.
CNTLM proxy setup

Prerequisite

$> brew install cntlm

Ream more about CNTLM here: http://cntlm.sourceforge.net/

CNTLM config file: .cntlm

Username <eid>
Domain <company_domain>
PassNTLMv2 <auto_gen_pass>

Proxy <company_proxy:port>
NoProxy localhost, *.company.com, 127.0.0.*, 10.*, 192.168.*

Listen 3128
Auth NTLMv2
#Flags 0x06820000

Gateway yes

CNTLM password generation

$> cntlm -c ~/.cntlm -I -m https://google.com/
# copy password & update `.cntlm` file

Start CNTLM (in foreground mode)

$> cntlm -vf -c ~/.cntlm -P ~/cntlm.pid

Verify CNTLM port (3128) is active

$> lsof -PiTCP

Source http proxies (eg. via .proxy file)

export http_proxy=http://localhost:3128
export https_proxy=$http_proxy
export all_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export ALL_PROXY=$http_proxy

Test CNTLM proxy

$> curl -I https://google.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment