Skip to content

Instantly share code, notes, and snippets.

@haidarns
haidarns / ecosystem.config.js
Last active January 7, 2024 10:35
Running Nginx and PHP-FPM with PM2. Used on https://github.com/haidarns/dockerfile-collection.
let fs = require('fs')
const baseDir = __dirname+'/apps'
module.exports = fs.readdirSync(baseDir).map((current, i, all) => {
let content = fs.readFileSync(baseDir+'/'+current)
const config = JSON.parse(content)
return config
}, {}).flat()
@haidarns
haidarns / .0.md
Last active August 22, 2023 18:23

CPanel Backdoor for certbot-dns-cpanel Authentication

Inspired by wonderful PHP Transparent Reverse Proxy project by https://github.com/michaelfranzl/no.php .

This backdoor file provide access to CPanel API that blocked from public internet (usually by Imunify or another FW) to run certbot-dns-cpanel.

Setup

  1. Create new sub domain site via cpanel. Ensure this subdomain is hard to guess.
  2. Open file manager, put below file .htaccess (prevent file indexing) and no.php (or you can rename it to hard-to-guess file name)
  3. Testing your backdoor url using simple cURL
@haidarns
haidarns / fibonacci-simple-web-server.py
Last active May 27, 2018 03:29 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./fibonacci-simple-web-server.py [<port>]
Send a GET request::
curl http://localhost
@haidarns
haidarns / Dockerfile
Last active May 20, 2018 06:36
RYU Controller on Alpine Linux Container Dockerfile
# RYU Controller on Alpine Linux Container
#
# This file inspired by http://ryu.readthedocs.io/en/latest/getting_started.html
#
# Build image using this Dockerfile:
# docker build -t haidarns/ryu .
#
# Run container using this image:
# docker run -it -p 6633:6633 haidarns/ryu
@haidarns
haidarns / Dockerfile
Last active April 15, 2018 11:51
Floodlight Controller on Alpine Linux Container Dockerfile
# Floodlight Controller on Alpine Linux Container
#
# This file inspired by https://floodlight.atlassian.net/wiki/spaces/floodlightcontroller/pages/1343544/Installation+Guide
#
# Build image using this Dockerfile
# docker build -t haidarns/floodlight .
#
# Run container using this image:
# docker run -it -p 6653:6653 -p 8080:8080 haidarns/floodlight
@haidarns
haidarns / Dockerfile
Last active April 14, 2018 18:56
POX Controller on Alpine Linux Container Dockerfile
# POX Controller on Alpine
#
# This file inspired by https://github.com/noxrepo/pox
#
# Build image using this Dockerfile
# docker build --build-arg version=eel .
#
# Available POX Version : angler, betta, carp, dart, eel
FROM alpine:latest