Skip to content

Commit

Permalink
Updated robots
Browse files Browse the repository at this point in the history
  • Loading branch information
Acrylami committed Oct 11, 2020
1 parent cf4c21d commit 85227ef
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 42 deletions.
7 changes: 4 additions & 3 deletions cyber/static/robots.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Hey! What are you doing snooping around here!
# I sure hope you don't visit that secret site...

User-agent: Googlebot-Image
Disallow: /

User-agent: *
Disallow: /secret.html

Hey! What are you doing snooping around here! I sure hope you don't visit that secret site...
Disallow: /secret.html
67 changes: 28 additions & 39 deletions cyber/templates/training/robots/robots-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,42 @@
<div class="row">
<div class="card training_background">

<!-- TRAINING HEADER (Args: Category, training name, points, image, background class=default "new-colour" so can be left empty) -->
<!-- TRAINING HEADER (Args: Category, training name, points, t_name for image, background class=default "new-colour" so can be left empty) -->
{% call training_header("Web Hacking", training.display_name, training.points, training.training_name, "sky-blue") %}
{% endcall %}
<!-- TRAINING HEADER -->

<div class="">
<div class="card-body training_card">

<p>This training is all about editing the HTML source code of a website. If you haven't already completed the <a href="{{ url_for('training_page_redirect', training_name='inspecting-source', page=1)}}">"Inspecting Source" training, we recommend you do that first.</a></p>


<h2>How?</h2>
<p>Here's a quick refresher- there are a few ways you can view the source code of a website:</p>
<ul>
<li>Pressing the F12 key on your keyboard</li>
<li>Right clicking the part of the page (element) you want to inspect, then clicking "Inspect"</li>
<li>Right clicking the page, then clicking "View Page Source"</li>
</ul>
<p>For this training, the second way is what we will be using. It should look a little something like this.</p>

<img class="img-fluid img-thumbnail mx-auto d-block" src="{{ url_for('static', filename='img/web-hacking/inspect-demo.png') }}">

<p>When inspecting an element of source code, we can edit it's values to change how it behaves. This allows us to do all sorts of hacky things like allowing us to change text, use disabled fields, and find hidden buttons.</p>

<p>Try editing this paragraph to say anything you want! Right click, inspect element, click the dropdown arrows, then double click the text inside the &lt;p&gt; &lt;/p&gt; tags and type your message.</p>

<img class="img-fluid demo-gif img-thumbnail mx-auto d-block" src="{{ url_for('static', filename='img/web-hacking/edit-paragraph.gif') }}">

<p>The changes you make this way are only temporary so will not save if you refresh the page. But it can be fun to edit your favourite sites this way and it’s a cool way to prank your friends. Here’s an example of editing the headline and image code on a new article…</p>
<img class="img-fluid img-thumbnail mx-auto d-block" src="{{ url_for('static', filename='img/web-hacking/killer-pandas.png') }}">
<h2>Robots.txt</h2>
<p>Have you ever heard of robots.txt? This is a file that can be found on almost all website. To get there, you just add <code>/robots.txt</code> the the URL of a website.</p>
<p><a href="https://www.youtube.com/robots.txt" target="_blank">Have a look at YouTube's robot.txt file</a>, or visit your own favourite website and see if it has a robots.txt file.</p>

<p>Which of these URLs would be the right way to get to the robots.txt of the BBC website?</p>
<div class="table-responsive">
<table class="table">
<tr>
<td class="text-center"><button type="button" class="btn btn-default quiz" onclick="wrong()">https://www.bbc.co.uk/robots/txt</button></td>
<td class="text-center"><button type="button" class="btn btn-default quiz" onclick="correct()">https://www.bbc.co.uk/robots.txt</button></td>
</tr>
<tr>
<td class="text-center"><button type="button" class="btn btn-default quiz" onclick="wrong()">https://www.bbc.co.uk/robots.text</button></td>
<td class="text-center"><button type="button" class="btn btn-default quiz" onclick="wrong()">https://www.bbc.co.uk/robot.txt</button></td>
</tr>
</table>
</div>


<p>Next we're going to talk about what robots.txt is used for, and delve into how search engines do their job.</p>
</div>
</div>
</div>
</div>

<!-- MINI CHALLENGE (Args: Text, hint) -->
{% call mini_challenge("Edit this line to say only 'cat' and then push the button below.", "Right click the above text, select inspect element, then double click the p element and type the word 'cat'. Watch the demonstration clip above to show you how.") %}
{% endcall %}
<!-- END MINI CHALLENGE -->

<!-- PAGE NAV (Args: Current page passed from routes.py, training name passed from routes.py, total number of pages) -->
{% call pagination(current_page, training.training_name, 4) %}
{% call pagination(current_page, training.training_name, 3) %}
{% endcall %}
<!-- END PAGE NAV -->

Expand All @@ -59,17 +53,12 @@ <h2>How?</h2>


<script>
function mini_challenge() {

if (document.getElementById("mini-challenge-prompt").innerHTML.toUpperCase() == "CAT") {
swal("Nice!", "That's correct, well done", "success", {
button: "Next",
});
} else {
swal("Not quite!", "Make sure you're editing the right text, it should be the paragraph inside the challenge box, and it should only say 'cat'", "error", {
button: "Return"
});
}
function wrong() {
swal("Oops", "Not quite! Have another look at the example", "error")
}

function correct() {
swal("Nice!", "You've got it!", "success")
}

</script>
Expand Down

0 comments on commit 85227ef

Please sign in to comment.