[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
借顶楼代码稍微精简一下,省掉第三方...
  1. @echo off
  2. ::本代码仅作交流学习之用,复制粘贴之后请于24小时之内删除,严禁用于商业用途!
  3. ::用于非法用途造成的后果作者概不负责
  4. ::by bailong360 @bbs.bathome.net
  5. :Start
  6. if not exist "%AllUsersProfile%\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk" (
  7.     echo 新建VPN!
  8.     md "%AllUsersProfile%\Application Data\Microsoft\Network\Connections\Pbk" 2>nul
  9.     call :NewVPN "23.94.232.41"
  10. )
  11. cd /d %temp%
  12. echo 正在获取地址...
  13. mshta http://bathome.net/s/hta/ web('http://free.vpn.wwdhz.com').match(/(IP地址:)([0-9.]+)/)[2] >ip.txt
  14. echo 正在获取用户名密码...
  15. mshta http://bathome.net/s/hta/ "web('http://free.vpn.wwdhz.com').match(/(用户名:)(..*)(\<\/p\>)/)[2]" >user.txt
  16. set /p ip=<ip.txt
  17. type "%AllUsersProfile%\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"|findstr "=%ip:.=\.%$" >nul||(
  18.     echo IP地址更新!
  19.     call :NewVPN "%ip%"
  20.     goto Start
  21. )
  22. mshta http://bathome.net/s/hta/ web('http://%ip%/mm.txt') >mm.txt
  23. set /p mm=<mm.txt
  24. set /p user=<user.txt
  25. rasdial VPN %user% %mm%
  26. exit
  27. :NewVPN
  28. (echo [VPN]
  29. echo MEDIA=rastapi
  30. echo Port=VPN4-0
  31. echo Device=WAN Miniport (L2TP^)
  32. echo DEVICE=vpn
  33. echo PhoneNumber=%~1
  34. )>"%AllUsersProfile%\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"
复制代码
2

评分人数

TOP

话说 rasphone.pbk 原来可以这么短

TOP

原来一小时 vpn 跑到这里了!
分享另一个来源的免费 vpn
  1. <!-- :
  2. @echo off
  3. cd /d "%USERPROFILE%\AppData\Roaming\Microsoft\Network\Connections\Pbk"
  4. for /f "delims=" %%a in ('mshta "%~f0" rasphone.pbk "%~n0"') do set "user&pass=%%a"
  5. echo rasdial.exe "%~n0" %user&pass%
  6. rasdial.exe "%~n0" %user&pass%
  7. pause & exit /b
  8. -->
  9. <script src=http://www.bathome.net/lib/diy/hide.js></script>
  10. <script src=http://www.bathome.net/lib/diy/WSH.js></script>
  11. <script src=http://www.bathome.net/lib/diy/iconv.js></script>
  12. <script src="D:\mshta_lib\lib\diy\Function.js"></script>
  13. <script defer>
  14. var html = web('http://www.vpnonline.org/')
  15. var UK = 1
  16. //这里设为 0 表示连接 US 服务器
  17. //为 1 表示连接 UK 服务器
  18. var urltexts = html.match(/VPN(?:&nbsp;?| )Server(?:&nbsp;?| )IP:[\s\S]*?([\d\.]{8,})/ig)
  19. var flag = contectVPN(urltexts[UK],html)
  20. function contectVPN(urltext,html){
  21. try{
  22. var url = urltext.match(/([\d\.]{8,})$/i)[1]
  23. var username = html.match(/VPN(?:&nbsp;?| )Username:(?:&nbsp;?| )*([^\s\<]+)/i)[1]
  24. var password = html.match(/VPN(?:&nbsp;?| )Password:(?:&nbsp;?| )*([^\s\<]+)/i)[1]
  25. var data = document.getElementById('data').innerHTML
  26. .replace('[NAME]',WSH.Arguments(1))
  27. .replace('[URL]',url)
  28. iconv.saveText(data,WSH.Arguments(0),'UTF-8')
  29. alert('"' + username + ' ' + password)
  30. WSH.Echo('"' + username + '" "' + password + '"')
  31. return true
  32. }
  33. catch(Err){
  34. return false
  35. }
  36. }
  37. </script>
  38. <script type=data id=data>
  39. [[NAME]]
  40. Encoding=1
  41. Type=2
  42. AutoLogon=0
  43. UseRasCredentials=1
  44. DialParamsUID=37523232
  45. Guid=FFE24A0FFDE7414DABC592B4CF13E35F
  46. BaseProtocol=1
  47. VpnStrategy=2
  48. ExcludedProtocols=0
  49. LcpExtensions=1
  50. DataEncryption=256
  51. SwCompression=1
  52. NegotiateMultilinkAlways=0
  53. SkipNwcWarning=0
  54. SkipDownLevelDialog=0
  55. SkipDoubleDialDialog=0
  56. DialMode=1
  57. DialPercent=75
  58. DialSeconds=120
  59. HangUpPercent=10
  60. HangUpSeconds=120
  61. OverridePref=15
  62. RedialAttempts=3
  63. RedialSeconds=60
  64. IdleDisconnectSeconds=0
  65. RedialOnLinkFailure=0
  66. CallbackMode=0
  67. CustomDialDll=
  68. CustomDialFunc=
  69. CustomRasDialDll=
  70. AuthenticateServer=0
  71. ShareMsFilePrint=1
  72. BindMsNetClient=1
  73. SharedPhoneNumbers=0
  74. GlobalDeviceSettings=0
  75. PrerequisiteEntry=
  76. PrerequisitePbk=
  77. PreferredPort=VPN4-0
  78. PreferredDevice=WAN 微型端口 (L2TP)
  79. PreferredBps=0
  80. PreferredHwFlow=1
  81. PreferredProtocol=1
  82. PreferredCompression=1
  83. PreferredSpeaker=1
  84. PreferredMdmProtocol=0
  85. PreviewUserPw=1
  86. PreviewDomain=0
  87. PreviewPhoneNumber=0
  88. ShowDialingProgress=1
  89. ShowMonitorIconInTaskBar=1
  90. CustomAuthKey=-1
  91. AuthRestrictions=608
  92. TypicalAuth=2
  93. IpPrioritizeRemote=1
  94. IpHeaderCompression=0
  95. IpAddress=0.0.0.0
  96. IpDnsAddress=0.0.0.0
  97. IpDns2Address=0.0.0.0
  98. IpWinsAddress=0.0.0.0
  99. IpWins2Address=0.0.0.0
  100. IpAssign=1
  101. IpNameAssign=1
  102. IpFrameSize=1006
  103. IpDnsFlags=0
  104. IpNBTFlags=1
  105. TcpWindowSize=0
  106. UseFlags=0
  107. IpSecFlags=0
  108. IpDnsSuffix=
  109. NETCOMPONENTS=
  110. ms_server=1
  111. ms_msclient=1
  112. ms_psched=1
  113. MEDIA=rastapi
  114. Port=VPN4-0
  115. Device=WAN 微型端口 (L2TP)
  116. DEVICE=vpn
  117. PhoneNumber=[URL]
  118. AreaCode=
  119. CountryCode=1
  120. CountryID=1
  121. UseDialingRules=0
  122. Comment=
  123. LastSelectedPhone=0
  124. PromoteAlternates=0
  125. TryNextAlternateOnFail=1
  126. </data>
复制代码
3

评分人数

TOP

灯笼高高挂, 艹墙快快倒

Great F*UCKing Wall
3

评分人数

TOP

返回列表