Skip to content

Instantly share code, notes, and snippets.

View ajib6ept's full-sized avatar
🏠
Working from home

Альберт ajib6ept

🏠
Working from home
  • Russia
  • 04:23 (UTC +03:00)
View GitHub Profile
@ajib6ept
ajib6ept / notes.md
Last active July 20, 2024 10:03
Уведомление о входе на сервер по SSH в Telegram
# nano /etc/bash.bashrc
### Уведомление об авторизации на сервере
# Получаем ip адрес
USER_IP=$(echo $SSH_CLIENT | awk '{ print $1}')

# Формируем сообщение для отправки

Portswigger Academy

Server-side vulnerabilities

  • Path traversal
  • Access control
  • Authentication
  • Server-side request forgery (SSRF)
  • File upload vulnerabilities
  • OS command injection

nmap

nmap -T4 -sC -sV -Pn -oN nmap/initial 1.1.1.1

gobuster

sudo gobuster dir -u http://10.0.2.4 -w /usr/share/wordlists/dirb/common.txt -e

/media/albert/CC0250E00250D0D6/db/SecLists/Discovery/Web-Content/common.txt

@ajib6ept
ajib6ept / foo.md
Last active March 11, 2023 09:46
Recording Linux Terminal Session to GIF with asciinema #example
@ajib6ept
ajib6ept / .pre-commit-config.yaml
Last active March 8, 2023 19:01
tg pre-commit config file #config
# Make sure that the additional_dependencies here match requirements.txt
ci:
autofix_prs: false
autoupdate_schedule: monthly
# We currently only need this behavior on the v13.x branch were we have the vendored urllib
# TODO: Remove once we discontinue v13
submodules: true
repos:
@ajib6ept
ajib6ept / Makefile
Last active October 9, 2022 11:55
test workflow
install:
poetry install
lint:
poetry run flake8 mediasoft --exclude=mediasoft/settings.py
test:
poetry run python manage.py test
test_coverage:
@ajib6ept
ajib6ept / logging.md
Last active May 10, 2023 11:45
logging notes #mynotes
import logging

logger = logging.getLogger() # object of LogRecord

logger.warning('Enter test func')

logger.debug('Enter test func') # do not show
@ajib6ept
ajib6ept / Redis Notes RU101.md
Last active March 5, 2023 09:39
Redis Notes from RU101 #mynotes

Redis Key:

  • binary safe
  • unique
  • key names can be up to 512 MB
  • case sensitive

Do not use command KEYS in production, instead use SCAN

KEYS command - block until complete UNLICK command - not blocking command

@ajib6ept
ajib6ept / cachelib.py
Last active March 5, 2023 09:30
FileCache #example
import os
from cachelib import FileSystemCache
CACHE_FOLDER = os.path.join(
os.path.dirname(os.path.abspath(__file__)), ".cache"
)
def download_url(url: str) -> str:
@ajib6ept
ajib6ept / php-interview.py
Created June 21, 2022 03:51
php-interview.py
# В лофте n хипстерам достались m смузи. При этом все хипстеры - люди вежливые, и поэтому должны выпить одинаковое количество смузи (можно выбросить несколько).
# Напишите функцию distributeSmoothies(int $m, int $n): int, результатом которой будет количество смузи, которое выпьет каждый хипстер.
def distribute_smoothies(m: int, n: int) -> int:
if m == 0 or n == 0:
return 0
return m // n