Skip to content

Instantly share code, notes, and snippets.

View kmmanoj's full-sized avatar

Manoj vignesh K M kmmanoj

View GitHub Profile
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER, CONFIG_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
class Hub(app_manager.RyuApp):
OFP_VERSIONS = [ ofproto_v1_3.OFP_VERSION ]
@set_ev_cls(ofp_event.EventOFPSwitchFeatures , CONFIG_DISPATCHER)
@kmmanoj
kmmanoj / fast_exploit_2.py
Last active January 1, 2023 22:29
Multiprocess pool executor Blind SQL injection exploit example
import requests
import string
from multiprocessing import Pool, shared_memory
URL = 'http://localhost/index.php'
MAX_LEN = 100
POOL_SIZE = 32
password_memory = shared_memory.SharedMemory(create=True, size=MAX_LEN)
@kmmanoj
kmmanoj / fast_exploit_1.py
Last active January 1, 2023 21:50
Multi-threaded Blind SQL injection exploit example
import requests
import string
from threading import Thread
URL = 'http://localhost/index.php'
MAX_LEN = 1000
password = ''
found_for_location = False
@kmmanoj
kmmanoj / basic_exploit.py
Last active January 1, 2023 21:50
An unoptimized Blind SQL injection exploit example
import requests
URL = 'http://localhost/index.php'
MAX_LEN = 1000
def exploit():
password = ''
charset = string.printable
for start in range(1, MAX_LEN):
@kmmanoj
kmmanoj / test_pk_and_py.py
Created January 22, 2021 16:26
FMEA for check_pk_and_py.py
import unittest
import os
from check_pk_and_py import microservice
class TestPokeOnlyDown(unittest.TestCase):
def setUp(self):
os.system('cp /etc/hosts /etc/hosts.orig')
os.system('echo "127.0.0.1\tpokeapi.co" >> /etc/hosts')
@kmmanoj
kmmanoj / check_pk_and_py.py
Last active January 22, 2021 16:12
Python microservice that checks if the input string is a python module and/or a pokemon
import requests
from flask import Flask
app = Flask(__name__)
@app.route("/<input_string>")
def microservice(input_string):
pypi_endpoint = "https://pypi.org/simple/{module_name}"
poke_api_endpoint = "https://pokeapi.co/api/v2/pokemon/{pokemon}"
response = dict(
@kmmanoj
kmmanoj / dhcpd.conf
Created August 20, 2020 16:42
ARP spoofing for DHCP starvation - dhcpd.conf
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.150 192.168.1.160;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.1;
option domain-name "example.org";
}
@kmmanoj
kmmanoj / Dockerfile
Created August 20, 2020 16:36
ARP spoof for DHCP starvation - dockerfile
FROM ubuntu
RUN apt-get update && apt-get install -y vim net-tools isc-dhcp-server
@kmmanoj
kmmanoj / sshd_config
Last active August 9, 2020 06:34
Port forwarding blog sshd_config
# ....
AuthorizedKeysFile .ssh/authorized_keys
# ...
PasswordAuthentication yes
# ...
AllowTcpForwarding yes
GatewayPorts no
X11Forwarding no
@kmmanoj
kmmanoj / Dockerfile
Created August 9, 2020 06:25
Port forwarding blog dockerfile
FROM linuxserver/openssh-server
ADD sshd_config /etc/ssh/sshd_config