<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michael+B</id>
	<title>Soma-notes - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michael+B"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php/Special:Contributions/Michael_B"/>
	<updated>2026-06-02T22:24:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=SystemsSec_2018W_Lecture_23&amp;diff=21626</id>
		<title>SystemsSec 2018W Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=SystemsSec_2018W_Lecture_23&amp;diff=21626"/>
		<updated>2018-04-08T21:41:48Z</updated>

		<summary type="html">&lt;p&gt;Michael B: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Audio==&lt;br /&gt;
&lt;br /&gt;
[https://homeostasis.scs.carleton.ca/~soma/systemssec-2018w/lectures/comp4108-2018w-lec23-04Apr2018.m4a Lecture 23 Audio]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
===Network Monitoring===&lt;br /&gt;
Network monitoring is a very general concept and performed for many reasons. Your ISP might monitor the network for congestion or bad traffic. An organization may monitor the network for security reasons.&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
Monitoring networks has become harder recently due to encryption. For example:&lt;br /&gt;
     - Web traffic is all on TLS&lt;br /&gt;
     - Emails are being encrypted&lt;br /&gt;
     - DNS: Used to be wide open, tried to secure it (DNSSEC)&lt;br /&gt;
       - If left in the clear, open to monitor and manipulation by anyone, which is bad&lt;br /&gt;
       - It gives you more information than just a src/dst IP would. Why? &amp;quot;The Cloud&amp;quot;&lt;br /&gt;
         - Usually multiple IPs for one service, or many services for one IP&lt;br /&gt;
       - DNS will get you what you want, so now efforts to tunnel DNS over TLS&lt;br /&gt;
&lt;br /&gt;
Even if we assume encryption isn&#039;t a problem, how do we &amp;quot;&#039;&#039;&#039;secure&#039;&#039;&#039;&amp;quot; (find out if bad things are occuring) a network? How do you &#039;&#039;&#039;understand what the network is doing&#039;&#039;&#039;? Sysadmins care about security, but ultimately, they care about what is going on inside their network.&lt;br /&gt;
&lt;br /&gt;
Enterprises will usually forgo encryption entirely, or have the keys to decrypt due to legal obligations. They may set up a man in the middle by terminating TLS connections at a certain point and re-initiating their own. They can accomplish this by installing their own root certs.&lt;br /&gt;
&lt;br /&gt;
===Without Encryption===&lt;br /&gt;
Even with everything in plaintext, understanding a network still isn&#039;t easy. What does it even mean to understand a network? It&#039;s not so much as a protocol complexity issue, but more of a &amp;quot;everything you connect to does crazy things and it&#039;s hard to know what&amp;quot; issue. What we need is &#039;&#039;&#039;a model&#039;&#039;&#039;, so that when things deviate from the model we can tell.&lt;br /&gt;
&lt;br /&gt;
How to we learn a model? &lt;br /&gt;
     - sit and sift though traffic. (tedious and usually ineffective) &lt;br /&gt;
&lt;br /&gt;
     - &#039;&#039;&#039;aggregate things:&#039;&#039;&#039; Classify and look at relationships&lt;br /&gt;
       - But how? Not always easy&lt;br /&gt;
       - Use src/dst ip/ports? When few computers, awesome, but not for modern networks&lt;br /&gt;
         - Modern networks are too dynamic, always changing and too many IPs&lt;br /&gt;
&lt;br /&gt;
       - Solution: block classes of traffic via proxy?&lt;br /&gt;
         - Haven&#039;t solved the problem, too much traffic still&lt;br /&gt;
       - &#039;&#039;&#039;No Whitelists:&#039;&#039;&#039; too many sites/people&lt;br /&gt;
       - &#039;&#039;&#039;No Blacklists:&#039;&#039;&#039; might partly work, but too many large holes&lt;br /&gt;
       - &#039;&#039;&#039;No Anomaly Detection:&#039;&#039;&#039; too much stuff, too random.&lt;br /&gt;
         - Anomaly rate will be high (tail of curve too fat)&lt;br /&gt;
         - If we cut off tail, now people are mad and circumvent us&lt;br /&gt;
&lt;br /&gt;
===Clustering===&lt;br /&gt;
The gist of clustering is: I don&#039;t know the right aggregates, so let&#039;s automatically aggregate it instead. If we combine this with anomaly detection after, maybe we can have some success?&lt;br /&gt;
      - Clustering -&amp;gt; Aggregates -&amp;gt; Anomaly Detection -&amp;gt; Profit???&lt;br /&gt;
Our usual clustering algorithms are O(n^2), not possible with a high traffic volume. Even O(nlogn) is too much. Maybe using sliding window on streaming data?&lt;br /&gt;
&lt;br /&gt;
Remember, we are &#039;&#039;&#039;trying to build a model&#039;&#039;&#039;. What if we could quickly build this model and check it (using machine learning)? If our &#039;&#039;&#039;model building is fast&#039;&#039;&#039;, and we can &#039;&#039;&#039;check in linear time&#039;&#039;&#039;, it could work. But how can we limit our data size?&lt;br /&gt;
&lt;br /&gt;
* Limit sample by using small time window of data&lt;br /&gt;
* Build model on time window, adjust over time&lt;br /&gt;
&lt;br /&gt;
Now that we have our sample data, how do we build our model? The first thought is to model the weirdness, but this is wrong. Instead, we should &#039;&#039;&#039;model what is normal&#039;&#039;&#039;, &#039;&#039;&#039;then check for weirdness&#039;&#039;&#039;. Alright, so how do we do this?&lt;br /&gt;
&lt;br /&gt;
===PN-Grams===&lt;br /&gt;
N-grams are substrings of content. But we need more than this, we also need the position as well. There we look at pn-grams (position n-grams). These enable us to &#039;&#039;&#039;forgo inspecting whole packets&#039;&#039;&#039;, and instead just &#039;&#039;&#039;look at a few bytes in a specific position&#039;&#039;&#039;. But how do we find these pn-grams?&lt;br /&gt;
&lt;br /&gt;
* Start with all traffic, then take a sample&lt;br /&gt;
* In sample, compute frequency of all pn-grams&lt;br /&gt;
* Using pn-grams, randomly pick one with a frequency of about 50% (40-60)&lt;br /&gt;
** We now have two classes, one with the pn-gram in it, one without&lt;br /&gt;
* Do this recursively until we get down to aggregates with about 2% frequency&lt;br /&gt;
** Result is a decision tree of pn-grams, where leafs are our aggregates&lt;br /&gt;
&lt;br /&gt;
Turns out that this method classifies traffic in extremely meaningful ways (TCP vs Non-TCP, etc). It works even better if we remove packet headers due to redundancy. Finally, the closer the aggregates are in the tree, the more similar they are. If you don&#039;t understand why this occurs, don&#039;t worry, some guy did a PhD on this.&lt;br /&gt;
&lt;br /&gt;
For more info, search online for: &lt;br /&gt;
*NetADHICT&lt;br /&gt;
*Hijazi&lt;/div&gt;</summary>
		<author><name>Michael B</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=SystemsSec_2018W_Lecture_10&amp;diff=21549</id>
		<title>SystemsSec 2018W Lecture 10</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=SystemsSec_2018W_Lecture_10&amp;diff=21549"/>
		<updated>2018-03-01T06:32:32Z</updated>

		<summary type="html">&lt;p&gt;Michael B: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Audio==&lt;br /&gt;
&lt;br /&gt;
[https://homeostasis.scs.carleton.ca/~soma/systemssec-2018w/lectures/comp4108-2018w-lec10-07Feb2018.m4a Lecture 10 Audio]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
===Logic Errors===&lt;br /&gt;
* Accidental (motive)&lt;br /&gt;
* Discovered&lt;br /&gt;
* Variable impact&lt;br /&gt;
&lt;br /&gt;
===Backdoors===&lt;br /&gt;
* On purpose&lt;br /&gt;
* Engineered&lt;br /&gt;
* Severe impact&lt;br /&gt;
&lt;br /&gt;
When dealing with a sophisticated attacker, you can&#039;t tell the difference&lt;br /&gt;
A good attack will make it seem like a logic error. The only difference between the two is motive. &lt;br /&gt;
A vulnerability can be discovered by anyone and is as good as a backdoor.&lt;br /&gt;
&lt;br /&gt;
This means that any strategy that deals with software vulnerability/quality checking isn&#039;t full proof; you are never safe.&lt;br /&gt;
Moreover, everyone uses the same code, so what&#039;s the difference between hardened bunker and a school? They all run the same code.&lt;br /&gt;
How do you write portable code? Manually port it. Watch it break, fix it.&lt;br /&gt;
&lt;br /&gt;
==Building with Security in Mind==&lt;br /&gt;
&lt;br /&gt;
Security must be built in from the beginning (Replace security with any other property: performance, portability, etc).&lt;br /&gt;
We have a process for portability, so why not security?&lt;br /&gt;
Same thing, but the requirements have changed slightly. We need to adapt. New attack? Time to adapt your code.&lt;br /&gt;
&lt;br /&gt;
Main point: think about software engineering from a security perspective. Requirements still change just like we are used to, but instead of requests for new features, we have other things to worry about.&lt;br /&gt;
&lt;br /&gt;
Now that we have this mindset, our original point changes: continue to think of security in terms of normal software development, but not with it defined by requirements. We can try to list requirements in security, but it&#039;s impossible. Requirements are useless because, like for regular software development, they are just words telling us what needs to be accomplished, this leads to crap code and nothing getting done.&lt;br /&gt;
&lt;br /&gt;
Therefore we need something else: something that will assume unintended requirements that comes with security. So we do what we normally do when we have poor requirements, we evolve them.&lt;br /&gt;
* Normally we evolve our requirements by taking in external input to the software engineering process (user data, feedback, etc)&lt;br /&gt;
* Evolving in security is different. &lt;br /&gt;
:* From a business perspective, no return on investment.&lt;br /&gt;
:* Hard to measure things when they are actively trying to deceive you&lt;br /&gt;
::* Solution: Intrusion detection?&lt;br /&gt;
&lt;br /&gt;
===Solutions===&lt;br /&gt;
Only difference between devops and security is deception, requirements are trying to hide.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Bug bounties&#039;&#039;&#039; are not crowd sourced, the people who find these are professionals, not just the general crowd.&lt;br /&gt;
*Google project 0: notorious due to strict timelines (90 days)&lt;br /&gt;
When you find bugs you are a whistle blower (nobody likes a whistle blower), but nobody in organizations cared, this lead to full disclosure.&lt;br /&gt;
*Bugtrack: mailing list going out to the world (full disclosure)&lt;br /&gt;
&lt;br /&gt;
===Basic Checks===&lt;br /&gt;
Following list is the known list that attackers check for at first, like grammar copycheckers:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SQL Injections&#039;&#039;&#039;: (backronym, sequel, used to actually be spelled sequel)&lt;br /&gt;
* Query language for databases (domain specific programming language for databases)&lt;br /&gt;
* Usually dynamically generated code from untrusted user input&lt;br /&gt;
* Equivalent of writing a program using arbitrary input: e.g. I can write a program in your program.&lt;br /&gt;
&lt;br /&gt;
See the patterns? A lot of functionality when you only need one function. Keep this in mind when you are writing code&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shellcode injection&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Michael B</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Computer_Systems_Security_(Winter_2018)&amp;diff=21506</id>
		<title>Computer Systems Security (Winter 2018)</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Computer_Systems_Security_(Winter_2018)&amp;diff=21506"/>
		<updated>2018-02-11T05:11:45Z</updated>

		<summary type="html">&lt;p&gt;Michael B: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Course Outline==&lt;br /&gt;
&lt;br /&gt;
[[Computer Systems Security: Winter 2018 Course Outline|Course Outline]]&lt;br /&gt;
&lt;br /&gt;
==Experiences==&lt;br /&gt;
&lt;br /&gt;
You are required to complete 9 experiences throughout the semester.&lt;br /&gt;
&lt;br /&gt;
* [[Computer Systems Security: Winter 2018 Experiences|List of Experiences]]&lt;br /&gt;
&lt;br /&gt;
==Assignments==&lt;br /&gt;
&lt;br /&gt;
Assignments will be posted here as they become available&lt;br /&gt;
&lt;br /&gt;
* [[Computer Systems Security: Winter 2018 Assignment 1|Assignment 1]]&lt;br /&gt;
* Assignment 2&lt;br /&gt;
* Assignment 3&lt;br /&gt;
* Assignment 4&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
&lt;br /&gt;
Here are some resources you may find useful:&lt;br /&gt;
&lt;br /&gt;
* [http://homeostasis.scs.carleton.ca/~soma/systemssec-2018w/comp4108-2018w.ova A Virtualbox OVF image for Ubuntu 17.10.1]&lt;br /&gt;
* [https://openstack.scs.carleton.ca The SCS openstack cluster].  Note that you can only access this from the Carleton network.  To access from elsewhere, [https://carleton.ca/its/help-centre/remote-access/ VPN in] to the university.  (On Linux you can also use openconnect rather than the Cisco software provided by Carleton.)&lt;br /&gt;
&lt;br /&gt;
If you cannot access openstack, try [http://www.scs.carleton.ca/webacct changing your SCS password].&lt;br /&gt;
&lt;br /&gt;
==Schedule==&lt;br /&gt;
&lt;br /&gt;
===January 8, 2018===&lt;br /&gt;
&lt;br /&gt;
[[SystemsSec 2018W Lecture 1|Introduction]]&lt;br /&gt;
&lt;br /&gt;
===January 10, 2018===&lt;br /&gt;
&lt;br /&gt;
[[SystemsSec 2018W Lecture 2|Threat Modelling]]&lt;br /&gt;
&lt;br /&gt;
===January 15, 2018===&lt;br /&gt;
&lt;br /&gt;
[[SystemsSec 2018W Lecture 3|Common tools]]&lt;br /&gt;
&lt;br /&gt;
===January 17, 2018===&lt;br /&gt;
&lt;br /&gt;
[[SystemsSec 2018W Lecture 4|passwd]]&lt;br /&gt;
&lt;br /&gt;
===January 22, 2018===&lt;br /&gt;
&lt;br /&gt;
[[SystemsSec 2018W Lecture 5|Networking 1]]&lt;br /&gt;
&lt;br /&gt;
===January 24, 2018===&lt;br /&gt;
&lt;br /&gt;
[[SystemsSec 2018W Lecture 6|Virtual machines 1]]&lt;br /&gt;
&lt;br /&gt;
===January 29, 2018===&lt;br /&gt;
&lt;br /&gt;
[[SystemsSec 2018W Lecture 7|Cryptography 1]]&lt;br /&gt;
&lt;br /&gt;
===January 31, 2018===&lt;br /&gt;
&lt;br /&gt;
[[SystemsSec 2018W Lecture 8|Networking 2]]&lt;br /&gt;
&lt;br /&gt;
Assignment 1 due&lt;br /&gt;
&lt;br /&gt;
===February 5, 2018===&lt;br /&gt;
&lt;br /&gt;
[[SystemsSec 2018W Lecture 9|Software Vulnerabilities 1]]&lt;br /&gt;
&lt;br /&gt;
===February 7, 2018===&lt;br /&gt;
[[SystemsSec 2018W Lecture 10|Software Vulnerabilities 2]]&lt;br /&gt;
&lt;br /&gt;
===February 14, 2018===&lt;br /&gt;
&lt;br /&gt;
Assignment 2 due&lt;br /&gt;
&lt;br /&gt;
===February 19 &amp;amp; 21, 2018===&lt;br /&gt;
&lt;br /&gt;
Winter break, no classes&lt;br /&gt;
&lt;br /&gt;
===February 26, 2018===&lt;br /&gt;
&lt;br /&gt;
Mid-term review&lt;br /&gt;
&lt;br /&gt;
===February 28, 2018===&lt;br /&gt;
&lt;br /&gt;
Mid-term Exam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===March 19, 2018===&lt;br /&gt;
&lt;br /&gt;
Assignment 3 due&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===April 4, 2018===&lt;br /&gt;
&lt;br /&gt;
Assignment 4 due&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===April 9, 2018===&lt;br /&gt;
&lt;br /&gt;
Last day of class&lt;/div&gt;</summary>
		<author><name>Michael B</name></author>
	</entry>
</feed>