Skip to main content
Sara

tch1ka _ passionately curious

Sara
 

Klik hier voor de Nederlandse versie
Yeah! Offensive Security’s AWAE is available online in beta and I’m invited! In April, my lab time finally starts. After OSCP and OSWP, for this OSWE certification, I think I kind of know what to expect, but I’m wrong. In the first chapter, the steep learning curve starts with reading and writing code in several languages. Since coding is not in my background, I have to work very hard to keep up and learn enough to be able to work with them. I decide to spend an hour every day to read code, just to get familiar and get some feeling for it.
In the chapters that follow, several cases are discussed where, usually starting from the code, a few vulnerabilities are found and then combined to gain remote code execution. The vulnerabilities itself are not very spectacular, but the way they are found and combined is! The lab consists of five machines where the vulnerable applications and necessary tools are available. Administrative access makes it possible to perform a source code review, test exploits locally and debug them. While the book leads the reader through the cases, the extra miles are as Offensive Security likes to say: “try harder”. The course roughly exists of three parts:

1. Code reviewing
• Create an overview: Organization, code styling, comments. Find ideas for search strings.
• Search for vulnerabilities: Search strings, vulnerable functions, error messages, etc.
• Follow the code execution path: What does it do? What can you reach unauthenticated? How can you reach the function?
• User input: Where is it used? How and where is it validated / sanitized?

2. Web application exploitation
• Vulnerability chaining


• Automatation of exploits

3. Debugging
• Live debugging of applications
• Debugging of exploit code

When the book is finished, I feel uncertain about my new code reading skills and putting them to use in different situations then the cases described. There are no extra machines to practice on, like in the OSCP labs. A real methodology for code reading and the discovery of vulnerabilities -a more generic approach- is missing. With additional research and building extra machines with vulnerable web applications I found on exploit-db, I broaden my skillset.
The 48-hour exam is mind-blowing. Not only code reading and technical skills are put to the test. As in every Offensive Security exam, other skills are also tested: time-management, avoiding rabbit-holes, not panicking under pressure, but to keep thinking. Nothing goes easily, nothing is obvious, except for when you make the right considerations and follow the correct route. Then everything falls into place. After a killing 50 hours, I deliver my report and end the exam with a perfect score of 100 points! I am officially OSWE certified! www.youracclaim.com

My tips and tricks:

SOURCE CODE REVIEW:

Train finding vulnerabilities in several languages. This can be done, but is less fun, without have the application operational. Areas of concern are (recognizing) code that is available from the frontend (unauthenticated!), userinput, and following the code execution path. Where to start:
• Look for frequently used terms. “query” and “‘select|insert|update” are commonly used for database queries. $_GET indicates user input in PHP. Search strings can be identified during the initial creation of an overview of the code.
• Look for vulnerable function names. “eval”, “exec”, and “serialize” are examples of functions that can be potentially exploited. Look for sources, or make your own list, of these types of functions.
• Look for hints/words/errors from the frontend. Parameters in the URL can usually be used to find the corresponding function in the code. Errors can be used to find, follow, and potentially abuse the code execution path.
• Grep and regex are your best friends! Get very familiar with them! Smart greps, combined with regex search strings, give useful and efficient search results.

EXTRA TRAINING:

Build your own machines with vulnerable applications. Both the building and the discovery and exploitation of vulnerabilities gives more insight and extra training material. Vulnerabilities and corresponding vulnerable applications can be found at www.exploit-db.com.
• An older version of DNN
• And older version (or different product!) of ManageEngine Applications Manager
• Random vulnerable NodeJS applications
• Random vulnerable PHP applications

GENERAL:

General things that helped me though the exam and are useful for day to day jobs:
• Take your time! The key is to fully understand what is happening. Stay calm!
• Confirm source code finding by using a PoC in burp and/or verbose errors and (database) logging.
• Remember, you have source code and working application. Try to think from a usual blackbox perspective. What would you try to do/bypass/change/etc. Which type of vulnerabilities would achieve what you want? Then check for these in the code.
• Dive deeper into the details of the exploit when certain that this should be it, but it is not working.
• Debug script using print statements.
• Last but not least: Have fun and happy hacking!

 

Offensive Security’s Advanced Web Attacks and Exploitation (AWAE) training (NL)

Yes! Offensive Security ’s AWAE is in bèta online beschikbaar en ik ben uitgenodigd om mee te doen! In april is het zover: mijn labtijd gaat van start. Na OSCP en OSWP denk ik voor deze OSWE-certificering een beetje te weten wat ik kan verwachten, maar niets is minder waar. In het eerste hoofdstuk van het boek gaat de steep learning curve meteen van start met lezen en schrijven van code in verschillende talen. Aangezien coding niet in mijn achtergrond zit, is het aanpoten om de (ten minste) zeven talen die ik in het boek tegenkom snel en voldoende eigen te maken om er mee uit de voeten te kunnen. Ik besluit iedere dag een uur te besteden aan het lezen van code, puur om er in thuis te raken en gevoel voor te krijgen.

