Compare commits

...

4 commits
v0.5.0 ... main

2 changed files with 22 additions and 19 deletions

View file

@ -58,19 +58,19 @@ ipconfig | Invoke-RestMethod -Uri "https://linedump.com/" -Method Post -Body { $
█ Download: █ Download:
curl https://linedump.com/{path} # print to stdout curl https://linedump.com/{paste_id} # print to stdout
curl -o filename.txt https://linedump.com/{path} # save to file curl -o filename.txt https://linedump.com/{paste_id} # save to file
wget -O- https://linedump.com/{path} # print to stdout wget -O- https://linedump.com/{paste_id} # print to stdout
wget -O filename.txt https://linedump.com/{path} # save to file wget -O filename.txt https://linedump.com/{paste_id} # save to file
Invoke-RestMethod -Uri "https://linedump.com/{path}" # print to stdout Invoke-RestMethod -Uri "https://linedump.com/{paste_id}" # print to stdout
Invoke-RestMethod -Uri "https://linedump.com/{path}" -OutFile "filename.txt" # save to file Invoke-RestMethod -Uri "https://linedump.com/{paste_id}" -OutFile "filename.txt" # save to file
█ Delete: █ Delete:
curl -X POST "https://linedump.com/{path}?token={deletion_token}" # delete paste curl -X POST "https://linedump.com/{paste_id}?token={deletion_token}" # delete paste
@ -94,7 +94,7 @@ ip -br a | openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64
█ Download: █ Download:
curl -s https://linedump.com/{path} | base64 -d | openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey curl -s https://linedump.com/{paste_id} | base64 -d | openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey
@ -135,6 +135,8 @@ Invoke-RestMethod -Uri "https://linedump.com/" -Headers @{"Authorization"="Beare
curl -X POST --data-binary @- https://linedump.com curl -X POST --data-binary @- https://linedump.com
``` ```
[For more examples check out the Wiki.](https://git.uphillsecurity.com/cf7/linedump/wiki/Usage)
--- ---
## Installation ## Installation
@ -170,7 +172,7 @@ podman run --replace -d --restart=unless-stopped \
| Variable | Description | Default | Required | | Variable | Description | Default | Required |
|----------|-------------|---------|----------| |----------|-------------|---------|----------|
| `BASEURL` | Base URL used in the application responses and examples | `http://127.0.0.1:8000` | No | | `BASEURL` | Base URL used in the application responses and examples | `http://127.0.0.1:8000` | No |
| `DESCRIPTION` | Application description displayed in the root endpoint | `CLI-only pastebin powered by linedump.com` | No | | `DESCRIPTION` | Application description displayed in the root endpoint (supports `\n` for multiline) | `CLI-only pastebin powered by linedump.com\nOpen Source: https://git.uphillsecurity.com/cf7/linedump` | No |
| `MAX_FILE_SIZE_MB` | Maximum file size limit in megabytes | `50` | No | | `MAX_FILE_SIZE_MB` | Maximum file size limit in megabytes | `50` | No |
| `RATE_LIMIT` | Rate limit for uploads (format: "requests/timeframe") | `50/hour` | No | | `RATE_LIMIT` | Rate limit for uploads (format: "requests/timeframe") | `50/hour` | No |
| `URL_PATH_LENGTH` | Length of generated URL paths (number of characters) | `6` | No | | `URL_PATH_LENGTH` | Length of generated URL paths (number of characters) | `6` | No |
@ -192,6 +194,7 @@ For security concerns or reports, please contact via `hello a t uphillsecurity d
- [Github Mirror available](https://github.com/CaffeineFueled1/linedump) - [Github Mirror available](https://github.com/CaffeineFueled1/linedump)
- [Rate Limit Testing Script](https://git.uphillsecurity.com/cf7/Snippets/wiki/bash-linedump-ratelimit-test.-) - [Rate Limit Testing Script](https://git.uphillsecurity.com/cf7/Snippets/wiki/bash-linedump-ratelimit-test.-)
- [Linedumpe Wiki](https://git.uphillsecurity.com/cf7/linedump/wiki/?action=_pages)
--- ---

20
main.py
View file

@ -16,7 +16,7 @@ import sys
BASEURL = os.getenv('BASEURL', 'http://127.0.0.1:8000') BASEURL = os.getenv('BASEURL', 'http://127.0.0.1:8000')
DESCRIPTION = os.getenv('DESCRIPTION', 'CLI-only pastebin powered by linedump.com') DESCRIPTION = os.getenv('DESCRIPTION', 'CLI-only pastebin powered by linedump.com\nOpen Source: https://git.uphillsecurity.com/cf7/linedump').replace('\\n', '\n')
MAX_FILE_SIZE_MB = int(os.getenv('MAX_FILE_SIZE_MB', '50')) MAX_FILE_SIZE_MB = int(os.getenv('MAX_FILE_SIZE_MB', '50'))
RATE_LIMIT = os.getenv('RATE_LIMIT', '50/hour') RATE_LIMIT = os.getenv('RATE_LIMIT', '50/hour')
URL_PATH_LENGTH = int(os.getenv('URL_PATH_LENGTH', '6')) URL_PATH_LENGTH = int(os.getenv('URL_PATH_LENGTH', '6'))
@ -292,7 +292,7 @@ async def upload_text(request: Request, authorized: bool = Depends(validate_uplo
size_bytes=len(content)) size_bytes=len(content))
# Return URL and deletion token # Return URL and deletion token
return f"{BASEURL}/{random_path}\nDelete with HTTP POST: {BASEURL}/{random_path}?token={deletion_token}\n" return f"{BASEURL}/{random_path}\nDelete with HTTP POST:\n{BASEURL}/{random_path}?token={deletion_token}\n"
except Exception as e: except Exception as e:
log("ERROR", "upload_failed", log("ERROR", "upload_failed",
@ -462,19 +462,19 @@ ipconfig | Invoke-RestMethod -Uri "{BASEURL}/"{auth_header_ps} -Method Post -Bod
Download: Download:
curl {BASEURL}/{{path}} # print to stdout curl {BASEURL}/{{paste_id}} # print to stdout
curl -o filename.txt {BASEURL}/{{path}} # save to file curl -o filename.txt {BASEURL}/{{paste_id}} # save to file
wget -O- {BASEURL}/{{path}} # print to stdout wget -O- {BASEURL}/{{paste_id}} # print to stdout
wget -O filename.txt {BASEURL}/{{path}} # save to file wget -O filename.txt {BASEURL}/{{paste_id}} # save to file
Invoke-RestMethod -Uri "{BASEURL}/{{path}}" # print to stdout Invoke-RestMethod -Uri "{BASEURL}/{{paste_id}}" # print to stdout
Invoke-RestMethod -Uri "{BASEURL}/{{path}}" -OutFile "filename.txt" # save to file Invoke-RestMethod -Uri "{BASEURL}/{{paste_id}}" -OutFile "filename.txt" # save to file
Delete: Delete:
curl -X POST "{BASEURL}/{{path}}?token={{deletion_token}}" # delete paste curl -X POST "{BASEURL}/{{paste_id}}?token={{deletion_token}}" # delete paste
@ -503,7 +503,7 @@ ip -br a \
Download: Download:
curl -s {BASEURL}/{{path}} \ curl -s {BASEURL}/{{paste_id}} \
| base64 -d \ | base64 -d \
| openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey | openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey