Skip to content

Instantly share code, notes, and snippets.

View goeroeku's full-sized avatar

Agus Indra Cahaya goeroeku

View GitHub Profile
@goeroeku
goeroeku / findshell.pl
Last active October 21, 2021 22:30
Script to search for php shell. `for i in /srv/www/htdocs/ ; do perl findshell.pl 10 $i >> scanout.txt ; done`
#!/usr/bin/perl -w
# findshell v1.0 == code taken/modified from traps.darkmindz.com
#usage: ./findshell.pl
use strict;
use File::Find;
my $sens = shift || 10;
my $folder = shift || './';
find(\&backdoor, "$folder");
sub backdoor {
if ((/\.(php|txt)/)){
@goeroeku
goeroeku / docker-install-ubuntu.sh
Last active October 4, 2021 23:30
IDCH Docker Installation
#!/bin/bash
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
@goeroeku
goeroeku / config-one-click.sh
Last active September 21, 2021 04:12
IDCH One Install Mailcoach
#!/bin/bash
#
# Mailcoach activation script
#
# This script will configure Apache with the domain
# provided by the user and offer the option to set up
# LetsEncrypt as well.
# Enable Mailcoach on firstlogin
echo "This script will copy the Mailcoach installation into"
@goeroeku
goeroeku / main.go.md
Last active September 9, 2021 14:41
Golang STMP Without TLS

Script GoLang SMTP without TLS, used to test Postal Mail Server

package main

import (
	"crypto/tls"
	"errors"
	"log"
	"net/smtp"
@goeroeku
goeroeku / aes-256-cbc.js
Created April 12, 2021 08:15 — forked from siwalikm/aes-256-cbc.js
AES-256-CBC implementation in nodeJS with built-in Crypto library
'use strict';
const crypto = require('crypto');
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key
const IV = "5183666c72eec9e4"; // set random initialisation vector
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex');
const phrase = "who let the dogs out";
var encrypt = ((val) => {
@goeroeku
goeroeku / encryption.js
Created April 8, 2021 00:54 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@goeroeku
goeroeku / loadbalancer-nginx.md
Last active April 1, 2021 17:09
Install nginx

ex: vim /etc/nginx/sites-enabled/default

buat block pada site configurasi,tambahkan sejajar dengan block server{}

upstream php { 
  ip_hash;
  server unix:/run/php/php7.4-fpm.sock1 weight=100 max_fails=5 fail_timeout=5; 
  server unix:/run/php/php7.4-fpm.sock2 weight=100 max_fails=5 fail_timeout=5;
  server unix:/run/php/php7.4-fpm.sock; 
}
@goeroeku
goeroeku / chamilo.conf.md
Last active March 19, 2021 03:32 — forked from fer-ri/block.conf
Nginx Config Sites Available With Redirect Non Www To Www

untuk domain web chamilo

edit settingan domain.conf seperti script berikut dan jadikan komentar baris include snippets/php.conf:

location @rewrite{
    rewrite ^/courses/([^/]+)/scorm/(.*)$ /main/document/download_scorm.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/document/(.*)$ /main/document/download.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/work/(.*)$ /main/work/download.php?file=work/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/upload/(.*)$ /app/courses/$1/upload/$2 last;
    try_files $uri /index.php;
@goeroeku
goeroeku / jquery.slider.custom.step.js
Created February 3, 2021 23:19 — forked from thiyagaraj/jquery.slider.custom.step.js
jQuery UI slider, custom step or snap points
//This should have each valid amount that can be selected in the slider
var sliderAmountMap = [10000, 20000,30000, 40000, 45000,50000,65000];
$(function() {
$( "#slider" ).slider({
value: 4, //array index of onload selected default value on slider, for example, 45000 in same array will be selected as default on load
min: 0, //the values will be from 0 to array length-1
max: sliderAmountMap.length-1, //the max length, slider will snap until this point in equal width increments
@goeroeku
goeroeku / default.conf
Last active December 3, 2020 14:10
Nginx server block untuk proxy nodejs
server {
server_name nodejs.idch.my.id;
location / {
proxy_pass http://localhost:3000; #whatever port your app runs on
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;