From b47ea6fe01b7f53985b21d908c2ede5ec13fb009 Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Sun, 21 Sep 2025 20:19:40 +0200 Subject: [PATCH 1/8] ADD further information like project name, source reference and license to start page --- main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 6c0814c..447d29f 100644 --- a/main.py +++ b/main.py @@ -212,7 +212,15 @@ curl -s https://{DOMAIN}/PASTE_THE_ID \ ████ Further Information ████ -More information will follow. Work in Progress. +Powered by linedump + +Source: + https://git.uphillsecurity.com/cf7/linedump + +License: + Apache-2.0 + https://git.uphillsecurity.com/cf7/linedump/src/branch/main/LICENSE + """ if __name__ == "__main__": From b408f2196c4df01ce629f6f5f4232a882443b21c Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Sun, 21 Sep 2025 21:03:10 +0200 Subject: [PATCH 2/8] ADD adv example for cont. command --- main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 447d29f..f6ea684 100644 --- a/main.py +++ b/main.py @@ -201,13 +201,21 @@ curl -s https://{DOMAIN}/PASTE_THE_ID \ ██ Adv Examples ██ - █ Multiple Commands + █ Multiple commands: {{ cmd() {{ printf "\\n# %s\\n" "$*"; "$@"; }}; \\ cmd hostname; \\ cmd ip -br a; \\ }} 2>&1 | curl -X POST https://{DOMAIN} --data-binary @- + █ Continous command: + +(timeout --signal=INT --kill-after=5s 10s \\ + ping google.com; \\ + echo "--- Terminated ---") | \\ + curl -X POST --data-binary @- https://linedump.com + + ████ Further Information ████ From 5b631a20b15316f83596b113dccce85997a59cf8 Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Wed, 24 Sep 2025 23:43:46 +0200 Subject: [PATCH 3/8] FIX typo start page in adv examples --- main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index f6ea684..0530f88 100644 --- a/main.py +++ b/main.py @@ -124,7 +124,7 @@ async def get_file(file_path: str): @app.get("/", response_class=PlainTextResponse) async def root(): - return f"""C|_| {DOMAIN} + return f"""LD {DOMAIN} ████ General ████ @@ -179,17 +179,20 @@ echo 'Cheers' \ | openssl enc -aes-256-cbc -pbkdf2 -base64 -pass pass:yourkey \ | curl -X POST -d @- https://{DOMAIN}/ + █ Upload file: openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 < YOURFILE.txt \ | curl -sS -X POST https://{DOMAIN} --data-binary @- + █ Upload command output: ip -br a \ | openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 \ | curl -sS -X POST https://{DOMAIN} --data-binary @- + █ Download: curl -s https://{DOMAIN}/PASTE_THE_ID \ @@ -208,12 +211,13 @@ curl -s https://{DOMAIN}/PASTE_THE_ID \ cmd ip -br a; \\ }} 2>&1 | curl -X POST https://{DOMAIN} --data-binary @- + █ Continous command: (timeout --signal=INT --kill-after=5s 10s \\ - ping google.com; \\ + ping 127.1; \\ echo "--- Terminated ---") | \\ - curl -X POST --data-binary @- https://linedump.com + curl -X POST --data-binary @- https://{DOMAIN} From 1bcdc4cc1c175552778279ed303b5e08d8383a3b Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Thu, 25 Sep 2025 00:10:03 +0200 Subject: [PATCH 4/8] DEL MAX_FILE_PER_IP rate limit as it does not get flushed and the other rate limit is more than enough --- main.py | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/main.py b/main.py index 0530f88..7d151a2 100644 --- a/main.py +++ b/main.py @@ -10,8 +10,6 @@ import os from pathlib import Path import hashlib from typing import Optional -from collections import defaultdict -import threading DOMAIN = os.getenv('DOMAIN', 'linedump.com') @@ -30,10 +28,6 @@ UPLOAD_DIR = Path("uploads") UPLOAD_DIR.mkdir(exist_ok=True) MAX_FILE_SIZE = MAX_FILE_SIZE_MB * 1024 * 1024 # Convert MB to bytes -MAX_FILES_PER_IP = 100 - -file_counter = defaultdict(int) -lock = threading.Lock() def generate_random_path(length: int = None) -> str: if length is None: @@ -48,11 +42,6 @@ def get_client_ip(request: Request) -> str: return request.client.host -def check_file_limit(request: Request) -> bool: - client_ip = get_client_ip(request) - with lock: - return file_counter[client_ip] < MAX_FILES_PER_IP - def validate_content(content: str) -> bool: """Basic validation for content size and encoding""" if len(content) > MAX_FILE_SIZE: @@ -73,9 +62,6 @@ def validate_content(content: str) -> bool: @limiter.limit(RATE_LIMIT) async def upload_text(request: Request): - if not check_file_limit(request): - raise HTTPException(status_code=429, detail="File limit exceeded") - body = await request.body() content = body.decode('utf-8', errors='ignore') @@ -94,11 +80,7 @@ async def upload_text(request: Request): try: with open(file_path, 'w', encoding='utf-8') as f: f.write(content) - - client_ip = get_client_ip(request) - with lock: - file_counter[client_ip] += 1 - + base_url = f"https://{request.headers.get('host', request.url.netloc)}" return f"{base_url}/{random_path}\n" From eff53a9078d552b8f33187dc9cff974c1f1d95e1 Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Thu, 25 Sep 2025 00:13:54 +0200 Subject: [PATCH 5/8] ADD usage section to README --- README.md | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c55e80e..37965e6 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,80 @@ ## Usage -Check [linedump.com](https://linedump.com) for now - coming soon. +```text + █ Upload curl: + +curl -X POST -d "Cheers" https://linedump.com/ # string +curl -X POST https://linedump.com --data-binary @- < file.txt # file +ip -br a | curl -X POST https://linedump.com --data-binary @- # command output + + + █ Upload wget: + +echo "Cheers" | wget --post-data=@- -O- https://linedump.com/ # string +wget --post-file=file.txt -O- https://linedump.com/ # file +ip -br a | wget --post-data=@- -O- https://linedump.com/ # command output + + + █ Upload Powershell: + +Invoke-RestMethod -Uri "https://linedump.com/" -Method Post -Body "Cheers" # string +Invoke-RestMethod -Uri "https://linedump.com/" -Method Post -InFile "file.txt" # file +ipconfig | Invoke-RestMethod -Uri "https://linedump.com/" -Method Post -Body { $_ } # command output + + + █ Download: + +curl https://linedump.com/{path} + +wget -O- https://linedump.com/{path} + +Invoke-RestMethod -Uri "https://linedump.com/{path}" + + + +██ Encryption Examples with curl ██ + + + █ Upload text: + +echo 'Cheers' | openssl enc -aes-256-cbc -pbkdf2 -base64 -pass pass:yourkey | curl -X POST -d @- https://linedump.com/ + + + █ Upload file: + +openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 < YOURFILE.txt | curl -sS -X POST https://linedump.com --data-binary @- + + + █ Upload command output: + +ip -br a | openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 | curl -sS -X POST https://linedump.com --data-binary @- + + + █ Download: + +curl -s https://linedump.com/PASTE_THE_ID | base64 -d | openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey + + + +██ Adv Examples ██ + + + █ Multiple commands: + +{ cmd() { printf "\n# %s\n" "$*"; "$@"; }; \ + cmd hostname; \ + cmd ip -br a; \ + } 2>&1 | curl -X POST https://linedump.com --data-binary @- + + + █ Continous command: + +(timeout --signal=INT --kill-after=5s 10s \ + ping 127.1; \ + echo "--- Terminated ---") | \ + curl -X POST --data-binary @- https://linedump.com +``` --- From 51224453b3175efb4b28a6535aabba3ae7e6bbb9 Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Thu, 25 Sep 2025 00:43:02 +0200 Subject: [PATCH 6/8] FIX usage typos --- README.md | 6 +++--- main.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 37965e6..7b02989 100644 --- a/README.md +++ b/README.md @@ -67,12 +67,12 @@ Invoke-RestMethod -Uri "https://linedump.com/{path}" █ Upload text: -echo 'Cheers' | openssl enc -aes-256-cbc -pbkdf2 -base64 -pass pass:yourkey | curl -X POST -d @- https://linedump.com/ +echo 'Cheers' | openssl enc -aes-256-cbc -salt -pbkdf2 -base64 -pass pass:yourkey | curl -X POST -d @- https://linedump.com/ █ Upload file: -openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 < YOURFILE.txt | curl -sS -X POST https://linedump.com --data-binary @- +openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 < file.txt | curl -sS -X POST https://linedump.com --data-binary @- █ Upload command output: @@ -82,7 +82,7 @@ ip -br a | openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 █ Download: -curl -s https://linedump.com/PASTE_THE_ID | base64 -d | openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey +curl -s https://linedump.com/{path} | base64 -d | openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey diff --git a/main.py b/main.py index 7d151a2..709ef9b 100644 --- a/main.py +++ b/main.py @@ -158,13 +158,13 @@ Invoke-RestMethod -Uri "https://{DOMAIN}/{{path}}" █ Upload text: echo 'Cheers' \ - | openssl enc -aes-256-cbc -pbkdf2 -base64 -pass pass:yourkey \ + | openssl enc -aes-256-cbc -pbkdf2 -salt -base64 -pass pass:yourkey \ | curl -X POST -d @- https://{DOMAIN}/ █ Upload file: -openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 < YOURFILE.txt \ +openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 < file.txt \ | curl -sS -X POST https://{DOMAIN} --data-binary @- @@ -177,7 +177,7 @@ ip -br a \ █ Download: -curl -s https://{DOMAIN}/PASTE_THE_ID \ +curl -s https://{DOMAIN}/{path} \ | base64 -d \ | openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey From 1be4255041da7b2129ebedc667c4d220d0e907bf Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Thu, 25 Sep 2025 01:09:54 +0200 Subject: [PATCH 7/8] CHAGE DOMAIN env var to BASEURL to remove hardcoded protocol references and easier for local testing --- README.md | 2 +- main.py | 43 +++++++++++++++++++++---------------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 7b02989..119c865 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Use with reverse-proxy and HTTPS! | Variable | Description | Default | Required | |----------|-------------|---------|----------| -| `DOMAIN` | Domain name used in the application responses and examples | `linedump.com` | 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 | | `MAX_FILE_SIZE_MB` | Maximum file size limit in megabytes | `50` | No | | `RATE_LIMIT` | Rate limit for uploads (format: "requests/timeframe") | `50/hour` | No | diff --git a/main.py b/main.py index 709ef9b..9917f52 100644 --- a/main.py +++ b/main.py @@ -12,7 +12,7 @@ import hashlib from typing import Optional -DOMAIN = os.getenv('DOMAIN', 'linedump.com') +BASEURL = os.getenv('BASEURL', 'http://127.0.0.1:8000') DESCRIPTION = os.getenv('DESCRIPTION', 'CLI-only pastebin powered by linedump.com') MAX_FILE_SIZE_MB = int(os.getenv('MAX_FILE_SIZE_MB', '50')) RATE_LIMIT = os.getenv('RATE_LIMIT', '50/hour') @@ -81,8 +81,7 @@ async def upload_text(request: Request): with open(file_path, 'w', encoding='utf-8') as f: f.write(content) - base_url = f"https://{request.headers.get('host', request.url.netloc)}" - return f"{base_url}/{random_path}\n" + return f"{BASEURL}/{random_path}\n" except Exception as e: raise HTTPException(status_code=500, detail="Failed to save file") @@ -106,7 +105,7 @@ async def get_file(file_path: str): @app.get("/", response_class=PlainTextResponse) async def root(): - return f"""LD {DOMAIN} + return f"""LD {BASEURL} ████ General ████ @@ -123,32 +122,32 @@ async def root(): █ Upload curl: -curl -X POST -d "Cheers" https://{DOMAIN}/ # string -curl -X POST https://{DOMAIN} --data-binary @- < file.txt # file -ip -br a | curl -X POST https://{DOMAIN} --data-binary @- # command output +curl -X POST -d "Cheers" {BASEURL}/ # string +curl -X POST {BASEURL} --data-binary @- < file.txt # file +ip -br a | curl -X POST {BASEURL} --data-binary @- # command output █ Upload wget: -echo "Cheers" | wget --post-data=@- -O- https://{DOMAIN}/ # string -wget --post-file=file.txt -O- https://{DOMAIN}/ # file -ip -br a | wget --post-data=@- -O- https://{DOMAIN}/ # command output +echo "Cheers" | wget --post-data=@- -O- {BASEURL}/ # string +wget --post-file=file.txt -O- {BASEURL}/ # file +ip -br a | wget --post-data=@- -O- {BASEURL}/ # command output █ Upload Powershell: -Invoke-RestMethod -Uri "https://{DOMAIN}/" -Method Post -Body "Cheers" # string -Invoke-RestMethod -Uri "https://{DOMAIN}/" -Method Post -InFile "file.txt" # file -ipconfig | Invoke-RestMethod -Uri "https://{DOMAIN}/" -Method Post -Body {{ $_ }} # command output +Invoke-RestMethod -Uri "{BASEURL}/" -Method Post -Body "Cheers" # string +Invoke-RestMethod -Uri "{BASEURL}/" -Method Post -InFile "file.txt" # file +ipconfig | Invoke-RestMethod -Uri "{BASEURL}/" -Method Post -Body {{ $_ }} # command output █ Download: -curl https://{DOMAIN}/{{path}} +curl {BASEURL}/{{path}} -wget -O- https://{DOMAIN}/{{path}} +wget -O- {BASEURL}/{{path}} -Invoke-RestMethod -Uri "https://{DOMAIN}/{{path}}" +Invoke-RestMethod -Uri "{BASEURL}/{{path}}" @@ -159,25 +158,25 @@ Invoke-RestMethod -Uri "https://{DOMAIN}/{{path}}" echo 'Cheers' \ | openssl enc -aes-256-cbc -pbkdf2 -salt -base64 -pass pass:yourkey \ - | curl -X POST -d @- https://{DOMAIN}/ + | curl -X POST -d @- {BASEURL}/ █ Upload file: openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 < file.txt \ - | curl -sS -X POST https://{DOMAIN} --data-binary @- + | curl -sS -X POST {BASEURL} --data-binary @- █ Upload command output: ip -br a \ | openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 \ - | curl -sS -X POST https://{DOMAIN} --data-binary @- + | curl -sS -X POST {BASEURL} --data-binary @- █ Download: -curl -s https://{DOMAIN}/{path} \ +curl -s {BASEURL}/{{path}} \ | base64 -d \ | openssl enc -d -aes-256-cbc -pbkdf2 -pass pass:yourkey @@ -191,7 +190,7 @@ curl -s https://{DOMAIN}/{path} \ {{ cmd() {{ printf "\\n# %s\\n" "$*"; "$@"; }}; \\ cmd hostname; \\ cmd ip -br a; \\ - }} 2>&1 | curl -X POST https://{DOMAIN} --data-binary @- + }} 2>&1 | curl -X POST {BASEURL} --data-binary @- █ Continous command: @@ -199,7 +198,7 @@ curl -s https://{DOMAIN}/{path} \ (timeout --signal=INT --kill-after=5s 10s \\ ping 127.1; \\ echo "--- Terminated ---") | \\ - curl -X POST --data-binary @- https://{DOMAIN} + curl -X POST --data-binary @- {BASEURL} From e58be04ddf20c1878dfbee605cc43010041bf132 Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Sun, 28 Sep 2025 21:02:58 +0200 Subject: [PATCH 8/8] ADD README infomration about IRC, Github mirror and issue tracker --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 119c865..4194ba4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ **CLI-only text pastebin service.** +[Issue tracker](https://git.uphillsecurity.com/cf7/linedump/issues) | `Libera Chat #linedump` + + - Status: Beta - expect minor changes - Instance: [linedump.com](https://linedump.com/) - Inspired by: @@ -129,6 +132,12 @@ For security concerns or reports, please contact via `hello a t uphillsecurity d --- +## Notes + +- [Github Mirror available](https://github.com/CaffeineFueled1/linedump) + +--- + ## License **Apache License**