Skip to content

Instantly share code, notes, and snippets.

Pavel Odintsov pavel-odintsov

Block or report user

Report or block pavel-odintsov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pavel-odintsov
pavel-odintsov / rawfilter.c
Created Apr 27, 2018 — forked from oro350/rawfilter.c
SO_ATTACH_FILTER usage
View rawfilter.c
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ethernet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <netpacket/packet.h>
View tcp_crafter.go
package main
import (
"encoding/binary"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcapgo"
"github.com/miekg/dns"
"log"
"net"
@pavel-odintsov
pavel-odintsov / decay.c
Created Aug 1, 2017
Decay-based count by Qrator
View decay.c
/* Copyright (c) 2017, Qrator Labs */
/* All rights reserved. */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are met: */
/* 1. Redistributions of source code must retain the above copyright notice, this */
/* list of conditions and the following disclaimer. */
/* 2. Redistributions in binary form must reproduce the above copyright notice, */
/* this list of conditions and the following disclaimer in the documentation */
View gist:65857f487825e10f48934ee96b5474b1
ping 185.136.232.108
PING 185.136.232.108 (185.136.232.108): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
@pavel-odintsov
pavel-odintsov / dropwatch.patch
Created Jun 8, 2017
dropwatch patch to work with libnl3
View dropwatch.patch
# Dependencies sudo apt-get install -y libnl-3-dev libnl-genl-3-dev binutils-dev libreadline6-dev
odintsov@fastnetdev:/tmp/DropWatch/src$ git diff
diff --git a/src/Makefile b/src/Makefile
index cfbf2c6..d50ecec 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -5,7 +5,7 @@ OBJFILES := main.o lookup.o\
lookup_bfd.o lookup_kas.o
@pavel-odintsov
pavel-odintsov / sshd.go
Created May 1, 2017 — forked from jpillora/sshd.go
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
View sshd.go
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
View gist:49a8adcebbe5df1e654fe107d64df712
odintsov@fastnetdev:~/fastnetmon/src/build$ sudo netstat -lnpt|grep click
tcp 0 0 127.0.0.1:8123 0.0.0.0:* LISTEN 6927/clickhouse-ser
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 6927/clickhouse-ser
tcp 0 0 127.0.0.1:9009 0.0.0.0:* LISTEN 6927/clickhouse-ser
odintsov@fastnetdev:~/fastnetmon/src/build$ clickhouse-client
ClickHouse client version 1.1.54164.
Connecting to localhost:9000.
Code: 210. DB::NetException: Connection refused: (localhost:9000, ::1)
odintsov@fastnetdev:~/fastnetmon/src/build$ ping localhost -c 1
@pavel-odintsov
pavel-odintsov / cookiemonster.go
Created Feb 28, 2017 — forked from dacort/cookiemonster.go
Simple script to extract (encrypted) cookies out of Chrome OS X cookie store. Usage: ./cookiemonster domain.com
View cookiemonster.go
package main
import (
"golang.org/x/crypto/pbkdf2"
"crypto/aes"
"crypto/cipher"
"crypto/sha1"
"database/sql"
"fmt"
"log"
@pavel-odintsov
pavel-odintsov / cpp_to_capnp.py
Created Dec 16, 2016
C++ to capnproto manifest conversion tool based on libclang
View cpp_to_capnp.py
#!/usr/bin/env python
""" Usage: call with <filename> <typename>
"""
#
# You should install dependencies:
# sudo vim /etc/apt/sources.list.d/clang.list
#
# deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main
# deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main
View gist:93ff9eabdc8139a9294a3c5561f2f9f9
#!/usr/bin/python
# pip install ripe.atlas.sagan
# pip install dnspython
import json
from ripe.atlas.sagan import DnsResult
import base64
import dns.message
import urllib
You can’t perform that action at this time.