Differences

This shows you the differences between two versions of the page.

Link to this comparison view

isc:lab-test [2026/10/01 16:55]
florin.stancu created
isc:lab-test [2026/10/01 17:59] (current)
florin.stancu
Line 38: Line 38:
 # note: everything else (base64, file, zcat, xxd, find, python3) # note: everything else (base64, file, zcat, xxd, find, python3)
 # should already be installed in any recent distro! # should already be installed in any recent distro!
-# do this inside a Python virtualenv (see tutorials below): + 
-pip3 install requests+# note: install Python libraries ​inside a virtual env: 
 +python3 -mvenv .venv        # create the py3 VENV 
 +source .venv/​bin/​activate ​  # run this every time your terminal shell is restarted! 
 +pip3 install requests ​ # HTTP client library for the last task
 </​code>​ </​code>​
  
Line 48: Line 51:
 The struggle is an actual point: peeking is free, learning is earned. The struggle is an actual point: peeking is free, learning is earned.
 Official solutions will be released officially after the lab deadline. Official solutions will be released officially after the lab deadline.
 +
 +Also, in CTF competitions,​ a **task'​s name** is often **an important hint** to the technique(s) used!
 </​note>​ </​note>​
  
-===== Python Warmup =====+We recommend doing the following tasks using ''​python3''​ and/or ''​bash''​. Though feel free to explore the files and their contents using shell tools (e.g., ''​xxd'',​ ''​file''​) or any GUI viewer (especially for images / PDF / audio documents) beforehand!
  
-We recommend doing the following tasks using Python. Though feel free to explore the files and their contents using shell tools (e.g., ''​xxd'',​ ''​file''​) beforehand! 
  
 ==== 01. Decode 'til You Drop ==== ==== 01. Decode 'til You Drop ====
- 
-{{page>:​isc:​agents_h&​nofooter&​noeditbutton&​noheader}} 
  
   * One of your friends gave you this string which looks encoded... Figure out what encoding was used and decode it. Be patient, it may take a couple of decoding rounds :)   * One of your friends gave you this string which looks encoded... Figure out what encoding was used and decode it. Be patient, it may take a couple of decoding rounds :)
-  ​* Spot the encoding: chars //A-Z a-z 0-9 + / =// with length a multiple of 4 => **base64**.+    ​* **Hint**: ​Spot the encoding: chars //A-Z a-z 0-9 + / =// with length a multiple of 4 :? ...
  
 +<spoiler SPOILER! scratch to reveal..>​
 +  * The encoding is... 🥁... [[https://​en.wikipedia.org/​wiki/​Base64|base64]]!
   * Do one round by hand: <code bash>​echo '​Vm0weE5GVXhTWGhpUm...'​ | base64 -d</​code>​   * Do one round by hand: <code bash>​echo '​Vm0weE5GVXhTWGhpUm...'​ | base64 -d</​code>​
   * If the output is //still// base64-looking,​ run it again!   * If the output is //still// base64-looking,​ run it again!
 +  * Please automate it [[https://​www.geeksforgeeks.org/​python/​encoding-and-decoding-base64-strings-in-python/​|using Python]]:
   * Python <code python>   * Python <code python>
 import base64 import base64
Line 69: Line 73:
 while True: while True:
     try:     try:
-        s = base64.b64decode(s)+        s = your_decode_snippet(s)
     except Exception:     except Exception:
         break         break
-    print(s)+    print(s) ​  # print at each step
 </​code>​ </​code>​
  
-Expected: 5 rounds; the last printed line is the flag.+</​spoiler>​
  
-==== 02. Zip it good ====+<note tip> 
 +Also check out ''​ex1-encodings/''​ for a quick python3 tutorial on encodings. 
 +This is especially important when manipulating binary data using Python! 
 +</​note>​
  
-{{page>:​isc:​agents_h&​nofooter&​noeditbutton&​noheader}}+==== 02. Zip it good ====
  
   * The archive contains the flag. What is the password?   * The archive contains the flag. What is the password?
-    * **Hint:** the password is in the wordlist+    * **Hint:** the password is in the wordlist ​=> dictionary attack! 
 +    * You have a helper Python skeleton for this (using the [[https://​docs.python.org/​3/​library/​zipfile.html|zipfile module]]), or you can use a classic CLI tool (//the ripper//)!
  
-===== CTF Tasks () =====+<spoiler SPOILER: Useful Python zip snippets + CLI tool...>​ 
 +  * Using Python3'​s ''​zipfile''​ module: 
 +    * you can [[https://​docs.python.org/​3/​library/​zipfile.html#​zipfile.ZipFile.setpassword|set the zip password]] in code: ''​z.setpassword(bytes(test_passwd,​ "​ASCII"​))''​ (remember encodings? this function requires ''​bytes''​!);​ 
 +    * then try to extract either  
 +  * As mentioned before, you can also use a classic cracking tool called ''​john''​! You must first extract the password hash using ''​ziptojohn ZIP_FILENAME > hash.txt''​ then simply call it using the ''​%%--%%wordlist=..''​ + hash.txt command-line arguments ;)  
 +</​spoiler>​
  
 ==== 03. Find the impostor ==== ==== 03. Find the impostor ====
 +
   * The flag for this exercise is found in a file under the inhere directory. The file has the following properties:   * The flag for this exercise is found in a file under the inhere directory. The file has the following properties:
     * human-readable     * human-readable
isc/lab-test.1790862906.txt.gz · Last modified: 2026/10/01 16:55 by florin.stancu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0