{"id":288132,"date":"2018-08-16T18:10:02","date_gmt":"2018-08-16T14:10:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=288132"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=288132","title":{"rendered":"\u041f\u043e\u0447\u0442\u0438 OCR \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f VPNBook. PHP + Mikrotik"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420373\/\" class=\"post__text post__text-html js-mediator-article\">\u041d\u0435\u0434\u0430\u0432\u043d\u043e VPNBook \u0441\u0442\u0430\u043b \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u00ab\u041d\u0443 \u043a\u0430\u043a \u0436\u0435 \u0442\u0430\u043a\u00bb \u2014 \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u044f \u0438 \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0443\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u043c \u00ab\u043a\u0430\u0440\u0442\u0438\u043d\u043e\u0447\u043d\u044b\u0439\u00bb \u043f\u0430\u0440\u043e\u043b\u044c VPNBook \u043d\u0430 PHP. \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f Mikrotik.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0423\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u044f \u0443 \u0441\u0435\u0431\u044f \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0435 (Mikrotik) \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 PPTP VPN \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u043e\u0442 VPNBook.com \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0434\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f. \u041d\u0435 \u0431\u0443\u0434\u0443 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043e\u043d\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &#171;<a href=\"https:\/\/habr.com\/post\/309892\/\">\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0434\u043b\u044f VPN \u043d\u0430 Mikrotik<\/a>&#171;. \u0414\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f VPNBook \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437 html \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"php\">preg_match('\/Password: &lt;strong&gt;([^&lt;]+)\/', $homepage, $matches); print($matches[1])<\/code><\/pre>\n<p>  \u0410 \u0441 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0441\u0442\u0430\u043b \u00ab\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439\u00bb. \u0418 \u043f\u0435\u0440\u0432\u0430\u044f \u043c\u044b\u0441\u043b\u044c \u0431\u044b\u043b\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u0430. \u042f \u0441\u0442\u0430\u043b \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u043d\u043b\u0430\u0439\u043d \u0438 \u043e\u0444\u0444\u043b\u0430\u0439\u043d \u0441\u0435\u0440\u0432\u0438\u0441\u044b OCR, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c.<i> \u041f\u0435\u0440\u0435\u0434\u0430\u044e \u043f\u0440\u0438\u0432\u0435\u0442 \u0445\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u044e <a href=\"https:\/\/habr.com\/users\/Winand\/\">Winand<\/a>, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0443 \u043d\u0430\u0441 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0430\u0441\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u043a\u0430.<\/i> \u0412 \u043e\u0431\u0449\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 OCR, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u0432\u043e\u0437\u0438\u043b\u0441\u044f, \u0431\u044b\u043b Tesseract, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b \u043f\u0430\u0440\u043e\u043b\u044c, \u043d\u043e \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438. \u041d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u043c \u0448\u0440\u0438\u0444\u0442\u0430\u043c, \u0447\u0435\u043c \u044f \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f. \u041a\u043e\u0433\u0434\u0430 \u044f \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u043b \u0448\u0440\u0438\u0444\u0442, \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043d\u0430 \u00ab\u043a\u0430\u0440\u0442\u0438\u043d\u043e\u0447\u043d\u044b\u0439\u00bb, \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043c\u044b\u0441\u043b\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u0445\u043e\u0442\u044f \u0438 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 teminal \u0438\u0437 Windows \u0438\u043b\u0438 terminus font \u0438\u0437 Linux. \u0418 voila \u2014 \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0448\u0440\u0438\u0444\u0442 PHP \u043f\u043e\u0434 \u043d\u043e\u043c\u0435\u0440\u043e\u043c (\u0440\u0430\u0437\u043c\u0435\u0440) 5. \u0414\u0430\u043b\u0435\u0435 \u044f \u0437\u0430\u0431\u0440\u043e\u0441\u0438\u043b OCR \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 PHP, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0449\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u00ab\u043a\u0430\u0440\u0442\u0438\u043d\u043e\u0447\u043d\u043e\u0433\u043e\u00bb \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0430\u0440\u044e. \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u2014 \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u0430\u0440\u043e\u043b\u044f \u0442\u043e\u0433\u043e \u0436\u0435 \u0446\u0432\u0435\u0442\u0430 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u041f\u043e\u0438\u0441\u043a \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u0439 \u0440\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0443 VPNBook \u043f\u0440\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0435\u0434\u043e\u043b\u0433\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h3>\u0421\u043a\u0440\u0438\u043f\u0442 vpnbook.php<\/h3>\n<p>  \u0421\u043f\u0440\u0438\u043f\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443-\u043f\u0430\u0440\u043e\u043b\u044c.  <\/p>\n<pre><code class=\"php\">&lt;?php \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 $wchar = 9; $hchar = 13; $strDict = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 '; $imgDict = imagecreatetruecolor(2 + strlen($strDict)* $wchar, $hchar); $bg = imagecolorallocate($imgDict, 0xF6, 0xF6, 0xF6); $textcolor = imagecolorallocate($imgDict, 0x4C, 0x4C, 0x4C); imagefill($imgDict, 0, 0, $bg); imagestring($imgDict, 5, 2, 0, $strDict, $textcolor);   \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c cURL $ch = curl_init(); \/\/ \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c url, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 curl_setopt($ch, CURLOPT_URL, 'https:\/\/www.vpnbook.com\/password.php'); \/\/ \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u043f\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0435\u0440\u043d\u0443\u043b\u043e\u0441\u044c \u043d\u0430\u043c \u0432 string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); \/\/ also, this seems wise considering output is image. \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 $output = curl_exec($ch); \/\/ \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c cURL curl_close($ch);  $imgOCR = imagecreatefromstring($output); \/\/ $imgOCR = imageCreateFromPng('password.png'); \/\/ \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c\u0441\u044f 10 \u043f\u043e\u043b\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. 2 + 10*9 = 92 &lt; 100 $maxchar = floor((imagesx($imgOCR) - 2) \/ 9); $imgBox = imagecreatetruecolor($wchar, $hchar); $hashDict = Array();  \/\/ \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c for ($k = 0; $k &lt; strlen($strDict) ; $k++) { \timagecopy($imgBox, $imgDict, 0, 0, 2 + $k * $wchar, 0, $wchar, $hchar); \t$hashStr = \"\"; \tfor($y = 0; $y &lt; $hchar ; $y++) \t\tfor($x = 0; $x &lt; $wchar; $x++) $hashStr .= (imagecolorat($imgBox, $x, $y) != 0xF6F6F6)? '1': '0'; \t$hashDict[$hashStr] = $strDict[$k]; }  \/\/ \u0438\u0449\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043f\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044e for ($k = 0; $k &lt; $maxchar ; $k++) { \timagecopy($imgBox, $imgOCR, 0, 0, 2 + $k * $wchar, 0, $wchar, $hchar); \t$hashStr = \"\"; \tfor($y = 0; $y &lt; $hchar ; $y++) \t\tfor($x = 0; $x &lt; $wchar; $x++) $hashStr .= (imagecolorat($imgBox, $x, $y) != 0xF6F6F6)? '1': '0'; \t$tempchar = $hashDict[$hashStr]; \tif ($tempchar==' ') break; \tprint($tempchar); }  \/*header('Content-type: image\/png'); imagepng($imgOCR); *\/ \/\/var_dump($hashDict); imagedestroy($imgDict); imagedestroy($imgOCR); imagedestroy($imgBox); ?&gt;<\/code><\/pre>\n<h3>\u0421\u043a\u0440\u0438\u043f\u0442 Mikrotik VPNBook<\/h3>\n<p>  \u0421\u043a\u0440\u0438\u043f\u0442 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043c\u0438\u043d\u0443\u0442\u0443 \u0438\u0437 \u0448\u0435\u0434\u0443\u043b\u0435\u0440\u0430. \u0421\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 PPTP \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u044b\u0432\u0435 \u0441\u0432\u044f\u0437\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u0438\u043a\u0440\u043e\u0442\u0438\u043a \u043d\u0435\u00ab\u0444\u043b\u0443\u0434\u0438\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u043c\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0447\u0430\u0441\u043e\u0432 \u0441 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u0430\u0440\u043e\u043b\u0435\u043c, \u0430 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0437\u0430 1 \u043c\u0438\u043d\u0443\u0442\u0443. \u0422\u0430\u043a\u0436\u0435 \u0442\u0443\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0438 on-error \u0434\u043b\u044f fetch \u0438 file get, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d.<\/p>\n<pre><code class=\"bash\"># VPNBookScript v2 :global VPNBookpIfName \"pptp-out1\" :global VPNBookServerAddresses {\"euro217.vpnbook.com\";\"euro214.vpnbook.com\";\"us1.vpnbook.com\";\"us2.vpnbook.com\";\"ca1.vpnbook.com\";\"de233.vpnbook.com\";\"fr1.vpnbook.com\"} #:if ([:typeof $VPNBookServerAddresses] != \"array\") do={ #  :set VPNBookServerAddresses {\"euro217.vpnbook.com\";\"euro214.vpnbook.com\";\"us1.vpnbook.com\";\"us2.vpnbook.com\";\"ca1.vpnbook.com\";\"de233.vpnbook.com\"} #}  :global VPNBookErr false :global VPNBookPassFile \"VPNBookPass.txt\" :global VPNBookPass :global VPNBookRun #:global TToken \"4.....................2\" #:global TChatId \"2342432...9\"   :global VPNBookServerIndex :if ([:typeof $VPNBookServerIndex] != \"num\") do={:set VPNBookServerIndex 0}  :if ([\/interface pptp-client get $VPNBookpIfName running]) do={   :set VPNBookRun true } else {   :if (!$VPNBookRun) do={     :set VPNBookServerIndex ($VPNBookServerIndex + 1)     :if ($VPNBookServerIndex&gt;=[:len $VPNBookServerAddresses]) do={:set VPNBookServerIndex 0}   } else {     :set VPNBookRun false   }   :if (![\/interface pptp-client get $VPNBookpIfName disabled]) do={\/interface pptp-client set $VPNBookpIfName disabled=yes}   :do {\/tool fetch url=\"http:\/\/server\/vpnbookpass.php\" dst-path=$VPNBookPassFile} on-error={:set VPNBookErr true}   :delay 2   :do {:set VPNBookPass [\/file get $VPNBookPassFile contents]} on-error={:set VPNBookErr true}   :if (!$VPNBookErr) do={     :if ([\/interface pptp-client get $VPNBookpIfName password] != $VPNBookPass) do={\/interface pptp-client set $VPNBookpIfName password=$VPNBookPass}     :if ([\/interface pptp-client get $VPNBookpIfName connect-to] != $VPNBookServerAddresses-&gt;$VPNBookServerIndex) do={\/interface pptp-client set $VPNBookpIfName connect-to=($VPNBookServerAddresses-&gt;$VPNBookServerIndex)}     :log info (\"VPNBook: Attempt to connect to: \".($VPNBookServerAddresses-&gt;$VPNBookServerIndex).\". Password: $VPNBookPass\") #    \/tool fetch url=(\"https:\/\/api.telegram.org\/bot$TToken\/sendmessage\\?chat_id=$TChatId&amp;text=VPNBook: Attempt to connect to: \".($VPNBookServerAddresses-&gt;$VPNBookServerIndex).\". Password: $VPNBookPass\") keep-result=no     \/interface pptp-client set $VPNBookpIfName disabled=no   } }<\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 PPTP \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u043e \u0440\u0430\u0437\u0440\u044b\u0432\u0443 \u0441\u0432\u044f\u0437\u0438 (\u0441\u043e\u0431\u044b\u0442\u0438\u0435 on-down) \u0432 PPP-\u043f\u0440\u043e\u0444\u0438\u043b\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0444\u043b\u0443\u0434\u0438\u043b\u043e \u0434\u0430\u0436\u0435 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 1 \u043c\u0438\u043d\u0443\u0442\u044b. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 1 \u043c\u0438\u043d\u0443\u0442\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u0442 pptp-out1 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435.  <\/p>\n<pre><code class=\"bash\">add change-tcp-mss=yes name=VPNBook on-down=\\     \":if (![\/interface pptp-client get pptp-out1 disabled]) do={\\r\\     \\n  \/interface pptp-client set pptp-out1 disabled=yes\\r\\     \\n}\" only-one=yes use-compression=yes use-encryption=required use-ipv6=no use-mpls=no use-upnp=no<\/code><\/pre>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/420373\/\"> https:\/\/habr.com\/post\/420373\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420373\/\" class=\"post__text post__text-html js-mediator-article\">\u041d\u0435\u0434\u0430\u0432\u043d\u043e VPNBook \u0441\u0442\u0430\u043b \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u00ab\u041d\u0443 \u043a\u0430\u043a \u0436\u0435 \u0442\u0430\u043a\u00bb \u2014 \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u044f \u0438 \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0443\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u043c \u00ab\u043a\u0430\u0440\u0442\u0438\u043d\u043e\u0447\u043d\u044b\u0439\u00bb \u043f\u0430\u0440\u043e\u043b\u044c VPNBook \u043d\u0430 PHP. \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f Mikrotik.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-288132","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288132"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288132\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}