Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Nothing

Suchakra Sharma tuxology

💭
Nothing
View GitHub Profile
View imperial_march.sh
sudo modprobe pcspkr
sudo beep -l 350 -f 392 -D 100 --new -l 350 -f 392 -D 100 --new -l 350 -f 392 -D 100 --new -l 250 -f 311.1 -D 100 --new -l 25 -f 466.2 -D 100 --new -l 350 -f 392 -D 100 --new -l 250 -f 311.1 -D 100 --new -l 25 -f 466.2 -D 100 --new -l 700 -f 392 -D 100 --new -l 350 -f 587.32 -D 100 --new -l 350 -f 587.32 -D 100 --new -l 350 -f 587.32 -D 100 --new -l 250 -f 622.26 -D 100 --new -l 25 -f 466.2 -D 100 --new -l 350 -f 369.99 -D 100 --new -l 250 -f 311.1 -D 100 --new -l 25 -f 466.2 -D 100 --new -l 700 -f 392 -D 100 --new -l 350 -f 784 -D 100 --new -l 250 -f 392 -D 100 --new -l 25 -f 392 -D 100 --new -l 350 -f 784 -D 100 --new -l 250 -f 739.98 -D 100 --new -l 25 -f 698.46 -D 100 --new -l 25 -f 659.26 -D 100 --new -l 25 -f 622.26 -D 100 --new -l 50 -f 659.26 -D 400 --new -l 25 -f 415.3 -D 200 --new -l 350 -f 554.36 -D 100 --new -l 250 -f 523.25 -D 100 --new -l 25 -f 493.88 -D 100 --new -l 25 -f 466.16 -D 100 --new -l 25 -f 440 -D 100 --new -l 50 -f 466.16 -D 400 --new -l 25 -f 311.13 -D 200 --ne
@tuxology
tuxology / sym2addr-dwarf.c
Created Aug 2, 2013
Gives address of a symbol from a binary (using libdwarf)
View sym2addr-dwarf.c
/*
* Get address from symbol (libdwarf version)
* Based on code by : Eli Bendersky (http://eli.thegreenplace.net)
*
*/
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
@tuxology
tuxology / calltree.sc
Last active Apr 7, 2021
Print call-tree in ASCII usig Ocular
View calltree.sc
// calltree.sc
// -----------
//
// Suchakra Sharma <suchakra@shiftleft.io> (2019)
//
// Prints the complete call-tree with all possible branches starting from the top of the input method. It is recommended to increase
// the max steps per query to a higher number (eg. "config.query.maxStepsPerCallQuery = 1000000L") for better results.
//
// Example Usage:
// ocular> import $file.scripts.calltree
View epoc_setup.md

Installing EPOC Emulator

Fedora

  • Install Wine : sudo dnf install wine
  • Download the Symbian OS V5 emulator from here
  • Extract the files under ~/.wine/dosdevices/c:/

Running the EPOC Emulator

View gist:91ab9cd7efb7ccf006eec49417939575
Basic Commands
==============
sl ocular -- --import scripts/deps.sc
import $file.scripts.java.ROOTKIT_suspicious_literals
cpg.method.fullName.l
cpg.method.name("executeQuery").caller.fullName.l
cpg.sink.method.name.l
View contextual-sca-tarpit.json
[
{
"groupId": "net.lingala.zip4j",
"artifactId": "zip4j",
"version": "1.3.2",
"callGraph": {
"cveId": "CVE-2018-1002202",
"versionRanges": [
"[0,1.3.3)"
],
View path-traversal.java
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
String resourceName = req.getParameter( "resourceName" );
BufferedReader r = new BufferedReader( new FileReader( resourceName ) );
while ( ( x = r.readLine() ) != null ) {
resp.getWriter().println( x );
}
}
@tuxology
tuxology / lttng-netif-filter.c
Last active Jan 2, 2018
LTTng netif_receive_skb eBPF filter
View lttng-netif-filter.c
/*
* addons/lttng-netif-filter.c
*
* A filtered version of netif_receive_skb
*
* Copyright (C) 2014 Suchakra Sharma <suchakrapani.sharma@polymtl.ca>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; only
@tuxology
tuxology / lttng-sched-filter.c
Created Dec 8, 2014
LTTng sched_switch eBPF filter
View lttng-sched-filter.c
/*
* addons/lttng-sched-filter.c
*
* A filtered version of sched_switch
*
* Copyright (C) 2014 Suchakra Sharma <suchakrapani.sharma@polymtl.ca>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; only
@tuxology
tuxology / Vagrantfile
Created Nov 20, 2015
Kernel Development Vagrant Setup
View Vagrantfile
Vagrant.configure(2) do |config|
config.vm.define :kerneldev do |kerneldev|
kerneldev.vm.box = "fedora/23-cloud-base"
kerneldev.vm.provider :libvirt do |domain|
domain.memory = 2048
domain.cpus = 4
end
config.vm.provision :shell, :path => "bootstrap.sh"
end
end