Skip to content

Instantly share code, notes, and snippets.

View stypr's full-sized avatar
🆎**********************************
Be Lazy~

stypr

🆎**********************************
Be Lazy~
View GitHub Profile
@stypr
stypr / ping.php
Created February 6, 2015 19:15
cloudflare auto ddns + memory flush
#!/usr/bin/php
<?php
/*
* crontab -e
* 0 5 * * * ~/ping.php
*/
error_reporting(0);
set_time_limit(0);
@stypr
stypr / HOWTO.md
Last active August 17, 2019 19:55
MacPorts Yosemite PHP+nginx Installation

Note that the installiation of nginx+php5 on MACOSX IS NOT RECOMMENDED unless you know what you're trying to do.

  • both services are going to be running as root
  • there is no configuration file set for php-cgi53

Tested on OSX 10.10.2 (Yosemite)

Refer to https://gist.github.com/renjunkui/1267057 for lower versions of MACOSX.

# install MacPorts at http://www.macports.org/install.php
@stypr
stypr / wlan_mac.py
Created February 7, 2015 06:05
Change WLAN MAC address randomly in OSX
#!/usr/bin/python
import os
import sys
check_root = os.popen("whoami").read().strip()
if check_root == "root":
mac_real = os.popen("ifconfig en0 | grep ether") \
.read().strip().replace("ether ", "")
mac_hex = os.popen("openssl rand -hex 6").read().strip()
@stypr
stypr / wipe.sh
Last active August 17, 2019 19:34
Wipe the empty disk space on Linux
$ screen -X
$ cat /dev/zero > ~/zero.fill; sync; sleep 1; sync; rm -f ~/zero.fill;
(ctrl+a)
@stypr
stypr / VirtualMachineDetect.bas
Created February 7, 2015 06:11
Detect software-based Virtual Machine in VB6
Public Function VirtualMachineProtect() As Boolean
'VMs are easily detectable by registry and library checkup
On Error Resume Next
Dim hKey As Long, hOpen As Long, hQuery As Long, hSnapShot As Long
Dim me32 As MODULEENTRY32
Dim szBuffer As String * 128
hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId)
me32.dwSize = Len(me32)
Module32First hSnapShot, me32
Do While Module32Next(hSnapShot, me32) <> 0
@stypr
stypr / install.sh
Last active August 17, 2019 19:39
Install newest version of ARM nginx on Raspberry Pi
cd /tmp
apt-get build-dep nginx
apt-get source nginx
cd /tmp/nginx-1.4.2 && sudo dpkg-buildpackage -uc -b
service nginx stop
apt-get remove nginx
dpkg-deb -I /tmp/nginx_1.4.2-1~squeeze_armhf.deb
dpkg -i /tmp/nginx_1.4.2-1~squeeze_armhf.deb
# in case of dpkg error use the following command:
@stypr
stypr / gist:1bbed682337cdd64e101
Created February 11, 2015 03:27
IP ban and check for fake IPs
<?php
/* This won't work on Tor services */
function checkSecurity(){
$list = "ban.txt";
$deny = array();
$fo = fopen($list, "r");
$str = fread($fo, filesize($list));
fclose($fo);
$str = str_replace(",","_",$str);
$ary = explode("_",$str);
@stypr
stypr / pipupdate.py
Created July 1, 2015 09:24
pip update all packages
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)
@stypr
stypr / pwn.py
Last active August 17, 2019 19:33
jff3 2015: web_mbm2 exploit
#!/usr/bin/python
'''
how to use
1) python pwn.py 1
2) python pwn.py 5
3) look at the "pwn.py 1" instance
'''
@stypr
stypr / query.php
Last active August 17, 2019 19:44
MySQL Query class for php5/php7, made for personal use
<?php
error_reporting(0);
if(__CHECK_INTERNAL__ == False) die();
// SQL Query Selector for PHP5/PHP7, Who cares if it's vulnerable? \o/
class Query{
private $conn, $mysqli;
function check(){
return ($this->conn) ? True : False;
}
function connect($host, $username, $password, $db=""){