In de hoofdstukken die volgen worden verschillende casussen doorgewerkt waarbij, meestal vanuit de code, verschillende kwetsbaarheden worden gevonden die gecombineerd leiden tot volledige overname van het systeem. De kwetsbaarheden op zich zijn niet bijster bijzonder, de manier waarop ze gevonden en gecombineerd worden is dat wel! Het lab bevat vijf machines waarop de kwetsbare applicaties met alle benodigde tools beschikbaar zijn. Administratieve toegang tot de machines maakt het mogelijk de source code te reviewen, exploits lokaal te testen en deze te debuggen. Hoewel het boek de lezer bij de hand pakt en mee neemt door de casussen, zijn de extra miles zoals het Offensive Security past “try harder”. Grofweg bestaat de cursus uit drie hoofdonderwerpen:

1. Code reviewing
• Overview creëren: Organisatie, code styling, comments. Ideeën opdoen voor search strings.
• Zoeken naar kwetsbaarheden: Search strings, kwetsbare functies, foutmeldingen, etc.

• Volgen van code execution pad: Wat doet het? Waar kun je ongeautoriseerd bij? Hoe kun je deze functie bereiken?
• User input: Waar wordt het gebruikt? Hoe en waar wordt het gevalideerd/ gesaneerd?

2. Web application exploitation
• Vulnerability chaining


• Automatiseren van exploits

3. Debugging
• Live debuggen van applicaties
• Debuggen van onder meer exploit code

Als het boek uit is, en de extra miles gedaan, heb ik het gevoel dat ik nog onvoldoende basis heb om met name mijn nieuwe code reading skills in te zetten in andere situaties dan de beschreven casussen. Er zijn geen extra machines in het lab waarop geoefend kan worden, zoals bij OSCP. Een echte methodologie voor code reading en het vinden van kwetsbaarheden -een meer generieke aanpak- blijft m.i. onderbelicht in het boek. Met aanvullend onderzoek, en door middel van het zelf opbouwen en vervolgens misbruiken van andere kwetsbare webapplicaties (exploit-db is daar een mooie bron voor), verbreed ik mijn skillset.
Het examen van 48 uur is mind-blowing. Niet alleen code reading en technische skills worden getest, maar zoals bij ieder Offensive Security examen ook time-management skills, het vermijden van rabbit-holes, en het onder druk niet in paniek raken, maar blijven nadenken. Niets gaat vanzelf, niets is obvious, behalve als je de juiste overwegingen en goede route ernaartoe hebt gevolgd. Dan ineens valt alles op zijn plek. Na een killing 50 uur lever ik mijn rapportage op en sluit ik mijn examen af met 100 van de 100 punten!! I am officially OSWE certified! www.youracclaim.com

My tips and tricks:

SOURCE CODE REVIEW:

Train het vinden van kwetsbaarheden in verschillende talen. Dit kan ook, maar is minder leuk, zonder dat je de applicatie hebt draaien. Aandachtspunten zijn (het herkennen van) vanaf de frontend bereikbare code (unauthenticated!), userinput, en het volgen van het code execution pad. Where to start:
• Zoek op veel gebruikte termen. “query” en “‘select|insert|update” worden bijvoorbeeld vaak gebruikt voor database query’s. $_GET geeft in PHP userinput aan. Search strings kunnen worden geïdentificeerd tijdens het creëren van een overview van de code.
• Zoek op kwetsbare functienamen. “eval”, “exec”, en “serialize” zijn voorbeelden van functies die potentieel te misbruiken zijn. Zoek bronnen, of maak zelf een lijstje, van dit soort functies.
• Zoek op hints/woorden/foutmeldingen van de frontend. Parameters in de URL kunnen vaak worden gebruikt om (dezelfde) bijhorende functienamen in de code te vinden. Foutmeldingen kunnen gebruikt worden om het code execution pad the vinden, volgen en potentieel misbruiken.
• Grep en regex are your best friends! Get very familiar with them! Slimme greps in de code, zo nodig gecombineerd met regex search strings, geven snelle en doeltreffende resultaten.

EXTRA TRAINING:

Bouw zelf machines op met kwetsbare applicaties. Zowel het opbouwen, als het zoeken en misbruiken van kwetsbaarheden, geeft nieuwe inzichten en extra oefenmateriaal. Kwetsbaarheden en bijhorende kwetsbare applicaties zijn te vinden op www.exploit-db.com.
• Een oudere versie van DNN
• Een oudere versie (of ander product!) van ManageEngine Applications Manager
• Willekeurige kwetsbare NodeJS applicaties
• Willekeurige kwetsbare PHP applicaties

GENERAL:

Generieke dingen die mij door het examen hebben geholpen, en nuttig zijn bij klussen in de praktijk:
• Neem de tijd. De key is om volledig te begrijpen wat er gebeurt. Stay calm!
• Bevestig source code bevindingen door middel van een PoC in burp en/of verbose errors en (database) logging.
• Don’t forget: je hebt source code en een werkende applicatie. Denk vanuit een blackbox perspectief. Wat zou je dan proberen/bypassen/manipuleren/etc. Welke typen kwetsbaarheden bereiken wat je wilt? Kijk vervolgens in de code of je een van die dingen kunt vinden.
• Duik dieper in de details van een exploit als je er zeker van bent dat het zou moeten werken, maar hij het toch niet doet. Wat begrijp je onvoldoende/verkeerd? Basically: try harder!
• Debug scripts door middel van print statements.
• Last but not least: Have fun and happy hacking!

Wilt u meer weten over de diensten van The S-Unit? Of heeft u een andere S-entiële vraag voor ons?

Neem contact op

Of bel Kai 030 – 207 41 77

×

 

Hallo!

Heb je een vraag voor ons? Vraag het aan Kai!

× Heb je een vraag?