Skip to content

Instantly share code, notes, and snippets.

View mpfund's full-sized avatar

Marinus Pfund mpfund

  • ifempty
  • Munich
View GitHub Profile
@mpfund
mpfund / main.go
Created May 24, 2017 09:45
golang upload file to aws
package main
import (
"compress/gzip"
"io"
"log"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
@mpfund
mpfund / main.cpp
Created December 31, 2016 11:24
dll in process injecten
#include <iostream>
#include <windows.h>
#include <psapi.h>
using namespace std;
int main()
{
DWORD pProcessIds[500];
@mpfund
mpfund / main.c
Created December 31, 2016 11:19
sockets in C
int main()
{
SOCKET sock;
sockaddr_in target;
unsigned long addr;
WSADATA wsaData;
WSAStartup(MAKEWORD(2,0),&wsaData);
target.sin_family = AF_INET;
target.sin_port = htons(80);
@mpfund
mpfund / bootstrap.js
Created August 9, 2016 06:31
modify firefox response (addon)
/////// START - DO NOT EDIT
var {classes: Cc, interfaces: Ci, results: Cr, Constructor: CC, utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
var BinaryInputStream = CC('@mozilla.org/binaryinputstream;1', 'nsIBinaryInputStream', 'setInputStream');
var BinaryOutputStream = CC('@mozilla.org/binaryoutputstream;1', 'nsIBinaryOutputStream', 'setOutputStream');
var StorageStream = CC('@mozilla.org/storagestream;1', 'nsIStorageStream', 'init');
function TracingListener() {
this.receivedChunks = []; // array for incoming data. holds chunks as they come, onStopRequest we join these junks to get the full source
@mpfund
mpfund / fileupload.go
Created February 29, 2016 07:39
golang file upload
package main
import (
"bytes"
"fmt"
"io/ioutil"
"mime/multipart"
"net/http"
)
@mpfund
mpfund / phantomjs_webserver_getcontent.js
Created January 21, 2016 13:00
Loads web content from dynamic sites via phantomjs and webserver module
var webserver = require('webserver');
var webPage = require('webpage');
var server = webserver.create();
var service = server.listen(8080, function(request, response) {
response.statusCode = 200;
var page = webPage.create();
var q = queriesFromUrl(request.url)
if(q.url==null)
response.close();
@mpfund
mpfund / main.go
Created December 17, 2015 20:42
gin web server + db
package main
import (
"fmt"
"github.com/HouzuoGuo/tiedot/db"
"github.com/gin-gonic/gin"
)
func main() {
@mpfund
mpfund / nodejsexpress.ts
Created December 17, 2015 13:44
nodejs form with express + bodyparser
/// <reference path="node.d.ts" />
/// <reference path="express.d.ts" />
// install
// npm install express --save
// npm install body-parser
import express = require('express');
var bodyParser = require('body-parser');
var app = express();
@mpfund
mpfund / scheme.html
Last active December 1, 2015 09:32
mini scheme in javascript
<html>
<body>
<script>
"use strict";
function calc(arr) {
var m = arr.split(' ');
return calcArr(m);
}
@mpfund
mpfund / https_mitm_proxy.go
Last active July 23, 2020 20:44
Golang Http(s) mitm Proxy
package main
import (
"bytes"
"compress/gzip"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"io/ioutil"
"log"