Skip to content

Instantly share code, notes, and snippets.

View Enigmatrix's full-sized avatar
🛠️
Tinkering

Chandrasekaran Akash Enigmatrix

🛠️
Tinkering
View GitHub Profile
@Enigmatrix
Enigmatrix / GDB Cheatsheet.md
Last active June 18, 2024 18:08
GDB Cheatsheet using pwndbg

GDB Cheatsheet

Setup

First of all, we need to install GDB: sudo apt install gdb

Next we will be installing an extension to GDB called pwndbg that will make our life easier. Instructions for installation are here.

You can verify that your installation works by running gdb /bin/true in your command line, then running start when the prompt shows.

<?php
echo 'hello';

Stuff ToDo

  • move all strings into file
  • rename Commands
  • redo algo to satisfy
  • comment poll.ts
  • use ! on unintializable types in poll.ts
  • erase L240 in poll.ts
  • uniquer.add only after all role stuff else bug when removed
  • IMPT: assign roles as they press the button
  • IMPT: check 1 unique player per role
@<?php
echo exec('whoami');
okokokokokok
<script>alert(1)</script>
</textarea>
<script>alert(1);</script>
<textarea>

Keybase proof

I hereby claim:

To claim this, I am signing this object:

Type of Attack

  1. Stack overflow
  2. Heap overflow
  3. Format String
  4. NULL byte / Off by one

Format String Attack Tips

  1. look at registers/stack, one of them will inevitably point to another value on stack (can do arbitrary read/write with this)
  2. look at registers/stack, one of them will point to libc's functions
  3. writing null bytes after a value can be done with %ln (write long int)

Start (can combine options e.g. r2 -d -A file)

  • r2 file - start r2 session about file
  • r2 -d pid - start r2 debug session attached to pid
  • r2 -d file - start r2 debug session
  • r2 -A file - start session, analyse everything first
  • r2 -R profile.rr2 - start session using profile

Learning Notes

  1. <cmd> - run cmd (duh)
  2. <cmd> @ <addr> - runs cmd at addr
  3. ~\ - \ | grep \
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>SayIt</title>
<link rel="stylesheet" href="styles.css">
<script src="scripts.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<style id="jsbin-css">
body{
font-family: 'Open Sans', sans-serif;
@Enigmatrix
Enigmatrix / index.html
Created May 14, 2015 00:03
MEMEMEMEMEMEMEMEMEM // source http://jsbin.com/yusifo
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<title>MEMEMEMEMEMEMEMEMEM</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="https://cdn.firebase.com/js/client/2.2.1/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/angularfire/1.0.0/angularfire.min.js"></script>
<link href="main.css" rel="stylesheet">
<style id="jsbin-css">