Skip to content

Instantly share code, notes, and snippets.

View jozadaquebatista's full-sized avatar
🙃

Jozadaque Batista jozadaquebatista

🙃
View GitHub Profile
@jozadaquebatista
jozadaquebatista / syn-poc.rb
Created August 12, 2016 01:54 — forked from KINGSABRI/syn-poc.rb
Build TCP/IP packet from scratch by ruby , and send syn(or whatever you want) packet
#!/usr/bin/env ruby
# Full Contol on Ethnet, IP & TCP headers. Play with it ;)
# to test it: nc -lvp 4444
# as root: tcpdump -nvvvv 'tcp port 4444' -i wlan0 # change wlan0 to your interface
# or use packetfu to monitor as tcpdump
## cap = PacketFu::Capture.new(:iface => 'wlan0' , :promisc=> true)
## cap.show_live(:filter => 'tcp and port 4444')
# libpcap should be installed
# gem install pcaprub packetfu
#include <stdio.h>
#if defined(SMALL)
#define SIZE 30
#endif
#if defined(LARGE)
#define SIZE 3000
#endif
@jozadaquebatista
jozadaquebatista / tcp_server.c
Last active September 18, 2015 19:58
Simple socket server in C using threads (pthread library) Compiles on linux
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>