diff --git a/lab-outline-and-ideas.txt b/lab-outline-and-ideas.txt new file mode 100644 index 0000000..47d7000 --- /dev/null +++ b/lab-outline-and-ideas.txt @@ -0,0 +1,114 @@ +COMP 210 2021 S2 Lab Schedule + +Lab 1 (Semester Week 2): HTTP (Hypertext Transfer Protocol) Operation and Security + Will need some basics - not all students will have an ICT background: + - Introduction to the lab environment (esp. Linux, command-line tools) + ...because the tools tend to be: cross-platform, extensible, transparent, and available gratis + Most of the labs will be hands-on computer-based practicals, but some may be more tutorial-style + - Layered network architecture, top-down a la the old INFO 214? + TCP/IP + suite vs stack + UDP vs TCP + IP as an unreliable infrastructure, more like the postal system than the telephone system + IP addressing and routing + Service ports + data link and physical layer (brief intro) + Dumb infrastructure, smarts at the outside edges + Emphasis on client/server operating mode + - MIME message format + - HTTP/TCP + Initial focus on HTTP because so much of the use of the Internet involves HTTP + request/response messages + MIME header format + - tcpflow, maybe insomnia or similar easy HTTP client + - SSL/TLS + - Introduce Web browser developer tools (Vivaldi and/or Chrome in labenv) + F12, Ctrl+Shift+I, Tools > Developer Tools in the browser's main menu + also More Tools > Security tab + Dev Tools: Network: Headers tab for a selected resource (may need to reload page) + Look at mix of secure and insecure items on Network tab (but also bear in mind that modern Web infrastructure is strongly leaning toward HTTPS for everything) + - webhook.site? + + - Maybe also introduce SMTP and illustrate how e-mail sending is negotiated between client and server. + + Sections (Tiddlywiki): + Introduction + Tiddlywiki + Lab Environment + Command-Line Environment + + Required tools for labenv: + [Y] Vivaldi/Chromium + [Y] curl + [Y] tcpflow + [Y] mkcert + + + Issues: + [ ] how to deploy certs to Tomcat?! + https://stackoverflow.com/questions/59479181/what-are-the-steps-to-configure-ssl-for-tomcat + https://tomcat.apache.org/tomcat-8.5-doc/ssl-howto.html + or, better: + https://tomcat.apache.org/tomcat-9.0-doc/ssl-howto.html + + * What was the lab (in INFO 201?) where we had the students deploy a Tomcat instance? That would have had useful starting files and instructions. + but the gist was something like + tomcat9-instance-create + + +tcpflow port 8080 + + +topic/mkcert + +there are root CA certs + + +aliases.d only exists under student profile (not infoadmin) + + but the sources are at /usr/local/home/aliases.d + so you can copy stuff manually from there if need be. + + (I assume that students will automatically get a ~/.aliases.d..??) + + +Note that nss trust store is used by the standard system browsers (but not Java). + + mkcert -install + +then + + mkcert localhost 127.0.0.1 + +and check that the cwd has two new files (pem) + +https://isgb.otago.ac.nz/infosci/mark.george/Wiki/wiki/mkcert%20and%20CA%20certificates + e.g. how to view installed certs + certutil -L -d /path/to/certs + e.g. + certutil -L -d ~/.pki/nssdb + PKI = Public Key Infrastructure + + vivaldi://settings/certificates + chrome://settings/certificates + + and look for org-mkcert development CA + +Note that NSS (https://en.wikipedia.org/wiki/Network_Security_Services) != NSS as in nsswitch.conf + +Lab 2 (Semester Week 3): + + + + + - Motivation: spambots on forums, etc. + + - Simple captcha demo + Very simple arithmetic example a la Community Roadwatch? + Maybe hook into Google's reCAPTCHA provider? + Reading: + https://www.theverge.com/2019/2/1/18205610/google-captcha-ai-robot-human-difficult-artificial-intelligence + https://www.cloudflare.com/en-gb/learning/bots/how-captchas-work/ + + - Credential-stuffing + https://www.cloudflare.com/en-gb/learning/bots/what-is-credential-stuffing/ diff --git a/terminal.png b/terminal.png new file mode 100644 index 0000000..79c3778 --- /dev/null +++ b/terminal.png Binary files differ diff --git a/tiddlers/content/labs/01/Lab01_00_TOC_Stuff_and_Things.tid b/tiddlers/content/labs/01/Lab01_00_TOC_Stuff_and_Things.tid deleted file mode 100644 index d9993c1..0000000 --- a/tiddlers/content/labs/01/Lab01_00_TOC_Stuff_and_Things.tid +++ /dev/null @@ -1,11 +0,0 @@ -tags: lab lab01 toc -title: /Labs/01/Lab 1: Stuff and Things -type: text/vnd.tiddlywiki - -
Click the <> button below to open all of the sections for this lab.
- -!! Contents -<$set name="path" value="/Labs/01/"> -<$macrocall $name="contents-tree" path=<> /> -
<$macrocall $name="openByPath" path=<> />
- diff --git a/tiddlers/content/labs/01/Lab01_01_Introduction.tid b/tiddlers/content/labs/01/Lab01_01_Introduction.tid deleted file mode 100644 index be55ad3..0000000 --- a/tiddlers/content/labs/01/Lab01_01_Introduction.tid +++ /dev/null @@ -1,7 +0,0 @@ -section: 1 -tags: lab01 lab -title: /Labs/01/Introduction -type: text/vnd.tiddlywiki - -Welcome to COMP210. - diff --git "a/tiddlers/content/labs/01/_Labs_01_Command-Line Interface \050CLI\051.md" "b/tiddlers/content/labs/01/_Labs_01_Command-Line Interface \050CLI\051.md" new file mode 100644 index 0000000..6ac574b --- /dev/null +++ "b/tiddlers/content/labs/01/_Labs_01_Command-Line Interface \050CLI\051.md" @@ -0,0 +1,38 @@ +{{/Labs/01/terminal.png}} + +Linux supports modern desktop-style graphical user interfaces, but it also provides a powerful textual shell or command-line interface (CLI). Such a command-driven interface might seem somewhat old-fashioned, but it has a number of benefits: + +* Commands can be precisely and concisely expressed as text. +* Commands can easily be recalled and modified during testing and development. +* Commands can easily be shared and replayed by yourself or others. +* Groups of commands can be saved in scripts or functions for flexible reuse. +* General programming features (variables, loops, conditionals, functions, etc.) are also available, allowing powerful automation of tasks. +* Input and output can be redirected to/from files, using the `>` and `<` operators. +* Commands can be combined into pipelines (where the output of one program is used as the input to another) for more complex operations. This is done using the `|` operator. + +Technically, the commands are initially parsed and processed by the shell, commonly `bash`, the "Bourne-again shell". Interactive shell input and output is handled by software such as Sakura or xterm that emulates an old-style [terminal](https://en.wikipedia.org/wiki/Computer_terminal). + +The basic interaction for the CLI is as follows: + +* If the prompt (usually `$`) is shown with the text cursor following it, the shell is ready for your input. +* Compose a line of text, and press Enter (or Return) to run it. The command name itself will be the first element, and other arguments such as settings flags or input/output file names may follow. +* If the command runs successfully, you might or might not see any output. Some commands (such as `mkdir` for creating a new directory or folder) work entirely by side-effects and do not normally produce any output. +* If there was an error, a message will normally be printed. Read and try to understand the error before proceeding. +* Whitespace is used to separate keywords (tokens) on the command line. Files or folders with names containing spaces can cause problems. You may have to resort to (single- or double-) quoting them or using the escape character, `\`, before the space. + +Some useful command-line tips and tricks: + +* The mouse will be of limited use, so get used to keeping your hands over the keyboard. The keyboard does provide some useful shortcuts, however. +* Use the Tab key to auto-complete the names of files, folders and commands. This helps avoid typos and misspellings, and is also a useful time-saver. You might have to press Tab repeatedly in some situations (e.g. if there are multiple matches). +* Use Alt + left/right arrow to move by word. +* Ctrl-A and Ctrl-E will jump the cursor to the start and end of the line respectively. +* Ctrl-W will delete the preceding word. +* The shell maintains a command history. Use the up and down arrow keys to navigate the history. +* Copy and paste work a little differently. Ctrl-C is already reserved for the `kill` signal +* Use Ctrl-D to signal end-of-file to a command that expects text input. +* Use Ctrl-C to interrupt or kill a process that might be stuck (sends the `SIGINT` signal). +* Use Ctrl-Z (`SIGSTOP` signal) to suspend the current process (if any), and `bg` to have it continue running in the background. You can also use `&` at the end of the command line to have it run in the background immediately. Use `fg` to bring it back to the foreground (for further interaction). + +## Getting Around + +TODO: things like cd, pwd, path expressions, relative and absolute paths diff --git a/tiddlers/content/labs/01/_Labs_01_Introduction.tid b/tiddlers/content/labs/01/_Labs_01_Introduction.tid new file mode 100644 index 0000000..d9d4063 --- /dev/null +++ b/tiddlers/content/labs/01/_Labs_01_Introduction.tid @@ -0,0 +1,13 @@ +section: 1 +tags: lab01 lab +title: /Labs/01/Introduction +type: text/vnd.tiddlywiki + +Welcome to COMP 210. Most of the labs for COMP 210 will be hands-on computer-based practicals, but some may be more tutorial-style. Staff will be on hand to demonstrate, answer questions, and generally provide help with the course work. + +This first lab provides an introduction to the Linux-based lab environment and some basics of Web security. The main topics covered will be: + +* Introduction to the Linux environment +* Command-line basics +* How the Internet (roughly) works +* Encrypted vs unencrypted Web transactions diff --git a/tiddlers/content/labs/01/_Labs_01_Lab 1_ Lab Environment, Networking.tid b/tiddlers/content/labs/01/_Labs_01_Lab 1_ Lab Environment, Networking.tid new file mode 100644 index 0000000..46e4980 --- /dev/null +++ b/tiddlers/content/labs/01/_Labs_01_Lab 1_ Lab Environment, Networking.tid @@ -0,0 +1,11 @@ +tags: lab lab01 toc +title: /Labs/01/Lab 1: Lab Environment, Networking +type: text/vnd.tiddlywiki + +
Click the <> button below to open all of the sections for this lab.
+ +!! Contents +<$set name="path" value="/Labs/01/"> +<$macrocall $name="contents-tree" path=<> /> +
<$macrocall $name="openByPath" path=<> />
+ diff --git a/tiddlers/content/labs/01/_Labs_01_Lab Environment.tid b/tiddlers/content/labs/01/_Labs_01_Lab Environment.tid new file mode 100644 index 0000000..61ea268 --- /dev/null +++ b/tiddlers/content/labs/01/_Labs_01_Lab Environment.tid @@ -0,0 +1,12 @@ +section: 3 +tags: lab01 lab +title: /Labs/01/Lab Environment +type: text/x-markdown + +The computers in North CAL are set up to dual-boot, into either the standard [Otago Student Desktop](https://blogs.otago.ac.nz/studentit/student-desktop/) or a local [Linux](https://en.wikipedia.org/wiki/Linux) installation managed by the Department of Information Science. Most of the lab work in COMP 210 will be done on Linux, so if your computer is not already running Linux, then start/restart it and when presented with the OS selection menu shown below, use the arrow and Enter keys to select the Information Science Linux Desktop. + +{{/Labs/01/rEFInd image}} + +Open-source Linux-based systems are excellent for doing work in computer security, because the software tools are transparent and extensible. They are generally also cross-platform and available *gratis*. + +Unfortunately, the Linux desktop is only available in North CAL and OBS3.27 in the Otago Business School, but many of the software tools are readily available if you wish to install them on your own computer. \ No newline at end of file diff --git a/tiddlers/content/labs/01/_Labs_01_rEFInd image.svg b/tiddlers/content/labs/01/_Labs_01_rEFInd image.svg new file mode 100644 index 0000000..6e02e05 --- /dev/null +++ b/tiddlers/content/labs/01/_Labs_01_rEFInd image.svg @@ -0,0 +1,341 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + Information ScienceLinux Desktop + + + + + + + + + + Windows StudentDesktop + + + + + + + + Select an operating system usingthe arrow keys on the keyboard. + + + + + + + + + + + + + + + + + + + + + + Reboot + + + + + + + Shutdown + + + + diff --git a/tiddlers/content/labs/01/_Labs_01_terminal.png b/tiddlers/content/labs/01/_Labs_01_terminal.png new file mode 100644 index 0000000..79c3778 --- /dev/null +++ b/tiddlers/content/labs/01/_Labs_01_terminal.png Binary files differ