Skip to content

Instantly share code, notes, and snippets.

View niklasad1's full-sized avatar

Niklas Adolfsson niklasad1

View GitHub Profile
@niklasad1
niklasad1 / terminator.config
Last active August 30, 2017 19:33
terminator.config
[global_config]
enabled_plugins = CustomCommandsMenu, TestPlugin, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
title_font = Ubuntu Mono 9
title_use_system_font = False
[keybindings]
page_down_half = Page_Down
page_up_half = Page_Up
[layouts]
[[default]]
[[[child1]]]
@niklasad1
niklasad1 / strip_debug_symbols.md
Last active August 29, 2017 14:24
strip of debug symbols
$ objcopy --only-keep-debug "${tostripfile}" "${debugdir}/${debugfile}"
$ strip --strip-debug --strip-unneeded "${tostripfile}"
$ objcopy --add-gnu-debuglink="${debugdir}/${debugfile}" "${tostripfile}"
@niklasad1
niklasad1 / statusline
Created April 2, 2017 14:29
statusline
#!/bin/bash
echo '{"version":1}'
echo '['
echo '[],'
exec conky -c $HOME/.conkyrc
@niklasad1
niklasad1 / .conkyrc
Created April 2, 2017 14:28
conkyrc
out_to_x no
own_window no
out_to_console yes
background no
max_text_width 0
net_avg_samples 3
# Update interval in seconds
update_interval 2
@niklasad1
niklasad1 / config
Created April 2, 2017 13:56
i3 config
#set mod key to win
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:System San Fransisco Display 11
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
@niklasad1
niklasad1 / .zshrc
Created January 28, 2017 10:35
.zshrc
#--------------------ENV Variables---------------------------------------------#
export LANG=en_US.UTF-8 # UTF8
export TERM="xterm-256color" # 256 color schemes support
export EDITOR=vim
export SSH_KEY_PATH="~/.ssh/dsa_id" # ssh key
export VIMRC=$HOME/.vimrc
#-----------------------------------------------------------------------------#
#---------------------OH-MY-ZSH SETTINGS------- ------------------------------#

Level 0

ssh into the machine by

ssh [email protected]
pwd: narnia0

check narnia0.c and it's obviously vulnerable to a buffer overflow i.e. scanf read 24 chars into a 20 char buffer. Thus we need to enter 20 random chars + 0xdeadbeef.

But first check the architechture i.e. how the byte is read by the processor.

Keybase proof

I hereby claim:

  • I am niklasad1 on github.
  • I am niklasad1 (https://keybase.io/niklasad1) on keybase.
  • I have a public key whose fingerprint is 212D 86C2 71EE 3B70 8777 D5C4 A5C9 609E 830D 742A

To claim this, I am signing this object:

# Initial setup
set -g default-shell /bin/zsh
set -g default-terminal screen-256color
set -g status-keys vi
# Prefix
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
@niklasad1
niklasad1 / .vimrc
Last active September 5, 2017 08:24
vimrc
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" " let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
Plugin 'Chiel92/vim-autoformat'