This article is now published on my website: A one-off git repo server.
This file contains hidden or 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
# Copyright @ Bjarte Johansen 2012 | |
# License: http://ljos.mit-license.org/ | |
from AppKit import NSApplication, NSApp, NSWorkspace | |
from Foundation import NSObject, NSLog | |
from PyObjCTools import AppHelper | |
from Quartz import kCGWindowListOptionOnScreenOnly, kCGNullWindowID, CGWindowListCopyWindowInfo | |
class AppDelegate(NSObject): | |
def applicationDidFinishLaunching_(self, notification): |
This file contains hidden or 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
E/RILC ( 128): RIL_register: RIL version 6 | |
D/RILB ( 501): /proc/cmdline=console=ttyMSM2,115200n8 androidboot.hardware=semc totalmem=0x200 startup=0x00000030 serialno=CB5A1HBN21 bt0.ieee_addr=84:00:d2:90:dc:ab wifi0.eth_addr=84:00:d2:d1:1b:c8 | |
D/RILB ( 501): getLteOnCdmaMode=0 curVal=-1 product_type='' lteOnCdmaProductType='' | |
D/RILB ( 501): getLteOnCdmaMode=0 curVal=-1 product_type='' lteOnCdmaProductType='' | |
I/PHONE ( 501): Network Mode set to 0 | |
D/RILB ( 501): getLteOnCdmaMode=0 curVal=-1 product_type='' lteOnCdmaProductType='' | |
I/PHONE ( 501): lteOnCdma is 0 use SUBSCRIPTION_FROM_NV | |
I/PHONE ( 501): Cdma Subscription set to 1 | |
I/PHONE ( 501): RILClassname is SemcRIL |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <windows.h> | |
#include <winsock.h> | |
#include <wininet.h> | |
#include <shellapi.h> | |
#include <mmsystem.h> | |
typedef struct vs { | |
char host[128]; |
This file contains hidden or 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 string,cgi,time, datetime | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
class MyHandler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
try: | |
self.send_response(503) # let bots know whats up | |
self.send_header('Content-type','text/html') | |
self.end_headers() | |
self.wfile.write('<!DOCTYPE html>\n<meta charset=utf-8 />\n<title>Notification page</title>\n') |
This file contains hidden or 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
# | |
# ASPack 2.29 unpacker via. Dynamic Analysis | |
# | |
$:.unshift("C:\\Lib\\metasm") | |
require 'metasm' | |
AS229_OEP_PUSH_OFFSET = 0x420 | |
def _msg(m, error = false) |
This file contains hidden or 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
/** | |
* Parses a string containing one or multiple JSON encoded objects in the string. | |
* The result is always an array of objects. | |
* | |
* @param {String} data | |
* @return {Array} | |
*/ | |
function parseJson(data) { | |
data = data.replace('\n', '', 'g'); |
This file contains hidden or 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
# Step 1: Set priveleges | |
$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all | |
Starting... | |
Setting allow all users to YES. | |
Setting all users privileges to 1073742079. | |
Done. | |
# Step 2: Allow VNC clients |
This file contains hidden or 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
#!/bin/bash | |
#Close stdin - avoid accidental keypresses causing problems | |
exec 0>&- | |
# Find MKV files | |
for file in "$@"; | |
do | |
find "$file" -type f -not -name ".*" | grep .mkv$ | while read file | |
do |
This file contains hidden or 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
@contextlib.contextmanager | |
def capture(ifname, src, dst): | |
events = [] | |
filter = '(host %s and host %s) or icmp[0] = 11' % (src, dst) | |
p = subprocess.Popen( | |
['tcpdump', '-i', ifname, '-w', '-', filter], | |
stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) | |
try: | |
yield events | |
finally: |