Skip to content

Instantly share code, notes, and snippets.

View sohainewbie's full-sized avatar
🥰
<3

Sohay sohainewbie

🥰
<3
View GitHub Profile
@sohainewbie
sohainewbie / gist:cda88ddaed9eb6a446db58ea00af0d0e
Created October 22, 2023 16:02
Cracking .zip passwords with John The Ripper (Mac OS)
/opt/homebrew/Cellar/john-jumbo/1.9.0/share/john/
$ brew install john-jumbo
$ export PATH=$PATH:/usr/local/share/john
$ zip2john YOUR_FILE.ZIP > zip_hash.txt
$ john --format=PKZIP --wordlist YOUR_WORDLIST_HERE zip_hash.txt
$ john --show zip_hash.txt
@sohainewbie
sohainewbie / app-upload-patch.py
Created August 29, 2023 03:50
Example secure code for upload Flask
import os, imghdr, uuid
from flask import Flask, request, send_from_directory
from werkzeug.utils import secure_filename
app = Flask(__name__)
UPLOAD_FOLDER = 'uploads'
app.config['UPLOAD_EXTENSIONS'] = ['.jpg', '.png', '.gif']
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.config['MAX_CONTENT_LENGTH'] = 1 * 1024 * 1024 #max 1 mb
@sohainewbie
sohainewbie / curl.md
Created August 19, 2023 03:27 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

/.git/config
/wp-admin/js/widgets/index.php
/wp-content/uploads/2020/10/casper_speed.php
/wp-logout.php
/gk.php
/wp-content/0day.php
/autoload_sitemap.php
/comment.php
/wp-content/uploads/archieving.php
/js/logs.php
@sohainewbie
sohainewbie / xss-proctect.go
Last active December 23, 2022 13:04
xss sanitze for labstack
// secure code for middleware
example :
```
// only POST method can be overridden
e.Pre(middleware.MethodOverride())
// protect from xss
e.Use(middleware.SecureWithConfig(middleware.SecureConfig{
XSSProtection: "1; mode=block",
ContentTypeNosniff: "nosniff",
@sohainewbie
sohainewbie / Learn CSS
Created June 25, 2022 07:47
Learn CSS
CSS Syntax
----------------------------------------
Css is for styling the HTML page, it's not a programing language
basicly it's only like this:
selector {
property1 : value;
property2 : value;
}
@sohainewbie
sohainewbie / selenium
Last active June 25, 2022 07:46
Setup selenium in Ubuntu Server
sudo apt update
sudo apt -y upgrade
sudo apt-get -y install python3-pip python3-dev build-essential libssl-dev libffi-dev xvfb
pip3 install selenium
wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
tar -xvzf geckodriver*
mv -v geckodriver /usr/local/bin
cd /usr/local/bin
chmod +x geckodriver
#checking geckodriver only execute like this: ./geckodriver
@sohainewbie
sohainewbie / manualCheck.py
Last active May 10, 2022 10:02
Decode Abi sample with python
from datetime import datetime
from eth_abi import decode_abi
#author: sohay
#telegram chanel: https://t.me/listmicintoken
'''
I am curious about the bytecode from solidty, and how to decode that byte???
after read the doc of solidity about abi, it's easy to decode that as long as we know the abi function.
There's a sample i try to decode.
So i try to decode the bytecode to know the lockdate for the Liquidity of the token.
@sohainewbie
sohainewbie / uaf.c
Last active May 4, 2022 09:17
Example Uaf(Use After Free)
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
/*
What is use after free (UAF) attack ?
- when the program tries to access a portion of memory after it has been freed that may force the program to crash
even we are able to overwrite the object and the worst part program you might get arbitrary code execution.
// SPDX-License-Identifier: MIT
pragma solidity 0.6.10;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
interface ExternalContractInterface {
function game() external returns(ExtCodeHashExample);
function payoutToWinner(address winner) external;
function withdrawTo(uint roundId, address receiver) external;
receive() external payable;