Skip to content

Instantly share code, notes, and snippets.

View OsandaMalith's full-sized avatar

Osanda Malith Jayathissa OsandaMalith

View GitHub Profile
@OsandaMalith
OsandaMalith / HTMLEncode.java
Created August 22, 2015 10:28
HTML Encode function for Java
public class HTMLEncode {
public static void main(String[] args) {
System.out.println(HTMLEncode("Hi osanda \"><h1>XSS</h1>"));
}
public static String HTMLEncode(String s) {
StringBuilder out = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
@OsandaMalith
OsandaMalith / Root-me.c
Created October 6, 2015 06:21
Solving Root-Me XORed Picture Challenge
#include <stdio.h>
#define KEY_LENGTH 6
/*
* Title: Solving Root-Me XORed Picture Challenge
* Author: Osanda Malith Jayathissa (@OsandaMalith)
* Website: https://osandamalith.wordpress.com
*/
int main() {
FILE *fpIn, *fpOut;
@OsandaMalith
OsandaMalith / MyShell.c
Last active October 6, 2015 11:24
Simple Bind Shell using Fork
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define SERVER_PORT 9999
// CC-BY: Osanda Malith Jayathissa (@OsandaMalith)
int main() {
@OsandaMalith
OsandaMalith / BindShell.c
Last active March 25, 2022 13:54
Bind Shell using Fork for my TP-Link mr3020 router running busybox
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define SERVER_PORT 9999
/ * CC-BY: Osanda Malith Jayathissa (@OsandaMalith)
* Bind Shell using Fork for my TP-Link mr3020 router running busybox
#include <stdio.h>
#include <string.h>
int main() {
char name[61];
size_t i = 0;
int Char;
int Xor;
int total;
int sum;
@OsandaMalith
OsandaMalith / keygen.nasm
Created December 17, 2015 12:49
Rootme ELF - No software breakpoints Cracking Challenge
%if 0
* Title: Rootme ELF - No software breakpoints Cracking Challenge
* Author: Osanda Malith (@OsandaMalith)
* Website: http://osandamalith.wordpress.com
%endif
extern printf
extern exit
global main
@OsandaMalith
OsandaMalith / keygen.c
Last active March 26, 2020 14:53
Rootme ELF - No software breakpoints Cracking Challenge
#include <stdio.h>
/*
* Title: Rootme ELF - No software breakpoints Cracking Challenge
* Author: Osanda Malith (@OsandaMalith)
* Website: http://osandamalith.wordpress.com
*/
int main(int argc, char const *argv[]) {
size_t i;
unsigned int checksum;
@OsandaMalith
OsandaMalith / CheckRemoteDebuggerPresent.asm
Created February 12, 2016 13:07
Checks if the process is being dubugged or not using CheckRemoteDebuggerPresent
.386
.model flat, stdcall
option casemap :none
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
; Title: Checks if the process is being dubugged or not using CheckRemoteDebuggerPresent
; Author: Osanda Malith Jayathissa (@OsandaMalith)
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
include windows.inc
@OsandaMalith
OsandaMalith / ZwQueryInformationProcess.asm
Last active February 15, 2016 12:11
Checking if the process is being debugged using by a ring3 debugger using the kernel mode ZwQueryInformationProcess API
.386
.model flat, stdcall
option casemap :none
; »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
; Title: Checking if the process is being debugged by a ring3 debugger
; using the kernel mode ZwQueryInformationProcess API
;
; Author: Osanda Malith Jayathissa (@OsandaMalith)
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
@OsandaMalith
OsandaMalith / ZwQueryInformationProcess.c
Last active February 24, 2016 16:02
Checking if the process is being debugged using by a ring3 debugger using the kernel mode ZwQueryInformationProcess API
#pragma hdrstop
#pragma argsused
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
/* »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
* Title: Checking if the process is being debugged using by a ring3 debugger
* using the kernel mode ZwQueryInformationProcess API