Skip to content

Instantly share code, notes, and snippets.

View LoadLow's full-sized avatar
🎯
Focusing

Load. LoadLow

🎯
Focusing
View GitHub Profile
@LoadLow
LoadLow / ArraySum.swift
Created September 5, 2014 21:51
ArraySum.swift
func sumOf(elements:(value:Int, weight:Int)...) -> Int {
var tWeight = 0;
var sum = 0
for element in elements {
sum += element.value;
tWeight += element.weight;
}
return (sum/tWeight);
@LoadLow
LoadLow / defaultTrace.log
Created October 8, 2014 22:23
ErrorsHandler.GetLittleStackTrace
java.lang.Exception: My exception !
at eu.streamview.populator.Main.main(Main.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
@LoadLow
LoadLow / ANSI.bash
Last active August 29, 2015 14:07
Bash bad ANSI echo
echo 'import base64; print base64.b64decode("G1tIG1syShtbMzQ7NDNtG107T01HwqfCpwcbWzFtG1s1bUNPVUNPVSAhIFR1IHZldXggdm9pciBtYSBiaXRlPz8/Gygw")' | python
@LoadLow
LoadLow / configure
Last active August 29, 2015 14:07
Nginx custom build(configure) using testcookie, pagespeed and nexsi modules
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -f
@LoadLow
LoadLow / ipscore.bash
Created November 20, 2014 23:20
Remote addr bad score in bash
function ipscore() { local OLD_IFS="$IFS" IFS=","; local result="`curl -s "http://wafsec.com/api?ip=$1"`" && local results=(${result}) && printf -- '%s\n' "${results[@]}" | grep '"Score":' | cut -d':' -f2; IFS="$OLD_IFS"; }
ipscore ${target_ip}
$ipscore 186.78.151.135
2
@LoadLow
LoadLow / macro_exploit.vbs
Created November 26, 2014 10:22
Hex-dump macro exploit from malicious mail
-------------------------------------------------------------------------------
ThisDocument.cls
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
CloudflareAccess access = new CloudflareAccess(
"CF_MAIL",
"CF_APIKEY");
CloudflareRequest request = new CloudflareRequest(access, ...);
try {
boolean result = request.execute();
System.out.println("Operation executed : " + result);
} catch (CloudflareError e) {
e.printStackTrace();
iptgen.new_inputRule()
.append()
.tcp()
.src_addr("127.0.0.1")
.allow()
.saveRule();
global Application
def main():
#services instances
services = []
Globals.Application = App(AppHandlerImpl(), services)
Globals.Application.start()
pass
@LoadLow
LoadLow / kbhit.c
Last active August 29, 2015 14:11 — forked from vsajip/kbhit.c
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
int kbhit(void)
{
struct termios oldt, newt;
int ch;
int oldf;