Skip to content

Instantly share code, notes, and snippets.

View jduck's full-sized avatar
🏠
Working from home

Joshua J. Drake jduck

🏠
Working from home
View GitHub Profile
@jduck
jduck / adb-stty-cd-data-local-tmp2.diff
Created February 6, 2014 17:58
Patch for AOSP's adb client to automatically change directory, set terminal size, and set environment vars.
#
# patch adb to:
# 1. use busybox to set the same terminal size
# 2. change directory to /data/local/tmp automatically
#
# NOTE: needs an executable busybox in /data/local/tmp
#
# Joshua J. Drake - jduck
#
### Keybase proof
I hereby claim:
* I am jduck on github.
* I am jduck (https://keybase.io/jduck) on keybase.
* I have a public key whose fingerprint is 6418 2CD3 AD92 C3E4 C60A 42BF 1373 2308 34DA 0132
To claim this, I am signing this object:
@jduck
jduck / trustnocerts.sh
Last active August 29, 2015 14:07
Disable all Trusted CA CERTs on Android 4.x and later (requires root)
#!/system/bin/sh
#
# disables all trusted root certs on your Android 4.x
# by jduck of #droidsec
#
# requires a working openssl binary in /data/local/tmp
# (you can build one from AOSP "make openssl")
#
# run this as system!! for example:
# shell@flo:/data/local/tmp $ su system -c ./trustnocerts.sh
@jduck
jduck / make-links.rb
Created December 7, 2014 18:44
Test results from an experiment with optimizing Metasploit
--- src/uniq.c.orig 2013-01-30 18:46:24.000000000 -0600
+++ src/uniq.c 2015-02-23 02:30:06.000000000 -0600
@@ -66,6 +66,7 @@
enum countmode
{
count_occurrences, /* -c Print count before output lines. */
+ count_syslog, /* -l Print "last line repeated XX times" */
count_none /* Default. Do not print counts. */
};
#!/usr/bin/env ruby
#
# PoC to show bug in ProgressBar/Zlib handling
#
# Joshua J. Drake (jduck)
#
COMPRESSED_WRONG_SIZE_URL = "http://sourceforge.net/projects/pocfiles/files/"
require 'uri'
diff --git a/project.py b/project.py
index 8b02b7c..890de8c 100644
--- a/project.py
+++ b/project.py
@@ -1878,6 +1878,7 @@ class Project(object):
ssh_proxy=ssh_proxy)
ret = gitcmd.Wait()
if ret == 0:
+ print(gitcmd.stderr, file=sys.stderr)
ok = True
Script started on Mon 16 Mar 2015 10:42:04 PM CDT
duoct:0:~$ cd work
duoct:0:~/work$ ls -l fread-intof.c
-rw------- 1 jdrake jdrake 500 Jun 13 2013 fread-intof.c
duoct:0:~/work$ cat fread-intof.c
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int
{
"lang": "en",
"retweeted": false,
"favorited": false,
"entities": {
"urls": [],
"user_mentions": [
{
"indices": [
0,
--- crackaddr-bad.c.1 2011-08-25 14:37:47.000000000 -0500
+++ crackaddr-bad.c 2015-03-27 22:42:59.956804489 -0500
@@ -85,8 +85,11 @@
#include <string.h>
#include <ctype.h>
+#include <unistd.h>
+#include <fcntl.h>
+
/* ccured needs this */