├── README.md └── hashCracker.ipynb /README.md: -------------------------------------------------------------------------------- 1 | # Colab Tools 2 | 3 | Prevent runtime disconnect: 4 | ``` 5 | function clickConnect() { 6 | document.querySelector("colab-connect-button").click() 7 | console.log("Reconnected notebook."); 8 | } 9 | setInterval(clickConnect,60000) 10 | ``` 11 | -------------------------------------------------------------------------------- /hashCracker.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "colab_type": "text", 7 | "id": "view-in-github" 8 | }, 9 | "source": [ 10 | "\"Open" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": { 16 | "colab_type": "text", 17 | "id": "UfthDW0MhmDx" 18 | }, 19 | "source": [ 20 | "## Set up tools\n", 21 | "\n", 22 | "---\n", 23 | "\n" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": null, 29 | "metadata": { 30 | "colab": {}, 31 | "colab_type": "code", 32 | "id": "enb0qhe4DnJC" 33 | }, 34 | "outputs": [], 35 | "source": [ 36 | "# install hashcat and dependencies\n", 37 | "!git clone https://github.com/hashcat/hashcat.git && cd hashcat && make -j `nproc` && make install " 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": null, 43 | "metadata": { 44 | "colab": {}, 45 | "colab_type": "code", 46 | "id": "NX3Dw2GC7K4-" 47 | }, 48 | "outputs": [], 49 | "source": [ 50 | "# benchmark hashcat\n", 51 | "!hashcat -m 2500 -w 4 -b" 52 | ] 53 | }, 54 | { 55 | "cell_type": "markdown", 56 | "metadata": { 57 | "colab_type": "text", 58 | "id": "rq-3WD56B6ea" 59 | }, 60 | "source": [ 61 | "## Upload wordlist\n", 62 | "\n", 63 | "\n", 64 | "---\n", 65 | "\n" 66 | ] 67 | }, 68 | { 69 | "cell_type": "markdown", 70 | "metadata": { 71 | "colab_type": "text", 72 | "id": "x5QqfRnfOdag" 73 | }, 74 | "source": [ 75 | "Upload custom wordlist\n" 76 | ] 77 | }, 78 | { 79 | "cell_type": "code", 80 | "execution_count": null, 81 | "metadata": { 82 | "colab": {}, 83 | "colab_type": "code", 84 | "id": "hInGz29HJuXU" 85 | }, 86 | "outputs": [], 87 | "source": [ 88 | "#upload to runtime only (deletes after session closed)\n", 89 | "from google.colab import files\n", 90 | "uploaded = files.upload()\n", 91 | "\n", 92 | "for fn in uploaded.keys(): filename = fn" 93 | ] 94 | }, 95 | { 96 | "cell_type": "markdown", 97 | "metadata": { 98 | "colab_type": "text", 99 | "id": "Hu1V0RsNNomM" 100 | }, 101 | "source": [ 102 | "Download wordlist from internet" 103 | ] 104 | }, 105 | { 106 | "cell_type": "code", 107 | "execution_count": null, 108 | "metadata": { 109 | "colab": {}, 110 | "colab_type": "code", 111 | "id": "HHv4ADESNmzG" 112 | }, 113 | "outputs": [], 114 | "source": [ 115 | "# download wordlist to runtime (deletes after session closed)\n", 116 | "!wget https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-10000.txt -O top10000.txt\n", 117 | "filename = \"top10000.txt\"" 118 | ] 119 | }, 120 | { 121 | "cell_type": "markdown", 122 | "metadata": { 123 | "colab_type": "text", 124 | "id": "30OYnoN956D6" 125 | }, 126 | "source": [ 127 | "Upload wordlists to Drive for persistent use " 128 | ] 129 | }, 130 | { 131 | "cell_type": "code", 132 | "execution_count": null, 133 | "metadata": { 134 | "colab": {}, 135 | "colab_type": "code", 136 | "id": "Sur_3ogRMw10" 137 | }, 138 | "outputs": [], 139 | "source": [ 140 | "#upload wordlist to Drive (saves wordlist for later sessions)\n", 141 | "\n", 142 | "#authenticate user\n", 143 | "from pydrive.auth import GoogleAuth\n", 144 | "from pydrive.drive import GoogleDrive\n", 145 | "from google.colab import auth\n", 146 | "from oauth2client.client import GoogleCredentials\n", 147 | "import os\n", 148 | "\n", 149 | "auth.authenticate_user()\n", 150 | "gauth = GoogleAuth()\n", 151 | "gauth.credentials = GoogleCredentials.get_application_default()\n", 152 | "drive = GoogleDrive(gauth)\n", 153 | "\n", 154 | "with open(filename,\"r\") as file:\n", 155 | " file_drive = drive.CreateFile({'title':os.path.basename(file.name) }) \n", 156 | " file_drive.SetContentString(file.read()) \n", 157 | " file_drive.Upload()" 158 | ] 159 | }, 160 | { 161 | "cell_type": "markdown", 162 | "metadata": { 163 | "colab_type": "text", 164 | "id": "DyrTfSlg6IFo" 165 | }, 166 | "source": [ 167 | "## Mount Google Drive\n", 168 | "\n", 169 | "---\n", 170 | "\n" 171 | ] 172 | }, 173 | { 174 | "cell_type": "code", 175 | "execution_count": null, 176 | "metadata": { 177 | "colab": {}, 178 | "colab_type": "code", 179 | "id": "V0-1wIjU6HHG" 180 | }, 181 | "outputs": [], 182 | "source": [ 183 | "# mount Drive to access files\n", 184 | "from google.colab import drive\n", 185 | "drive.mount('/content/drive')" 186 | ] 187 | }, 188 | { 189 | "cell_type": "markdown", 190 | "metadata": { 191 | "colab_type": "text", 192 | "id": "pUQ3mFxMCBf4" 193 | }, 194 | "source": [ 195 | "## Upload file to crack\n", 196 | "\n", 197 | "\n", 198 | "---\n", 199 | "\n" 200 | ] 201 | }, 202 | { 203 | "cell_type": "code", 204 | "execution_count": null, 205 | "metadata": { 206 | "colab": {}, 207 | "colab_type": "code", 208 | "id": "t3Jb5AunBxck" 209 | }, 210 | "outputs": [], 211 | "source": [ 212 | "#file only saves to runtime, deletes after session is closed\n", 213 | "from google.colab import files\n", 214 | "uploaded = files.upload()" 215 | ] 216 | }, 217 | { 218 | "cell_type": "markdown", 219 | "metadata": { 220 | "colab_type": "text", 221 | "id": "jNxMNePSQYy_" 222 | }, 223 | "source": [ 224 | "## Crack it!\n", 225 | "\n", 226 | "---\n", 227 | "\n" 228 | ] 229 | }, 230 | { 231 | "cell_type": "markdown", 232 | "metadata": { 233 | "colab_type": "text", 234 | "id": "51ni-QAuCPax" 235 | }, 236 | "source": [ 237 | "*check GitHub for runtime clicker code*" 238 | ] 239 | }, 240 | { 241 | "cell_type": "markdown", 242 | "metadata": { 243 | "colab_type": "text", 244 | "id": "MpE3-B-8hWcQ" 245 | }, 246 | "source": [ 247 | "Setup SSH (full Linux environment, better for long sessions)" 248 | ] 249 | }, 250 | { 251 | "cell_type": "code", 252 | "execution_count": null, 253 | "metadata": { 254 | "colab": {}, 255 | "colab_type": "code", 256 | "id": "ZWY9ORu2hOL1" 257 | }, 258 | "outputs": [], 259 | "source": [ 260 | "# sign up for Ngrok first\n", 261 | "!pip install git+https://github.com/demotomohiro/remocolab.git\n", 262 | "import remocolab\n", 263 | "remocolab.setupSSHD()" 264 | ] 265 | }, 266 | { 267 | "cell_type": "code", 268 | "execution_count": null, 269 | "metadata": { 270 | "colab": {}, 271 | "colab_type": "code", 272 | "id": "Z5lDhjaQiiSy" 273 | }, 274 | "outputs": [], 275 | "source": [ 276 | "!/bin/bash # invokes bash shell, but input is hidden" 277 | ] 278 | }, 279 | { 280 | "cell_type": "markdown", 281 | "metadata": { 282 | "colab_type": "text", 283 | "id": "0KpU8mC8iDaW" 284 | }, 285 | "source": [ 286 | "Put code below to run!" 287 | ] 288 | }, 289 | { 290 | "cell_type": "code", 291 | "execution_count": null, 292 | "metadata": { 293 | "colab": {}, 294 | "colab_type": "code", 295 | "id": "JbATZbP-Ql-D" 296 | }, 297 | "outputs": [], 298 | "source": [ 299 | "!hashcat -m 2500 -w 4 fileToCrack.txt wordlist.txt " 300 | ] 301 | } 302 | ], 303 | "metadata": { 304 | "accelerator": "GPU", 305 | "colab": { 306 | "collapsed_sections": [], 307 | "include_colab_link": true, 308 | "name": "test.ipynb", 309 | "provenance": [], 310 | "toc_visible": true 311 | }, 312 | "kernelspec": { 313 | "display_name": "Python 3", 314 | "language": "python", 315 | "name": "python3" 316 | }, 317 | "language_info": { 318 | "codemirror_mode": { 319 | "name": "ipython", 320 | "version": 3 321 | }, 322 | "file_extension": ".py", 323 | "mimetype": "text/x-python", 324 | "name": "python", 325 | "nbconvert_exporter": "python", 326 | "pygments_lexer": "ipython3", 327 | "version": "3.8.10" 328 | } 329 | }, 330 | "nbformat": 4, 331 | "nbformat_minor": 1 332 | } 333 | --------------------------------------------------------------------------------