Skip to content

Instantly share code, notes, and snippets.

View AtieP's full-sized avatar
💭
Existing

AtieP

💭
Existing
View GitHub Profile
@AtieP
AtieP / telnetserv.c
Created November 17, 2022 21:31
very basic telnet server
// todo: backtrace
#define _XOPEN_SOURCE 600 /* for the pseudo terminals */
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
#include <termios.h>
@AtieP
AtieP / arp.c
Created November 7, 2022 12:43
ARP scanner
#include <sys/socket.h>
#include <linux/if_packet.h>
#include <net/ethernet.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <string.h>
#include <netinet/in.h>
#include <stdlib.h>
@AtieP
AtieP / mlibc-sysdeps.md
Last active January 29, 2023 18:02
mlibc sysdeps

Non-optional mlibc sysdeps

  • mlibc
    void sys_libc_log(const char *message);
    [[noreturn]] void sys_libc_panic();
    int sys_tcb_set(void *pointer);
    int sys_futex_wait(int *pointer, int expected, const struct timespec *time);
    int sys_futex_wake(int *pointer);
    int sys_anon_allocate(size_t size, void **pointer);
    int sys_anon_free(void *pointer, size_t size);
#include <dbus-1.0/dbus/dbus.h>
#include <stdio.h>
#include "pthread.h"
#include <stdint.h>
pthread_mutex_t handle_signal_lock = PTHREAD_MUTEX_INITIALIZER;
static DBusHandlerResult
/* Prototype of an IP spoofer. */
#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <assert.h>
#include <netinet/ip.h>
#include <netinet/udp.h>