Skip to content

Instantly share code, notes, and snippets.

@absane
Created June 15, 2020 21:30
Show Gist options
  • Select an option

  • Save absane/5790c5b66fb2513d86f68e191823dee0 to your computer and use it in GitHub Desktop.

Select an option

Save absane/5790c5b66fb2513d86f68e191823dee0 to your computer and use it in GitHub Desktop.
Penglab-custom
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Penglab.ipynb",
"provenance": [],
"collapsed_sections": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/chvancooten/59acfbf1d8ee7a865108fca2e9d04c4a/penglab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "vp4LSKizX-8E",
"colab_type": "code",
"colab": {}
},
"source": [
"#Penglab (Abuse of Google Colab for fun and profit)\n",
"\n",
"#Choose what you want to install\n",
"ssh = False\n",
"hashcat = True\n",
"john = False\n",
"hydra = False"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "nkcgYemCZA2n",
"colab_type": "code",
"outputId": "37edec9d-0b9f-4fe1-9f04-4d90f4bce2f6",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
}
},
"source": [
"#Install of hashcat\n",
"if hashcat:\n",
" print(\"Installation of hashcat...\")\n",
" !apt install cmake build-essential -y\n",
" !apt install checkinstall git -y\n",
" !git clone https://github.com/hashcat/hashcat.git && cd hashcat && make && make install"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
""
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "lJ4ftp1ua3e9",
"colab_type": "code",
"outputId": "eec31538-85d9-41e0-a025-da610108bc50",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 550
}
},
"source": [
"#Install of john\n",
"if john:\n",
" print(\"Installation of john...\")\n",
" !apt-get install john -y"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
""
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "nYd0hAxYdSJs",
"colab_type": "code",
"outputId": "6aa4927c-e37f-45b7-d4d4-26d7bc8fe2c6",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
}
},
"source": [
"#Install of hydra\n",
"if hydra:\n",
" print(\"Installation of hydra...\")\n",
" !apt install cmake build-essential -y\n",
" !apt install checkinstall git -y\n",
" !git clone https://github.com/vanhauser-thc/thc-hydra.git && cd thc-hydra && ./configure && make && make install"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
""
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "jEAKT-v2epH1",
"colab_type": "code",
"outputId": "cc3e8c7d-3ac8-4c55-925a-472f1b7cbc35",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 990
}
},
"source": [
"#Setting up SSH\n",
"if ssh:\n",
" print(\"Setting up SSH...\")\n",
" !pip install git+https://github.com/demotomohiro/remocolab.git\n",
" import remocolab\n",
" remocolab.setupSSHD()"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
""
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "T36b1MrhqCfB",
"colab_type": "code",
"colab": {}
},
"source": [
"# Get rockyou wordlist\n",
"## Run one-time\n",
"!wget https://github.com/praetorian-code/Hob0Rules/raw/master/wordlists/rockyou.txt.gz\n",
"!gunzip `pwd`/rockyou.txt.gz"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "teI1f7Nmque_",
"colab_type": "code",
"colab": {}
},
"source": [
"# Prepare hash\n",
"## Run one-time\n",
"!echo 'HASHHERE' > hash.txt"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "vjIivbizqk9V",
"colab_type": "code",
"colab": {}
},
"source": [
"# Crack\n",
"## Change hash mode and ruleset\n",
"!hashcat -a 0 -m 1000 hash.txt `pwd`/rockyou.txt --rules-file `pwd`/hashcat/rules/best64.rule\n",
"# !hashcat -a 3 -i hash.txt ?a?a?a?a?a?a?a?a?a?a?a?a"
],
"execution_count": 0,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment