{"id":15134059,"url":"https://github.com/defasium/vkcaptchabreaker","last_synced_at":"2025-09-19T01:10:20.724Z","repository":{"id":46125292,"uuid":"309011668","full_name":"Defasium/vkCaptchaBreaker","owner":"Defasium","description":"VKontakte captcha bypass with pseudoCRNN model running as a chrome extension, Python, JS, 2020","archived":false,"fork":false,"pushed_at":"2021-11-12T11:29:08.000Z","size":15389,"stargazers_count":72,"open_issues_count":7,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T15:53:41.542Z","etag":null,"topics":["browser-extension","captcha","captcha-breaking","captcha-recognition","captcha-solving","chrome-extension","firefox-addon","firefox-webextension","javascript","keras","onnx","python","vkontakte"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Defasium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-01T02:50:25.000Z","updated_at":"2024-12-05T14:57:13.000Z","dependencies_parsed_at":"2022-09-06T13:11:41.456Z","dependency_job_id":null,"html_url":"https://github.com/Defasium/vkCaptchaBreaker","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Defasium/vkCaptchaBreaker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Defasium%2FvkCaptchaBreaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Defasium%2FvkCaptchaBreaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Defasium%2FvkCaptchaBreaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Defasium%2FvkCaptchaBreaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Defasium","download_url":"https://codeload.github.com/Defasium/vkCaptchaBreaker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Defasium%2FvkCaptchaBreaker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275862875,"owners_count":25541903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser-extension","captcha","captcha-breaking","captcha-recognition","captcha-solving","chrome-extension","firefox-addon","firefox-webextension","javascript","keras","onnx","python","vkontakte"],"created_at":"2024-09-26T05:02:14.324Z","updated_at":"2025-09-19T01:10:20.678Z","avatar_url":"https://github.com/Defasium.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vkCaptchaBreaker\nUse this VKontakte captcha breaker with 91% accuracy right in browser with chrome extension, Python, JS, 2020\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/vkcaptcha.gif\" alt=\"title\" width=\"100%\"/\u003e    \n\u003c/p\u003e\n\n### HTML Live Demo from above picture: [__🔥DEMO🔥__](https://csb-so9x3.netlify.app/)\n\n### Code \u003cimg src=\"assets/codesandbox_icon.png\" alt=\"CodeSandbox\" height='24px'\u003e Sandbox for HTML with ONNX.js+ONNXruntimeWeb: [__vk-captcha-breaker__](https://codesandbox.io/s/vk-captcha-breaker-inxnl?file=/index.html)\n\n_Images in Demo or Sandbox are broken? [__Solution__](https://github.com/Defasium/vkCaptchaBreaker/issues/3)_\n\n### Extension can be downloaded here:\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://chrome.google.com/webstore/detail/eddkhdhajafifjjliglooomfcmghflfa\"\u003e\n    \u003cimg src=\"assets/chrome-webstore.png\" alt=\"Chrome Web Store\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://addons.mozilla.org/firefox/addon/vkcaptcha\"\u003e\n    \u003cimg src=\"assets/firefox-addons.png\" alt=\"Firefox add-ons\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Defasium/vkCaptchaBreaker/releases\"\u003e\n    \u003cimg src=\"assets/github-release.png\" alt=\"GitHub Releases\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n### Recognition speed comparison on different devices with different CPU specs (in milliseconds):\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/speed.png\" alt=\"Recognition speed comparison on different devices\"/\u003e\n\u003c/p\u003e\n\n____\n\n## Table of Contents\n  * [Features](#features)\n  * [Installation](#installation)\n    * [Windows/Linux/MacOS](#windowslinuxmacos)\n    * [Android](#android)\n  * [Description](#description)\n  * [DataMining](#datamining)  \n  * [ONNXTroubles](#onnxtroubles)\n  * [Results](#results)\n  * [Sources](#sources)\n____\n## Features\n\nCurrently supported actions (on mobile domain m.vk.com only):\n* messages ✉️ \n* likes ❤️\n* comments 💬\n* adding to friends 🧑‍🤝‍🧑\n\nPlease, note that captcha on login page and promocode page is not supported!\n\n## Installation\n\n# \u003cspan style=\"color:red\"\u003eUpdate v1.6: 30% faster, CORS is no longer a problem \u003c/span\u003e\n\u003cspan style=\"color:red\"\u003eUpdate v1.5: recognition in background, Firefox addon \u003c/span\u003e\n\n\u003cspan style=\"color:red\"\u003eUpdate v1.4: added support for other captcha scenarios\u003c/span\u003e\n\n\u003cspan style=\"color:red\"\u003eUpdate v1.3: now it works for mobile domain only (m.vk.com)\u003c/span\u003e\n\nGoogle Chrome Extension and Firefox Addon for VKontakte which utilizes trained AI models to predict captcha from image and automatically enters it.\n\n~~Currently only captcha from messages are supported (no likes or comments for you, my bad)~~\n\nYou can download latest version from: [__VKCaptchaBreaker.crx__](https://github.com/Defasium/vkCaptchaBreaker/releases)\n\n\n### Windows/Linux/MacOS\n\nTo install the extension, simply follow this tutorial:\n\n* For Chrome: [__www.cnet.com/how-to/how-to-install-chrome-extensions-manually__](https://www.cnet.com/how-to/how-to-install-chrome-extensions-manually/)\n\n* For Firefox: [__www.muo.com/tag/how-to-install-firefox-add-ons-manually-even-from-github__](https://www.muo.com/tag/how-to-install-firefox-add-ons-manually-even-from-github/)\n\nFinally, activate it:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/chrome_activate.gif\" alt=\"title\" width=\"35%\"/\u003e\n\u003c/p\u003e\n\n### Android\n\nTo install the extension, simply follow this tutorial:\n\n[__qwikfone.medium.com/how-to-install-chrome-extension-on-android-3cd89f3a771c__](https://qwikfone.medium.com/how-to-install-chrome-extension-on-android-3cd89f3a771c)\n\nInstallation and activation example:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/android_activate.gif\" alt=\"title\" width=\"35%\"/\u003e\n\u003c/p\u003e\n\nIf something won't work, just reactivate extension.\n\n____\n## Description\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/vkcaptchaformat.png\" alt=\"vkcaptchaformat\" width=\"100%\"/\u003e\n\u003c/p\u003e\n\nKeras implementation of Convolutional Recurrent Neural Network with [`ONNX.js`](https://github.com/microsoft/onnxjs) support.\nTo achieve better accuracy, [`CRNN`](python/crnn.py) utilizes CTC loss and Knowledge distillation with Label smoothing.\nCRNN comes in two versions: the one BIG with recurrent layers (RNNs)\nand the other small one without them.\n\nThe reason for doing so is that if we want to use trained models on end devices, such as\nMobile devices/Client-side browsers, we want to get a model with a minimum number of parameters.\n\nFor the BIG version, Google's Inception-like CNN encoder is used with Bidirectional GRUs as RNN decoder.\nFor the small version, the ShuffleNetV2 encoder is used with 1d convs instead of RNN cells.\n\n____\n## DataMining\n\nTo parse captcha you can use any URL that Vkontakte provided, e.g. https://vk.com/captcha.php?sid=625944628258\u0026s=1\nHere `625944628258` is a random seed.\nIt's important to mention that some seeds will generate old captchas with Cyrillic symbols.\nUsing URLs with different seeds over 1.5 million images was parsed.\n\nAt first 5000 captcha's was manually labelled (that process take approximately 1 year).\nThus, an initial dataset was created, let's call it Dataset5k.\nNext, on this dataset, BIG CRNN was trained and achieved 80% accuracy on unseen data.\nAfter that using Vkontakte account without phone verification more images were automatically labelled online.\nThus, a new dataset was created, and the process continues.\n\nAfter achieving 99% accuracy with BIG CRNN model, it was used for labelling the rest of 1.5 million images offline.\nDatasets with 850k images and 1500k images were constructed this way.\nThis huge \"filthy\" datasets (implying that there are mistakes in predictions) were used for training small pseudoCRNN model.\n\n____\n## ONNXTroubles\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/onnx/onnx/master/docs/ONNX_logo_main.png\" alt=\"onnxlogo\" width=\"100%\"/\u003e\n\u003c/p\u003e\n\nUnfortunately, in the case of using models on Client-side, e.g. with JavaScript, existing frameworks (Open Neural Network Exchange (ONNX.js)) does not support RNNs.\nThe only one which supports them is Tensorflow.js, but it is slower.\nIt's important to note that RNNs also are quite slow due to its nature.\n\nTo mitigate this problem this project introduces a small pseudoCRNN architecture without RNN blocks. Instead of bidirectional Gated Recurrent Units (GRU) as in the BIG version, it uses one-dimensional convolutions. \nOther troubles:\n * Can't use dynamic reshaping, e.g Reshape(None, -1, 32) will crash\n * Can't use 1d Convolutions, instead, the following trick was used:\n \n (None, 32, 128) --Reshape--\u003e (None, 32, 1, 128) --Conv2d--\u003e (None, 32, 1, filters) --Reshape--\u003e (None, 32, filters)\n * Can't use Droupout, it's important to reconstruct model without this layer\n * Can't use Casting operation in ONNX.js, e.g. INT32 -\u003e FLOAT32 conversion\n * Can't use Ragged Tensors in ONNX.js, e.g. for CTC algorithm\n * Can't use tf.where, because Nonzero is not implemented in ONNX.js\n \nYou can check the list of supported operators in ONNX.js [`HERE`](https://github.com/microsoft/onnxjs/blob/master/docs/operators.md)\n\nONNX is a great thing, but its JavaScript Framework needs more attention from Microsoft developers.\n\nAs a result, in the next project, Tensorflow.js should be used instead of ONNX.js\n\n____\n## Results\n\nAfter [`training`](python/FilthyCaptchaLearning.ipynb) on 1.5 Million filthy labeled captcha for 300k steps, the [__student model__](https://github.com/Defasium/models/blob/main/captcha_model.onnx) achieved ~90% accuracy (while teacher accuracy was 99%)\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/smallKD30_280k.png\" alt=\"training on filthy data\"/\u003e\n\u003c/p\u003e\n\nComparision:\n\n|Model|Dataset Size|Steps|Knowledge Distillation, %|Accuracy, %|Size, MB|Images/sec|\n|:--------------|:--:|:--:|:--:|---:|---:|---:|\n|BIG CRNN|5k|70k|-|80|66|~284|\n|BIG CRNN|16k|70k|-|93|66|~284|\n|BIG CRNN|40k|70k|-|__98.9__|66|~284|\n|small pseudoCRNN|40k|70k|-|64|4|~2155|\n|small pseudoCRNN|850k*|70k|-|82|4|~2155|\n|small pseudoCRNN|850k*|70k|50|83|4|~2155|\n|small pseudoCRNN|1.5M*|140k|50|86.7|4|~2155|\n|small pseudoCRNN|1.5M*|280k|30|91.2|__4**__|__~2155__|\n\n\\* - means that dataset was made with filthy labels from the teacher\n\n\\** - after conversion the final size of the model is 1 MB\n\nThus, you can achieve up to 10 times faster inference time with the small version.\n\nOptimized pseudoCRNN student architecture after [`convertion to ONNX format`](python/onnx_crnn_conversion.py):\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/captcha_model.onnx.png\" alt=\"architecture\"/\u003e\n\u003c/p\u003e\n\n____\n\n## Sources\n\nThis project was inspired by number-plate recognition work and uses its modified version of CRNN implementation, [@RIA.com](https://github.com/ria-com/nomeroff-net).\n\nONNX.js reference example, created by [@elliotwaite](https://github.com/elliotwaite/pytorch-to-javascript).\n\nFor small pseudoCRNN CNN encoder, this system uses a modified version of ShuffleNetV2, implemented by [@opconty](https://github.com/opconty/keras-shufflenetV2).\n\nTensorflow Dataset class with caching implementation is the modified version of [@krasserm](https://github.com/krasserm/super-resolution).\n\nFor the model's graph visualization was used the `Netron` application, by [@lutzroeder](https://github.com/lutzroeder/netron)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefasium%2Fvkcaptchabreaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefasium%2Fvkcaptchabreaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefasium%2Fvkcaptchabreaker/lists"}