局域网自动搜索配置代理服务器

前一段时间cocobear写了一个linux下的脚本,用来探测cnc拨号**,不过他那个比较费时间,而且会影响他人正常上网。最近我在win下用批处理写了一个程序,可以自动搜索并配置代理服务器,解决上网问题。当然这里只是做技术研究,请大家按照相关规章制度办理上网手续。 

考虑到法律和道德的约束问题,这里只将部分代码贴出来供大家研究学习。滥用程序带来的一切后果,由代码使用者本人承担!有任何想法请与我联系:kongjianjun@gmail.com

if “%1″==”” (
set/a a=1
) else set/a a=%1-1
set b=0
if “%2″==”” (
set/a c=2
) else set/a c=%2-1

::netsh interface ip set address name=”本地连接” source=static addr=192.168.%b%.24 mask=255.255.255.0 >nul && echo Gateway:  192.168.%b%.24
:up
if %a% == 255 goto panduan

:goon
set/a a=%a%+1
echo IP:  192.168.%b%.%a%
netsh interface ip set address name=”本地连接” gateway=192.168.%b%.%a% gwmetric=0

::ping -n 1 220.181.37.4 |find “Reply from 220.181.37.4” >nul 2>nul && echo 大功告成! && echo 192.168.%b%.%a% >>host.txt && nbtstat -A

192.168.%b%.%a% >>host.txt && goto win
goto up
:panduan
set/a b=%b%+1
if “%b%” == “%c%” goto end
set/a a=1 && netsh interface ip set address name=”本地连接” source=static addr=192.168.%b%.24 mask=255.255.255.0 >nul && echo Gateway: 

192.168.%b%.24  && goto goon

4 thoughts on “局域网自动搜索配置代理服务器

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.