Dynamic analysis using radare2 opens the floodgates into understanding how assembly programs work. Often it is useful to be able to reassure one's understanding of x86 assembly by watching the program execute step-by-step, making predictions about what one expects to happen next and verifying that it does! Below is a short how-to on using radare2 for debugging in a way familiar to those who are more familiar with gdb.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This bash script contains shared logic that is used to parse | |
# command line arguments. It is meant to be sourced from within the | |
# build scripts. | |
# This script parses command line arguments and exposes variables such | |
# as $PROFILE, and $FEATURES. | |
# | |
# Variables: | |
# | |
# $PROFILE: Can contain "--release" or "". By default it is set to | |
# "--release". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0.0.0.0 apps.facebook.com | |
0.0.0.0 connect.facebook.net | |
0.0.0.0 facebook.com | |
0.0.0.0 fbcdn.com | |
0.0.0.0 fbsbx.com | |
0.0.0.0 fbcdn.net | |
0.0.0.0 graph.facebook.com | |
0.0.0.0 login.facebook.com | |
0.0.0.0 s-static.ak.facebook.com | |
0.0.0.0 static.ak.connect.facebook.com |
I hereby claim:
- I am donkey-hotei on github.
- I am donkey_hotei (https://keybase.io/donkey_hotei) on keybase.
- I have a public key ASBzQ1LoMqrkm3KlQr45IwA52K9gBBNekG9KqT2aKZyPtAo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in /controllers/api/sessions_controller.rb | |
module Api | |
class SessionsController < Devise::SessionsController | |
skip_before_action :verify_authenticity_token, only: [:create, :facebook] | |
respond_to :json | |
# ... | |
def create | |
@user = warden.authenticate(scope: resource_name, recall: "#{controller_path}#new") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import errno, os, socket, sys | |
# | |
# Debug python progams over network with TCP sockets. | |
# | |
# | |
_dbg = _socket = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
x="f(t%2)else";python3 -c"[print(t>>15&(t>>(2$x 4))%(3+(t>>(8$x 11))%4)+(t>>10)|42&t>>7&t<<9,end='')for t in range(2**20)]"|aplay -c2 -r4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: this code will _not_ compile | |
void phase_1(char ** input) { | |
if (input != "Public speaking is very easy.") | |
explode_bomb(); | |
else | |
return; | |
} | |
void phase_2(char ** input) { | |
int ar[6]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# CAM Table Overflow is all about flooding a | |
# switches CAM table with a lot of fake MAC | |
# addresses to drive the switch into HUB mode. | |
from scapy.all import * | |
from random import randint | |
import subprocess | |
# import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: latin-1 -*- | |
# a python stealth port scanner | |
from logging import getLogger, ERROR | |
getLogger("scapy.runtime").setLevel(ERROR) | |
from scapy.all import * | |
from datetime import datetime | |
from time import stdftime |
NewerOlder