TCPASTE(7)
TCPASTE(7)
Tcpaste Manual
NAME
tcpaste - a TCP pastebin
SYNOPSIS
netcat tcp.st 7777
telnet tcp.st 7777
DESCRIPTION
This manual page describes the tcpaste interface. Tcpaste is a pastebin that doesn't make use of any application layer protocol. The result is provided in a simple format designed to be easily readable by humans, and easily parsable by programs. As such, any TCP-capable system can use this service without having to implement tons of boilerplate for HTTP or other protocol.
Tcpaste abandons the request-response model, because the only way to signal the end of request in TCP, is to close the connection. Instead, upon opening a connection, you will be immediately given a paste URL, and only then the paste data will be received and recorded. The end of the paste is signaled by closing the connection.
RETURN VALUE
The data tcpaste sends, consists of one or more LF-separated lines, containing a key, followed by a space and a value. As of now, the following keys are defined:
URL - the paste URL.
ADMIN - the URL of an administration page for the paste.
ERROR - an exceptional situation has occured.
EXAMPLES
Bash:
Simple netcat usage:
netcat tcp.st 7777
command | netcat -q 1 tcp.st 7777
Only obtain the paste URL (ignoring errors):
command | netcat -q 1 tcp.st 7777 | grep URL | cut -d ' ' -f 2
Python:
import socket
sock = socket.create_connection(("tcp.st", 7777))
sock.sendall(data)
sock.settimeout(1)
reply = b""
while True:
try:
reply += sock.recv(4096)
except:
break
url = {key: value for key, value in [line.split(b" ") for line in reply.split(b"\n") if line]}[b"URL"]
Lua:
local socket = require"socket"
sock = socket.connect("tcp.st", 7777)
local i = 1
while i <= #data do
i = 1 + sock.send(data, i)
end
sock.settimeout(1)
local reply = sock.receive"*a"
local url
for key, value in reply:gmatch"(%S+) ([^\n]*)\n" do
if key == "URL" then
url = value
end
end
SSL
You can also use tcpaste over SSL using the port 8777. URL and ADMIN parameters automatically become HTTPS links.
PASTE REMOVAL
Upon pasting, you will receive a URL for administering the paste. Anyone who has the admin URL can delete the paste. Pastes also expire, and the expiration period is configurable via the admin URL.
For pastes violating various laws, including intellectual property laws, please contact the author (see below). Due to the public availability of the service, the host of tcpaste should not be held responsible for any submitted content.
BUT CAN I PASTE FROM THE BROWSER
Nuh-uh.
DONATE
AUTHOR
2.0.0
TCPASTE(7)
2018-07-19