#---see http://cntlm.sourceforge.net/
echo cntlm -v -f -s -c "C:\Program Files (x86)\Cntlm\cntlm.ini"
cntlm -v -f -s -c "C:\Program Files (x86)\Cntlm\cntlm.ini"
Generate HashPassword
cntlm -v -u username -d domainename -H
cntlm.ini
Username username
PassNTLMv2 08192805CB06C3214581268F86EEA8
Domain domainename
Proxy proxyname
NoProxy localhost, 127.0.0.*, 10.*, 192.168.*, 172.24.*
Listen 9999
Header User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
...and use putty --> proxy on 9999
mardi 27 août 2013
Start FireFox script for FoxyProxy
#cygwin bash ------------------------------------------------------------------------------------------
#!/bin/bash
# xmlstarlet sel -t -m "//foxyproxy/proxies" -m "proxy" -v "@name" -o ":" -v "@id" -n /cygdrive/c/Users/`whoami`/appdata/Roaming/Mozilla/Firefox/profiles/*.default/foxyproxy.xml
SleepTime=5
File="/cygdrive/c/Users/`whoami`/appdata/Roaming/Mozilla/Firefox/profiles/7c1tsms2.default/foxyproxy.xml"
FireFox=/cygdrive/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
IPWork=10
LocalisationIP=$(ipconfig | grep -i ipv4 | cut -f2 -d':' | cut -f1 -d'.' )
if [ $LocalisationIP -eq $IPWork ]; then
WorkName="Work"
echo Lan Work : $LocalisationIP
else
WorkName="Default"
echo Lan Home : $LocalisationIP
fi
# echo "/usr/bin/xmlstarlet sel -t -m "foxyproxy/proxies/proxy[@name=$WorkName]" -v "@id" -n $File"
ProxyID=$(/usr/bin/xmlstarlet sel -t -m "foxyproxy/proxies/proxy[@name='$WorkName']" -v "@id" -n $File)
cd /cygdrive/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/
echo "cmd /c start 'FireFox' -foxyproxy-mode $ProxyID"
cmd /c start "FireFox" -foxyproxy-mode $ProxyID
while [ -z "${Pid}" ]; do
Pid=$(pslist |grep -i firefox | awk '{print $2}')
echo Firefox starting...
sleep $SleepTime
done
exit
#Dos---------------------------------------------------------------------------------------------------
@cls
@echo off
@Set RsxWork=172
for /f "delims= " ^%%i in ('ipconfig ^| grep -i ipv4 ^| cut -f2 -d':' ^| cut -f1 -d'.' ') do set myip=^%%i
@echo %myip% %RsxWork%
IF "%myip%"=="%RsxWork%" (
@echo Work Network....
start "Firefox" "c:\Program Files (x86)\Mozilla Firefox\firefox.exe" -foxyproxy-mode 1971257625
)
IF NOT "%myip%"=="%RsxWork%" (
@echo Home Network....
start "Firefox" "c:\Program Files (x86)\Mozilla Firefox\firefox.exe" -foxyproxy-mode 2153982398
)
@echo is starting...
#!/bin/bash
# xmlstarlet sel -t -m "//foxyproxy/proxies" -m "proxy" -v "@name" -o ":" -v "@id" -n /cygdrive/c/Users/`whoami`/appdata/Roaming/Mozilla/Firefox/profiles/*.default/foxyproxy.xml
SleepTime=5
File="/cygdrive/c/Users/`whoami`/appdata/Roaming/Mozilla/Firefox/profiles/7c1tsms2.default/foxyproxy.xml"
FireFox=/cygdrive/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
IPWork=10
LocalisationIP=$(ipconfig | grep -i ipv4 | cut -f2 -d':' | cut -f1 -d'.' )
if [ $LocalisationIP -eq $IPWork ]; then
WorkName="Work"
echo Lan Work : $LocalisationIP
else
WorkName="Default"
echo Lan Home : $LocalisationIP
fi
# echo "/usr/bin/xmlstarlet sel -t -m "foxyproxy/proxies/proxy[@name=$WorkName]" -v "@id" -n $File"
ProxyID=$(/usr/bin/xmlstarlet sel -t -m "foxyproxy/proxies/proxy[@name='$WorkName']" -v "@id" -n $File)
cd /cygdrive/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/
echo "cmd /c start 'FireFox' -foxyproxy-mode $ProxyID"
cmd /c start "FireFox" -foxyproxy-mode $ProxyID
while [ -z "${Pid}" ]; do
Pid=$(pslist |grep -i firefox | awk '{print $2}')
echo Firefox starting...
sleep $SleepTime
done
exit
#Dos---------------------------------------------------------------------------------------------------
@cls
@echo off
@Set RsxWork=172
for /f "delims= " ^%%i in ('ipconfig ^| grep -i ipv4 ^| cut -f2 -d':' ^| cut -f1 -d'.' ') do set myip=^%%i
@echo %myip% %RsxWork%
IF "%myip%"=="%RsxWork%" (
@echo Work Network....
start "Firefox" "c:\Program Files (x86)\Mozilla Firefox\firefox.exe" -foxyproxy-mode 1971257625
)
IF NOT "%myip%"=="%RsxWork%" (
@echo Home Network....
start "Firefox" "c:\Program Files (x86)\Mozilla Firefox\firefox.exe" -foxyproxy-mode 2153982398
)
@echo is starting...
Associate .sh bash cygwin
assoc .sh=bashscript
ftype bashscript=D:\cygwin.64\bin\bash.exe --login -i -c 'cd "$(dirname "$(cygpath -u "%1")")"; bash "$(cygpath -u "%1")"'
ftype bashscript=D:\cygwin.64\bin\bash.exe "%1"
ftype bashscript=D:\cygwin.64\bin\bash.exe --login -i -c 'cd "$(dirname "$(cygpath -u "%1")")"; bash "$(cygpath -u "%1")"'
ftype bashscript=D:\cygwin.64\bin\bash.exe "%1"
Inscription à :
Articles (Atom)