Skip to content

Instantly share code, notes, and snippets.

View gnh1201's full-sized avatar
๐Ÿ‰
Your Watermelon OPEN UP!

Namhyeon, Go gnh1201

๐Ÿ‰
Your Watermelon OPEN UP!
View GitHub Profile
@gnh1201
gnh1201 / nanohttpd.java.part
Created July 30, 2019 06:33
NanoHTTPD secure connection
KeyStore keystore = KeyStore.getInstance("JKS");
InputStream keystoreStream = new FileInputStream("keystore.jks");
if (keystoreStream == null) {
throw new IOException("Unable to load keystore from classpath: " + "keystore.jks");
}
keystore.load(keystoreStream, "password".toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(keystore, "password".toCharArray());
makeSecure(NanoHTTPD.makeSSLSocketFactory(keystore, keyManagerFactory), null);
@gnh1201
gnh1201 / voice.xml
Created September 9, 2019 06:08
voice.xml
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="alice">Wake up. Wake up now.</Say>
</Response>
@gnh1201
gnh1201 / debug.c
Created October 23, 2019 15:03 — forked from Nordwald/debug.c
Code Injection
/*
* Gets Thread token for current thread.
* Returns NULL on failure.
*/
HANDLE GetCurrentThreadToken()
{
HANDLE hToken;
if (!OpenThreadToken(
@gnh1201
gnh1201 / process_hollowing.c
Created October 23, 2019 15:28 — forked from itsff/process_hollowing.c
A pretty neat exploit called Process Hollowing. You start a process suspended, then replace its content with the content of another.
#include <stdio.h>
#include <Windows.h>
#include <winternl.h>
#pragma comment(lib,"ntdll.lib")
EXTERN_C NTSTATUS NTAPI NtTerminateProcess(HANDLE,NTSTATUS);
EXTERN_C NTSTATUS NTAPI NtReadVirtualMemory(HANDLE,PVOID,PVOID,ULONG,PULONG);
EXTERN_C NTSTATUS NTAPI NtWriteVirtualMemory(HANDLE,PVOID,PVOID,ULONG,PULONG);
EXTERN_C NTSTATUS NTAPI NtGetContextThread(HANDLE,PCONTEXT);
@gnh1201
gnh1201 / dynamicload.js
Last active December 29, 2019 05:56
Dynamically (Programmatically) JS/CSS file load with callback function
// Dynamically (Programmatically) JS/CSS file load with callback function
// Go Namhyeon <[email protected]>
function loadJS(url, callback) {
var el = document.createElement("script");
el.src = url;
el.type = "text/javascript";
document.head.appendChild(el);
if(typeof(callback) == "function") {
el.onload = callback(el);
@gnh1201
gnh1201 / zabbix_audit.log
Last active December 31, 2019 02:08
Zabbix selinux module
type=AVC msg=audit(1577757179.300:42106): avc: denied { create } for pid=1659 comm="zabbix_server" name="zabbix_server_lld.sock" scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:zabbix_var_run_t:s0 tclass=sock_file permissive=0
type=AVC msg=audit(1577757189.516:42111): avc: denied { create } for pid=1709 comm="zabbix_server" name="zabbix_server_preprocessing.sock" scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:zabbix_var_run_t:s0 tclass=sock_file permissive=0
type=AVC msg=audit(1577757199.838:42116): avc: denied { create } for pid=1806 comm="zabbix_server" name="zabbix_server_lld.sock" scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:zabbix_var_run_t:s0 tclass=sock_file permissive=0
type=AVC msg=audit(1577757210.064:42121): avc: denied { create } for pid=1855 comm="zabbix_server" name="zabbix_server_lld.sock" scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:object_r:zabbix_var_run_t:s0 tclass=sock_file permissive=0
type=AVC msg=audit(157
@gnh1201
gnh1201 / jpgraph_stroke.php
Created February 5, 2020 06:55
jpgraph_stroke.php
<?php
require_once ('vendor/_dist/jpgraph/src/jpgraph.php');
require_once ('vendor/_dist/jpgraph/src/jpgraph_bar.php');
$id = get_requested_value("id");
// get extension information
$bind = array(
"id" => $id
);
@gnh1201
gnh1201 / bracket.php
Created February 15, 2020 19:09
PHP bracket expression parser (experimental)
<?php
$str = "aaa(b, x(), c(d,e), f(g), h(i(3), j, k(l, n(z(0), 1), m)))";
/*
a->b
a->x
a->c
a->c
a->f
h->i
@gnh1201
gnh1201 / api.cardano.php
Last active February 29, 2020 16:32
api.cardano.php (example of gnh1201/reasonableframework - https;//catswords.re.kr/go/framework)
<?php
loadHelper("string.utils");
loadHelper("colona.v1.format");
loadHelper("networktool");
$output = "false";
$mode = get_requested_value("mode");
$ne = get_network_event();
@gnh1201
gnh1201 / itsm.api.php
Last active February 25, 2020 10:48
itsm.api.php
<?php
/**
* @file itsm.api.php
* @author Go Namhyeon <[email protected]>
* @brief ITSM service interface module
* @framework https://github.com/gnh1201/reasonableframework
*/
if(!check_function_exists("itsm_get_data")) {
function itsm_get_data($resource, $bind=array()) {