Compare commits
3 commits
b408f2196c
...
eff53a9078
Author | SHA1 | Date | |
---|---|---|---|
eff53a9078 | |||
1bcdc4cc1c | |||
5b631a20b1 |
2 changed files with 82 additions and 23 deletions
75
README.md
75
README.md
|
@ -30,7 +30,80 @@
|
||||||
|
|
||||||
## Usage
|
## 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
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
28
main.py
28
main.py
|
@ -10,8 +10,6 @@ import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import hashlib
|
import hashlib
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from collections import defaultdict
|
|
||||||
import threading
|
|
||||||
|
|
||||||
|
|
||||||
DOMAIN = os.getenv('DOMAIN', 'linedump.com')
|
DOMAIN = os.getenv('DOMAIN', 'linedump.com')
|
||||||
|
@ -30,10 +28,6 @@ UPLOAD_DIR = Path("uploads")
|
||||||
UPLOAD_DIR.mkdir(exist_ok=True)
|
UPLOAD_DIR.mkdir(exist_ok=True)
|
||||||
|
|
||||||
MAX_FILE_SIZE = MAX_FILE_SIZE_MB * 1024 * 1024 # Convert MB to bytes
|
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:
|
def generate_random_path(length: int = None) -> str:
|
||||||
if length is None:
|
if length is None:
|
||||||
|
@ -48,11 +42,6 @@ def get_client_ip(request: Request) -> str:
|
||||||
return request.client.host
|
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:
|
def validate_content(content: str) -> bool:
|
||||||
"""Basic validation for content size and encoding"""
|
"""Basic validation for content size and encoding"""
|
||||||
if len(content) > MAX_FILE_SIZE:
|
if len(content) > MAX_FILE_SIZE:
|
||||||
|
@ -73,9 +62,6 @@ def validate_content(content: str) -> bool:
|
||||||
@limiter.limit(RATE_LIMIT)
|
@limiter.limit(RATE_LIMIT)
|
||||||
async def upload_text(request: Request):
|
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()
|
body = await request.body()
|
||||||
content = body.decode('utf-8', errors='ignore')
|
content = body.decode('utf-8', errors='ignore')
|
||||||
|
|
||||||
|
@ -95,10 +81,6 @@ async def upload_text(request: Request):
|
||||||
with open(file_path, 'w', encoding='utf-8') as f:
|
with open(file_path, 'w', encoding='utf-8') as f:
|
||||||
f.write(content)
|
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)}"
|
base_url = f"https://{request.headers.get('host', request.url.netloc)}"
|
||||||
return f"{base_url}/{random_path}\n"
|
return f"{base_url}/{random_path}\n"
|
||||||
|
|
||||||
|
@ -124,7 +106,7 @@ async def get_file(file_path: str):
|
||||||
|
|
||||||
@app.get("/", response_class=PlainTextResponse)
|
@app.get("/", response_class=PlainTextResponse)
|
||||||
async def root():
|
async def root():
|
||||||
return f"""C|_| {DOMAIN}
|
return f"""LD {DOMAIN}
|
||||||
|
|
||||||
████ General ████
|
████ General ████
|
||||||
|
|
||||||
|
@ -179,17 +161,20 @@ echo 'Cheers' \
|
||||||
| openssl enc -aes-256-cbc -pbkdf2 -base64 -pass pass:yourkey \
|
| openssl enc -aes-256-cbc -pbkdf2 -base64 -pass pass:yourkey \
|
||||||
| curl -X POST -d @- https://{DOMAIN}/
|
| curl -X POST -d @- https://{DOMAIN}/
|
||||||
|
|
||||||
|
|
||||||
█ Upload file:
|
█ 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 < YOURFILE.txt \
|
||||||
| curl -sS -X POST https://{DOMAIN} --data-binary @-
|
| curl -sS -X POST https://{DOMAIN} --data-binary @-
|
||||||
|
|
||||||
|
|
||||||
█ Upload command output:
|
█ Upload command output:
|
||||||
|
|
||||||
ip -br a \
|
ip -br a \
|
||||||
| openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 \
|
| openssl enc -aes-256-cbc -pbkdf2 -salt -pass pass:yourkey -base64 \
|
||||||
| curl -sS -X POST https://{DOMAIN} --data-binary @-
|
| curl -sS -X POST https://{DOMAIN} --data-binary @-
|
||||||
|
|
||||||
|
|
||||||
█ Download:
|
█ Download:
|
||||||
|
|
||||||
curl -s https://{DOMAIN}/PASTE_THE_ID \
|
curl -s https://{DOMAIN}/PASTE_THE_ID \
|
||||||
|
@ -208,12 +193,13 @@ curl -s https://{DOMAIN}/PASTE_THE_ID \
|
||||||
cmd ip -br a; \\
|
cmd ip -br a; \\
|
||||||
}} 2>&1 | curl -X POST https://{DOMAIN} --data-binary @-
|
}} 2>&1 | curl -X POST https://{DOMAIN} --data-binary @-
|
||||||
|
|
||||||
|
|
||||||
█ Continous command:
|
█ Continous command:
|
||||||
|
|
||||||
(timeout --signal=INT --kill-after=5s 10s \\
|
(timeout --signal=INT --kill-after=5s 10s \\
|
||||||
ping google.com; \\
|
ping 127.1; \\
|
||||||
echo "--- Terminated ---") | \\
|
echo "--- Terminated ---") | \\
|
||||||
curl -X POST --data-binary @- https://linedump.com
|
curl -X POST --data-binary @- https://{DOMAIN}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue