Skip to content

Instantly share code, notes, and snippets.

@denzuko
Last active January 31, 2023 21:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save denzuko/412375cedc241792b618df87c2202e86 to your computer and use it in GitHub Desktop.
Save denzuko/412375cedc241792b618df87c2202e86 to your computer and use it in GitHub Desktop.
CTF Flags, Styleguide, and Toolset
Error in user YAML: (<unknown>): could not find expected ':' while scanning a simple key at line 3 column 1
---
title: CTF Flags, Styleguide, and Toolset
subtitle: >
Dwight S. @denzuko, Jul. 1. 2019
Copyright ©2019-2035 Dwight Spencer. All Rights Reserved.
Licenced under BSD 3 Clause. https://opensource.org/licenses/BSD-3-Clause
---

Summary

Notes

Tool usages

Flags can be generated with:

echo "flag{$(uuidgen | tr '-' ':')}"

On telehack one can use cowsay with the following flags to help generate flags

/ren exploit (catcher)
/stimpy pentesting (pitcher)
/stegosaurus steganography
/sheep web and networking
/mutalated social engineering (h/t cult dead cow )

Hiding flags

flags can be hidden in many places but some guideleines can be as follows:

  • encoded (brainfuck, whitespace esotaric language, base64/uuencoded, qrcoded)
  • metadata (e.g. id3, exif, TCP/IP headers, http headers, code comments, parameters, etc...)
  • steganograpy (whitespace, audio encapulation, spectralgraphics, track 0 [deepsound], images, bitorder/LSB [copy x.jpg+y.zip z.jpg])

Hiding code

Some tricks can be used to hide site code:

document.onkeydown = function(e) {
    if(e.keyCode == 123) {
     return false;
    }
    if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){
     return false;
    }
    if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){
     return false;
    }
    if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){
     return false;
    }

    if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)){
     return false;
    }      
 }
 window.history.pushstate: http://freelancer.usercv.com/blog/28/hide-website-source-code-in-view-source-using-stupid-one-line-chinese-hack-code
*// AFTER SOME LONG WHITE SPACES HERE  /.source.replace(/.{7}/g,function(w){document.write(String.fromCharCode(parseInt(w.replace(/ /g,'0').replace(/   /g,'1'),2)))});

localStorage.setItem, sessionStorage.setItem, cookies.set

  • html:

Constrants

  • CTF Should focuse on WWW stacks while keeping it fun with a puzzle box in design.
  • Flags should not be dependent on others
  • Flags should not be more than three levels deep.
  • flags should "look" like ipv6/mac addresses or be the fingerprint from an ssl cert

Deltas

Action items

@samy.pl research how he's hidding his eggs/flags @hackthissite research a few of their examples @google research how to POST/PUT to a firebase db

MD_FILES=$(shell find . -name \*.md)
# HTML
HTML_FILES=$(MD_FILES:.md=.html)
BUILD_HTML_FILES=$(HTML_FILES:%=build/%)
# PDF
PDF_FILES=$(MD_FILES:.md=.pdf)
BUILD_PDF_FILES=$(PDF_FILES:%=build/%)
EXTRA_PDFS=sample-midterm-solutions.pdf
all: $(BUILD_HTML_FILES)
build/%.pdf: %.md
@mkdir -p $$(dirname $@)
pandoc -V geometry:margin=1in -o $@ $?
build/assets/%: assets/%
@mkdir -p $$(dirname $@)
cp $? $@
build/%.html: %.md template.html
@mkdir -p $$(dirname $@)
pandoc -o $@ --template=template.html $<
deploy:
rsync --recursive --human-readable --delete -e ssh --info=progress2 build/* $(RHOST)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment