Hello World

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Header 1

(Header 1 doesn’t show in contents so maybe don’t use them)

Header 2

Header 3

Header 4

Code Blocks

Normal

1
2
3
from Crypto.Cipher import AES
a = "Normal codeblocks works ig"
print(a)

Custom Code Block

But I have copied jktrn’s codeblock thingy with all the bells and whistles if you wanna add fancy things like captions, urls and scrolling etc

vuln-0.c[download source]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>

#define FLAGSIZE_MAX 64

char flag[FLAGSIZE_MAX];

void sigsegv_handler(int sig) {
  printf("%s\n", flag);
  fflush(stdout);
  exit(1);
}

void vuln(char *input){
  char buf2[16];
  strcpy(buf2, input);
}

int main(int argc, char **argv){
  
  FILE *f = fopen("flag.txt","r");
  if (f == NULL) {
    printf("%s %s", "Please create 'flag.txt' in this directory with your",
                    "own debugging flag.\n");
    exit(0);
  }
  
  fgets(flag,FLAGSIZE_MAX,f);
  signal(SIGSEGV, sigsegv_handler); // Set up signal handler
  
  gid_t gid = getegid();
  setresgid(gid, gid, gid);


  printf("Input: ");
  fflush(stdout);
  char buf1[100];
  gets(buf1); 
  vuln(buf1);
  printf("The program will exit now\n");
  return 0;
}

You can even do line breaks, highlight code as if it was added, deleted or just normally highlight it in yellow. Btw post-line break for some reason everything is -1 idk why you can try to comprehend the ccb source code at themes/cactus/scripts/ccb.js

Rickroll[rickroll]
1
2
3
6
7
function helloworld(){
console.log('balls');
}
4-5
helloWorld();
const rick = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
you can also highlight certain segments of code by manually using html
For super long text, you can make it wrapped. So any exceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees gets wrapped
If you want to simulate a terminal rather than a code editor, there's an option for that too

Math?

We are using this extension

KaTeX

c=±a2+b2c = \pm\sqrt{a^2 + b^2}

MathJax example

wait you can just use $$:

$c = \pm\sqrt{a^2 + b^2}$

People

inline people like treeindustry foo tomato hartmannsyg fs

add people by editing themes/cactus/scripts/person.js

Authoring

simply do author-<name> like so for tags, all tags that start with author- get hidden through some black magic at themes/cactus/layout/_partial/post/tag.ejs

1
2
3
tags: 
- web
- author-hartmannsyg

Pasting (colored) stuff from terminal

the easiest way is to embed html into the md file like so:

┌──(rwandi㉿ryan)-[~/ctf/nbctf/pico]
└─
$ pwndbg vuln
Reading symbols from
vuln...
(No debugging symbols found in
vuln)
Cannot convert between character sets `UTF-32' and `UTF-8'
pwndbg: loaded 147 pwndbg commands and 45 shell commands. Type pwndbg [--shell | --all] [filter] for a list.
pwndbg: created
$rebase, $ida GDB functions (can be used with print/break)
------- tip of the day (disable with
set show-tips off) -------
Use plist command to dump elements of linked list
pwndbg>

for this html, I used Windows Terminal (the new one), went into its Settings > Interaction > “Text formats to copy to the clipboard” > Change to “HTML”

Then when you copy the thing, you have to somehow get the html instead of the raw text. Idk how to do that with python so I go to new tab, in the Inspect Element Console tab I paste in this js:

1
2
3
4
5
6
7
8
9
10
11
12
13
document.addEventListener('paste', function(e) {
var html = e.clipboardData.getData('text/html');
html = html.replaceAll(/<.?html>/gi,'')
html = html.replaceAll(/<.?head>/gi,'')
html = html.replaceAll(/<.?body>/gi,'')
html = html.replaceAll('<BR>','\n')
html = html.replaceAll('<!--StartFragment -->','')
html = html.replaceAll('<!--EndFragment -->','')
html = html.replaceAll(/<div style=".+?;">/gi,'')
html = html.replaceAll('</DIV>','')
html = html.replaceAll(/background-color:#.+?;/gi,'')
console.log(html)
})

then it logs the html for me

I then remove the <HTML>, <HEAD> and <BODY> tags all the background-color:#0c0c0c; attribute and also changed the font-size to 13px