Skip to content

Instantly share code, notes, and snippets.

@MikeShi42
Last active January 18, 2018 19:26
Show Gist options
  • Save MikeShi42/dc0d51380d2ed3ba42161b21bb5c0dd1 to your computer and use it in GitHub Desktop.
Save MikeShi42/dc0d51380d2ed3ba42161b21bb5c0dd1 to your computer and use it in GitHub Desktop.
xss ipynb test
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "xss.ipynb",
"version": "0.3.2",
"views": {},
"default_view": {},
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python2",
"display_name": "Python 2"
}
},
"cells": [
{
"metadata": {
"id": "7PYNnbB4KB2p",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
],
"base_uri": "https://localhost:8080/",
"height": 17
},
"outputId": "a9195298-1db9-4ab8-9271-f750a398fead",
"executionInfo": {
"status": "ok",
"timestamp": 1516260321614,
"user_tz": 480,
"elapsed": 376,
"user": {
"displayName": "Michael Shi",
"photoUrl": "//lh4.googleusercontent.com/-vyDEb4UIwK4/AAAAAAAAAAI/AAAAAAAAADU/YNyADYHkB3E/s50-c-k-no/photo.jpg",
"userId": "107241869691870174640"
}
}
},
"source": [
"%%javascript\n",
"console.log('hello!')"
],
"cell_type": "code",
"execution_count": 1,
"outputs": [
{
"output_type": "display_data",
"data": {
"application/javascript": [
"console.log('hello!')"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "F98aKYX4KGd-",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
],
"base_uri": "https://localhost:8080/",
"height": 17
},
"outputId": "196c8cf4-d1d8-4b67-84f6-607170917e74",
"executionInfo": {
"status": "ok",
"timestamp": 1516260338963,
"user_tz": 480,
"elapsed": 323,
"user": {
"displayName": "Michael Shi",
"photoUrl": "//lh4.googleusercontent.com/-vyDEb4UIwK4/AAAAAAAAAAI/AAAAAAAAADU/YNyADYHkB3E/s50-c-k-no/photo.jpg",
"userId": "107241869691870174640"
}
}
},
"source": [
"%%javascript\n",
"alert('hacked!')"
],
"cell_type": "code",
"execution_count": 2,
"outputs": [
{
"output_type": "display_data",
"data": {
"application/javascript": [
"alert('hacked!')"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "W4OUURWqKKtG",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
],
"base_uri": "https://localhost:8080/",
"height": 17
},
"outputId": "1a0fe7b8-47c6-4104-f13c-9cf82762072e",
"executionInfo": {
"status": "ok",
"timestamp": 1516260357268,
"user_tz": 480,
"elapsed": 373,
"user": {
"displayName": "Michael Shi",
"photoUrl": "//lh4.googleusercontent.com/-vyDEb4UIwK4/AAAAAAAAAAI/AAAAAAAAADU/YNyADYHkB3E/s50-c-k-no/photo.jpg",
"userId": "107241869691870174640"
}
}
},
"source": [
"%%javascript\n",
"console.log(localStorage)"
],
"cell_type": "code",
"execution_count": 3,
"outputs": [
{
"output_type": "display_data",
"data": {
"application/javascript": [
"console.log(localStorage)"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "tlIC7XHtKPKO",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
],
"base_uri": "https://localhost:8080/",
"height": 17
},
"outputId": "a4d1ed56-f4f9-47d4-9288-23d319bab8a8",
"executionInfo": {
"status": "ok",
"timestamp": 1516260399336,
"user_tz": 480,
"elapsed": 644,
"user": {
"displayName": "Michael Shi",
"photoUrl": "//lh4.googleusercontent.com/-vyDEb4UIwK4/AAAAAAAAAAI/AAAAAAAAADU/YNyADYHkB3E/s50-c-k-no/photo.jpg",
"userId": "107241869691870174640"
}
}
},
"source": [
"%%javascript\n",
"console.log(document.cookie)"
],
"cell_type": "code",
"execution_count": 6,
"outputs": [
{
"output_type": "display_data",
"data": {
"application/javascript": [
"console.log(document.cookie)"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "yaS82Iz4KUpQ",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
],
"base_uri": "https://localhost:8080/",
"height": 81
},
"outputId": "aefc43a0-b543-470a-9cc4-d5bb4992f95d",
"executionInfo": {
"status": "ok",
"timestamp": 1516303555342,
"user_tz": 480,
"elapsed": 324,
"user": {
"displayName": "Michael Shi",
"photoUrl": "//lh4.googleusercontent.com/-vyDEb4UIwK4/AAAAAAAAAAI/AAAAAAAAADU/YNyADYHkB3E/s50-c-k-no/photo.jpg",
"userId": "107241869691870174640"
}
}
},
"source": [
"%%html\n",
"<h2>Hello World!</h2>\n",
"<script>alert('hello world!')</script>\n",
"<b onmouseover=alert('Wufff!')>click me!</b>"
],
"cell_type": "code",
"execution_count": 4,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<h2>Hello World!</h2>\n",
"<script>alert('hello world!')</script>\n",
"<b onmouseover=alert('Wufff!')>click me!</b>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "cmhgtIS2uWQn",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
},
"source": [
""
],
"cell_type": "code",
"execution_count": 0,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment