Skip to content

Instantly share code, notes, and snippets.

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.

Debian: Mail Server

Intro

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

@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) \
class Completer:
def __init__(self, commands):
self.commands = commands
self.completed = None
for name, c in self.commands.items():
c._comp_positionals = len([a for a in c.parser._actions
if not a.option_strings])
def complete_cmd(self, command_name, argv):
@0xa
0xa / ping.js
Created November 19, 2015 00:26
Resource Timing API JavaScript ping
function perf_ping(host, callback, start) {
if (start == undefined) {
var perfEntries = performance.getEntries();
// use the last perf entry to ignore any request preceding
// this ping() call
start = 0;
for (var i = 0; i < perfEntries.length; i++) {
if (start < perfEntries[i].startTime) {
start = perfEntries[i].startTime;
}
#!/usr/bin/env python
"""
mostly-hot-resize a swap device from a Xen VM.
(Py 2/3)
usage:
vm # swapoff -a
host# ./reswap.py /etc/xen/vmname.cfg xvda1 1g
vm # swapon -a
@0xa
0xa / q3.py
Created February 26, 2017 22:20
#!/usr/bin/env python3
"""
Quake3/UrbanTerror OOB+Netchan protocol implementation.
Powered by boredom, di.fm/hardcore, and my secret love for Carmack.
"""
#!/usr/bin/env python3
"""
ROBCO Industries (TM) Password Recovery Tool
----
Next-generation hacking assistant for your RobCo Pip-Boy 3000.
> Words: seven peace broke small steal agree deity armed store empty codes brink
>
> try: peace (6 matches)
{
"Type": "UnencryptedConfiguration",
"Certificates": [
{
"GUID": "{9242db88-2f4e-4f11-9ade-6231b1961880}",
"Type": "Authority",
"X509": "-----BEGIN CERTIFICATE-----\nMIIG0zCCBLugAwIBAgIJAOOv2BdszSOVMA0GCSqGSIb3DQEBBQUAMIGhMQswCQYD\nVQQGEwJGUjERMA8GA1UEBxMIU29tZUNpdHkxHzAdBgNVBAoTFkNvZ25pdGl2ZSBD\ncnlwdG9ncmFwaHkxEzARBgNVBAsTCkNDcnlwdG9WUE4xEzARBgNVBAMTCkNDcnlw\ndG9WUE4xEzARBgNVBCkTCkNDcnlwdG9WUE4xHzAdBgkqhkiG9w0BCQEWEGNlcnRA\nY2NyeXB0by5vcmcwHhcNMTMwODEzMTgxOTQ4WhcNMjMwODExMTgxOTQ4WjCBoTEL\nMAkGA1UEBhMCRlIxETAPBgNVBAcTCFNvbWVDaXR5MR8wHQYDVQQKExZDb2duaXRp\ndmUgQ3J5cHRvZ3JhcGh5MRMwEQYDVQQLEwpDQ3J5cHRvVlBOMRMwEQYDVQQDEwpD\nQ3J5cHRvVlBOMRMwEQYDVQQpEwpDQ3J5cHRvVlBOMR8wHQYJKoZIhvcNAQkBFhBj\nZXJ0QGNjcnlwdG8ub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA\nxvkZj62nUvSjEPs1qBokLd8bBpBlLj6RGgJpfPqS/kKF0s1HpcYZynIcqP6Dw/Pi\nLFcTE1STzgFfcEdKLmZAH+JCFVpc9mRTXEifouBk+2j3MG9+j2GTXHCK5FMkcJWQ\no4YihO2UOLz8qz4yn3dmy0zP1UmqxB2SayYXhwT2+pDSTkBCP6YtRURVVNIVRM7A\n72hBUJ2dUgKHMTsBJSQj/11r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