Skip to content

Instantly share code, notes, and snippets.

View shahril96's full-sized avatar
🐢

Mohd Shahril shahril96

🐢
View GitHub Profile
@shahril96
shahril96 / dns.bat
Last active October 31, 2015 00:40
Google DNS automation tool for Windows's network adapter
@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
@shahril96
shahril96 / lafarge_keygenme.c
Last active November 2, 2015 13:52
LaFarge's crackme #2 solution in C
#include <stdio.h>
/*
crackme link : http://crackmes.de/users/lafarge/lafarges_crackme_2/
*/
void xor_data(char *src, int nsrc, char *byte)
{
for(int i = 0; nsrc-- > 0; i++)
{
@shahril96
shahril96 / level2.c
Created November 2, 2015 13:53
borismilner's 4N006135 level-2.exe keygenme solution
#include <stdio.h>
#include <string.h>
int main()
{
char key[40] = {0};
memset(key, 'O', 32);
int i = 0;
unsigned id;
@shahril96
shahril96 / riger_brute.php
Last active December 30, 2015 19:49
Brute force TM Riger router using PHP script
<?php
date_default_timezone_set('Asia/Kuala_Lumpur'); // Here is important for new PHP version.
define('size', 10); // multithread
define('ip', NULL);
define('start', 0x0); // what hex to start
define('sleept', 10); // sleep time if failed
define('attempt', 10000); // how many attempts
define('usleept', 100000); // micro sleep after current attempt
define('timeout', 10); // timeout for each multi request
@shahril96
shahril96 / montecarlo-pi.cpp
Last active December 22, 2015 16:27
Calculate approximation of π using Monte Carlo simulation
#include <iostream> // cout, cin
#include <cmath> // sqrt, pow
#include <random> // random_device, mt19937, uniform_real_distribution
#include <iomanip> // setprecision
#include <ctime> // time
#include <cstdint> // uint64_t
uint64_t s[2] = {(uint64_t)time(NULL) % 100, (uint64_t)time(NULL) % 10000};
int xorshift128(int start, int end) {
@shahril96
shahril96 / instagram-fetcher.php
Last active April 12, 2018 06:57
Simple Instagram media info fetcher
<?php
/*
* title : simple instagram info fetcher
*
* author : shahril
* receipant : afif zafri
* date : 29-dis-2015
*/
@shahril96
shahril96 / saps-fetcher.php
Last active January 1, 2016 13:18
Simple SAPS data fetcher
<?php
$get = file_get_contents("https://sapsnkra.moe.gov.my/ibubapa2/semak.php?txtIC=010610101490&Semak=Semak+Laporan&jenissek=2&tahun_semasa=2015");
// build up custom header + cookie
preg_match_all('#Set-Cookie: (.*?);#', implode('', $http_response_header), $out);
$opts = array('http'=>array('header'=> "Cookie: " . implode('; ', $out[1]) . "\r\n"));
$get = file_get_contents("https://sapsnkra.moe.gov.my/ibubapa2/menu.php", false, stream_context_create($opts));
preg_match_all('#<strong>(.*?)&nbsp;</strong>#', $get, $out);
@shahril96
shahril96 / percolate_threshold.cpp
Created January 22, 2016 16:57
Calculate percolation threshold using Monte Carlo simulation
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Author: shahril
*
* Created on January 22, 2016, 5:21 PM
@shahril96
shahril96 / postfix.java
Created February 19, 2016 06:32
Infix to Postfix - Java Converter (no invalid expressions checking)
import java.util.*;
public class postfix {
public static void main(String args[]) {
String infix = "x-(y*a/b-(z+d*e)+c)/f";
System.out.println("Infix : " + infix);
System.out.println("Postfix : " + inf2postf(infix));
@shahril96
shahril96 / bstree.cpp
Last active April 15, 2019 07:11
Ayam implementation of Binary Search Tree in C++
/*
* Ayam implementation of Binary Search Tree
*
* references :-
* https://en.wikipedia.org/wiki/Binary_search_tree
* http://geeksquiz.com/binary-search-tree-set-2-delete/
*
* ~ not very descriptive compile guide (linux) ~
* $ g++ bstree.cpp -o bstree -std=c++11