331 - Network and Web Security - 2025
Table of Contents
A.k.a 60015 or 70082, but just "331" for short.
Announcements
- This year we have an exciting line-up of guest lecturers: Antoine Vianey-Liaud (Crowdstrike), Charlie Hothersall-Thomas (Netcraft), Joseph Katsioloudes (GitHub Security Lab), Ibrahim ElSayed (Lacework).
Schedule
Week 4 - 03/02/25
- Overview. This week we start with web security. First we look at HTTP which is the main protoocol supporting web applications, then we see how HTTPS protects HTTP by encapsulating it inside TLS. Follows a short introduction to PHP and some of its tricky features. PHP will be our reference language for the server side of web applications. Finally, we look at the main threats and vulnerabilities affecting servers. In the tutorial, we will practice identifying some of those vulnerabilities against a demo web application.
- Topics
- 12 HTTP
- 13 PHP
- If you are not familiar with PHP, take this w3schools PHP tutorial
- 14 Server-side security
- Read Chapters 1-4, 20, 21 of The Web Application Hacker's Handbook
- Activities
- Lab on Monday
- Guide: Chrome and Burp in Kali
- Tutorial 4: Server-side web vulnerabilities
- In class session on Thursday
- Invited lecture 2: DMARC: Counter-Attacking Email Fraud (Charlie Hothersall-Thomas, Netcraft)
- Q&A, demos, etc
- Recommended exercise
- Write a simple web app in PHP that can store HTTP POST data in a SQL database
- Optional: serve your web app over HTTPS (you can get a certificate for free at https://letsencrypt.org or try using a self-signed certificate)
- Lab on Monday
Week 3 - 27/01/25
- Overview. This week we cover core material on network security. This is important in its own merit and also because attacks against web applications sometime span both the application and network layer. We cover a little bit more background on the TCP/IP stack, then look at key weaknesses, threats and attacks techniques for the main protocols that enable web applications: IP, TCP, UDP, DNS and TLS. In the tutorial you will apply some of these concepts in practice, so it should be attempted after reviewing all the modules. Note that module 9 is only a quick overview of firewalls and IDSs, as an in depth study goes beyond the scope of this course.
- Topics
- 8 IP security
- Optional reading
- TCP/IP State Transition Diagram
- IETF RFC for Internet Communication layer
- Example of a BGP hijacking campaign
- Optional reading
- 9 Network defenses
- 10 DNS
- Optional reading
- Read the
man
page fordig
Linux utility - IETF RFC for DNS
- FireEye post on Global DNS Hijacking
- Off-Path Hacking (research paper)
- Read the
- Optional reading
- 11 TLS
- Optional reading
- IETF RFCs for TLS 1.3
- Optional reading
- 8 IP security
- Activities
- Lab on Monday
- Tutorial 3: Network security tools
- In class session on Thursday
- Invited lecture 1: Introduction to Ransomware Operations (Antoine Vianey-Liaud, Crowdstrike)
- Q&A, demos, etc
- Lab on Monday
Week 2 - 20/01/25
- Overview. This week we cover more background material and general topics relevant to the rest of the course, and end with a quick look at the security of local area networks. Authentication and passwords are pervasive in cybersecurity. We introduce key concepts and best practices here, and will come back to the topic later in the course. Pentesting is a useful conceptual framework to assess the security of a network, and we will practice it in the labs from now on. The networks background module is mostly to the benefit of those students who do not have a computing background, but can serve as a quick refresher to the others. Finally we briefly discuss local area networks and some of their security weaknesses. You will practice some of what you learn on authentication, networks and LANs already in this week's tutorial, which is practical and based on virtual machines. You will need to have installed Kali on VirtualBox, either on your laptop or on a machine in the labs, folowing last week's guide.
- Topics
- 4 Authentication
- 5 Pentesting
- Read Chapters 3 and 4 of Professional Penetration Testing
- Optional reading
- Read Chapters 6 and 7 of Professional Penetration Testing
- 6 Networks background
- Optional reading (highly recommended if you are new to computer networks)
- Sections 4.1, 4.2, 4.3, 6.4 (up to and including 6.4.3) of Computer Networking - A Top-Down Approach - 7th Edition
- Optional reading (highly recommended if you are new to computer networks)
- 7 LAN security
- Activities
- Lab on Monday
- Tutorial 2: Virtual security lab and passwords
- In class session on Thursday
- Q&A, demos
- Lab on Monday
Week 1 - 13/01/25
- Overview. This week we cover some general security topics which are relevant to the rest of the course. In order to secure a system, we want to be able to discover, fix and, even better, prevent security vulnerabilities. Attackers attempt to install malware on their victims, and use malware itself to implement further attacks. Although malware is not the focus of this course, we need to have some familiarity with it, in order to understand the objectives and techniques used to attack networks and web applications. Threat modelling is a conceptual tool that we will use in the rest of the course to assess the security of applications and systems. Note that this week is a gentle introduction to the course, the pace and difficulty will increase as we get into technical topics.
- Topics
- 1 Vulnerabilities
- Read Chapter 2 of Professional Penetration Testing
- 2 Malware
- Optional reading
- 3 Threat Modelling
- Read Chapters 1-4 of Threat modelling – Designing for security
- 1 Vulnerabilities
- Activities
- Lab on Monday
- Guide: Install VirtualBox and Kali
- In class session on Thursday
- Overview, Q&A, demos
- Tutorial 1: Threat Modelling
- Lab on Monday
Organization
- Timetable:
- Fri 9:00am: updates for the following week
- weekly course schedule and suggested reading posted on this website
- recorded lectures and slides released on Scientia
- Mon 2pm-4pm
- lab session with GTAs in Hux 219
- office hours with lecturer in Hux 219(a) [13/2,27/2,10/3,24/3] or 219(c)[20/2,3/3,17/3]
- Thu 11am-1pm: in-class activities in Hux 311, including a variety of
- Q&A, demos, extras on weekly material
- Tutorials (not computer-based)
- Invited lectures
- Fri 9:00am: updates for the following week
- edStem will be used for course announcements and course related questions.
- Questions via email will be ignored.
- Slides, recordings and tutorial sheets will be posted on Scientia: UG ~ MSc.
- External students: registration instructions.
Assessment
- Assessed coursework
- Exam
- The exam will take place during the week 17-21 of March, in the labs.
- Answer 2 questions out of 2 in 2 hours.
- The format is "open book": you can take one A4 sheet (2 sides) of notes into the exam.
- Selected cheatsheets and reference guides will be provided to help with the practical part.
- Roughly half of the exam will consists of practical security tasks.
Resources
- Reference books (electronic edition available via central library):
- Threat modelling – Designing for security (Shostack)
- Professional Penetration Testing (Wilhelm)
- The tangled web (Zalewski)
- The Web Application Hacker's Handbook (Stuttard, Pinto)
- Recommended books
- Computer Networking - A Top-Down Approach (Kurose, Ross)
- SSL and TLS: Theory and Practice (Oppliger)
- Vulnerabilities
- CWE/SANS Top 25 Most Dangerous Software Errors.
- OWASP Top 10 list of the most critical web application security flaws.
- Search the CVE Vulnerability Database.
- Search the exploit-db database.
- Hacker One reward program for internet vulnerability disclosures.
- Full Disclosure mailing list.
- Black Hat and DEF CON hacking conferences.
- General
- A short dictionary of cybersecurity terms: Sophos' Threatsaurus.
- The Elevation of Privilege card game.
- w3schools tutorials
- Tails: live os with state-of-the-art privacy protection (including Tor browser).
- MITRE ATT&CK: a knowledge base of adversary tacticts and techniques.
- Practice hacking
- Kali Linux distribution for pentesting.
- OWASP Broken Web Applications Project
- Exploit exercises
- PentesterLab Bootcamp
- VMs recommended by students
- Sources for web-related standards:
- Blogs and news:
People
Lecturer
Sergio Maffeis. Sergio is a senior lecturer in Computer Security at Imperial, where he leads the Security and Machine Learning Lab. He received his PhD from Imperial and his MSc from University of Pisa, Italy. Maffeis' research interests include security, machine learning, formal methods, and programming languages. You can find out more from his home page.
Guest Lecturers
Antoine Vianey-Liaud. Antoine manages a team of threat hunters at Crowdstrike, uncovering sophisticated adversaries within the networks of a large customer base. He received his MSc from Imperial College London in 2016, delivering an ISO and thesis under the supervision of Dr Maffeis. His interests include intrusion detection (using security domain knowledge, statistical and data science methods), capture the flag competitions, and security in all its forms.
Charlie Hothersall-Thomas. Charlie is a Director of Engineering at Netcraft, where he leads the DevOps division. Prior to this he worked as a developer on a variety of Netcraft's anti-cybercrime products. His technical expertise includes web security, TLS and PKI, networking, Linux system administration and Tor. He graduated in 2014 with a BEng in Computing from Imperial College London, where he started BrowserAudit as his final year project.
Ibrahim ElSayed. Ibrahim is an experienced security engineer specializing in leveraging program analysis to detect and prevent security vulnerabilities at scale. With over a decade of expertise in building advanced static analysis tools, he has contributed to securing massive codebases written in languages like PHP, Python, and Java. Ibrahim is also passionate about researching vulnerabilities in end-to-end encrypted messaging applications like WhatsApp, Telegram, and Signal, aiming to enhance their security. He leads efforts to empower developers and scale security teams to identify and mitigate critical vulnerabilities effectively.
Joseph Katsioloudes. Joseph works for the GitHub Security Lab, and was previously a Security Consultant at IBM. He obtained an MSc in Cyber Security Engineering from the University of Warwick and an MEng in Computing from Imperial College London. His experience in security stems from summer internships and own initiatives to problem-solve. Highlights include the disclosure of a zero-day vulnerability for a top ten cryptocurrency during his final year at Imperial College, the GCHQ security accreditation, software contributions to open-source tools and advanced attack simulations.
Teaching Assistants
Adbdullah Adlaihan. Abdullah is a PhD student at Imperial College London under the supervision of Dr. Maffeis. He received his MSc in computer science from Georgia Institute of Technology, and his BSc in computer science from King Saud University. Abdullah's focus is on utilizing Large Language Models (LLMs) for systems security.
Adam Jones. Adam is a PhD student at Imperial under the supervision of Dr. Maffeis and Dr. Zizzo. He received his MEng from Imperial in Computer Science. Adam's research is focused on the security of foundation models that generate code, in particular researching attacks and defenses in the domains of model poisoning and prompt injection.
Eman Maali. Eman is a PhD student at Imperial College London under the supervision of Prof. McCann. Eman's Ph.D. focus is IoT Security, in which she is developing an anomaly detector for IoT networks. In 2017, Eman completed her MSc in Electromagnetic Sensor Networks at the University of Birmingham. The focus of the Master's was on electromagnetic, antennas, propagation, computer communications networks, and RF and microwave engineering. Moreover, Eman completed her BA in Computer Systems Engineering from Birzeit University in Palestine.
Fahad Alotaibi. Fahad is a PhD student at Imperial College London under the supervision of Dr. Maffeis. He received his MSc from The University of York (UK) in Cyber Security, and his BCs from Shaqra University (KSA) in Computer Science. Fahad’ research is focused on robusting deep learning-based security applications againsts evasion attacks and concept drift. Fahad is also interested in other areas such as digital forensics and ransomware prevention.
Myles Foley. Myles is a PhD student at Imperial College London under the supervision of Dr. Maffeis. He received his MEng from University College London in Electronic Engineering with Computer Science, earning the ‘Outstanding MEng Graduating Student’ prize. Myles’ research is focused at novel - and exciting - ways of applying reinforcement learning to problems in cyber security.
Xin Fan Guo. Xin Fan is a PhD student in the Safe and Trusted AI CDT, a joint program between King’s College London and Imperial College London, supervised by Dr. Pierazzi and Dr. Maffeis. She holds a BSc in Computer Science from King’s College London. Her research focuses on applying symbolic AI to enhance network security.
Hall of Fame
- 331 Bug Bounties
- 331 Bug Bounty 2023
- James Nock reported an XSS vulnerability in https://github.com/sparc/phpWhois.org.
- 331 Bug Bounty 2022
- Albert Schleidt demonstrated the Dirtycow privilege escalation exploit on the listener vm.
- Fabian Hauf, Anne-Sophie Hannes, Jonathan Powell, Vincent Bardenheier, Albert Schleidt reported a DOM-based XSS vulnerability in NaturalReaders.com.
- 331 Bug Bounty 2020
- Kelvin Zhang reported an authentication vlunerability in https://play.mtn.co.za/ to HackerOne.
- 331 Ofuscation Bounty 2020
- Winners: James Williams, Marco Selvatici.
- Runner ups: Tristan Nemoz, Robert Jin, James Dalboth and Anonymous.
- 331 Bug Bounty 2023
- Belmont Lansdown 331 Prizes
- Netcraft was sold to a US private equity fund in 2022-3. This year Mike Prettejohn, the founder and former owner of Netcraft, provided prizes worth GBP 500 from his new company, Belmont Lansdown.
- The winners of the 2024 edition were: Lucy Steele, Huzaifah Farooq, Lucas Graeff-Buhl-Nielsen, Robin Gupta, Boyuan Jiang, Rushil Ambati, Rickie Ma, Anonymous, Robert Wakefield, Thom Hughes.
- Netcraft 331 Prizes
- Between 2019 and 2023 Netcraft sponsored awards for the top 10 performers in the exam (an Amazon voucher worth GBP 250)
- The winners of the 2023 edition were: Ghazal Farzamfar, Panayiotis Gavriil, Michal Glinski, Derek Lai, Maximilian Lau, Suhaib Mohammed, James Nock, Matthew Setiawan, Mike Sorokin, Ye Lun Yang.
- The winners of the 2022 edition were: Luqman Liaquat, Albert Schleidt, Thomas Alner, Andy Wang, Vincent Bardenheier, Madi Baiguzhayev, Daniel Ababei, Rodi Degirmenci, Anonymous, Arman Fidanoglu, Thomas Loureiro Van Issum.
- The winners of the 2021 edition were: Michael Kuc, Andreas Casapu, Maksymilian Graczyk, Anonymous, Matteo Bilardi, Anonymous, Ali Abidi, Thomas Roberts, Tilman Roeder, Alexander Reichenbach
- The winners of the 2020 edition were: Zak Cutner, Daniel Hails, Hadrian Lim Wei Heng, Fraser May, Alexander Nielsen, Giovanni Passerello, Matthew Pull, Ethan Sarif-Kattan, Marco Selvatici, Sebastian Reuter
- The winners of the 2019 edition were: Jordan Spooner, Teodor Begu, Thomas Pointon, William Seddon, Niklas Vangerow, Lorenzo Silvestri, Pablo Gorostiaga-Belio, Giorgos Gavriil, Olivier Roques, Aurel Bily