Skip to content

Instantly share code, notes, and snippets.

View furusiyya's full-sized avatar

Bilal furusiyya

View GitHub Profile
//IPTable rules for capturing ssh packets
//sudo iptables -A INPUT -p tcp --dport 22 -j NFQUEUE --queue-num 0
//sudo iptables -A OUTPUT -p tcp --dport 22 -j NFQUEUE --queue-num 0
//sudo iptables -A FORWARD -p tcp --dport 22 -j NFQUEUE --queue-num 0
package main
import (
@furusiyya
furusiyya / conntrack.go
Created December 9, 2016 21:21
I only track for NEW TCP events and log their (src ip, src port, dst port) in a non-blocking channel (FIFO queue). When tcp server receive packet, it compare its src ip and src port with channel entries and get destination port of matching one. Same I do udp server.
package glutton
import (
"bufio"
"bytes"
"os/exec"
"regexp"
)
const tcpRegExp = `\[\w+]\s+\w+\s+.+?src=(\d+\.\d+\.\d+\.\d+)\s+dst=(\d+\.\d+\.\d+\.\d+)\s+sport=(\d+)\s+dport=(\d+)\s+`
@furusiyya
furusiyya / ocserv_hack.go
Last active January 18, 2020 13:22 — forked from horsley/ocserv_hack.go
ocserv auth hacking
// ocservFront project main.go
package main
import (
"bufio"
"bytes"
"crypto/tls"
"fmt"
"io"
"io/ioutil"
# CySecBooks
============
## Repo Content
- A Guide to Kernel Exploitation Attacking the Core
- Computer Networking A Top-Down Approach
- Fuzzing Brute Force Vulnerability Discovery
- Gray Hat Python - Python Programming for Hackers and Reverse Engineers (2009)
- Hacking - The Art of Exploitation, 2nd Ed.
- Metasploit, Penetration Testers Guide
@furusiyya
furusiyya / proxy_copy.go
Created August 22, 2016 09:37 — forked from jbardin/proxy_copy.go
Go TCP Proxy pattern
package proxy
import (
"io"
"log"
"net"
)
func Proxy(srvConn, cliConn *net.TCPConn) {
// channels to wait on the close event for each connection