Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agentd00nut/servebin
Simple Little PHP server to automate bin creation on pasteBin.com
https://github.com/agentd00nut/servebin
Last synced: 1 day ago
JSON representation
Simple Little PHP server to automate bin creation on pasteBin.com
- Host: GitHub
- URL: https://github.com/agentd00nut/servebin
- Owner: agentd00nut
- Created: 2018-06-04T20:37:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-04T21:56:08.000Z (over 6 years ago)
- Last Synced: 2023-07-21T09:04:00.047Z (over 1 year ago)
- Language: PHP
- Size: 22.5 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# serveBin
Simple Slim3 based server that blindly accepts posts and makes bins with
your configured user account to pasteBin.com# Starting Server
Fill out cache/userOptions with your credentials for pasteBin.
Run the server.
` composer start`
or
`php -S localhost:8080 -t public`
or
Serve up the public folder with your favorite web server.# POST
`curl -F upload=@- http://localhost:8080/`
or
`'curl -F upload=@- -F private=1 http://localhost:8080/'` to change the
privacy level of the bin.You'll get back either an error message, or a link to the pasteBin that
was created.# GET
You can also retrieve pastes directly from pasteBin... Though this server
will only try to render pastes that are 1:1 copies of an image!`http://localhost:8080/cuSiKL1V`
That's probably a security flaw? Depends how much you can trust `htmlspecialchars`
# Aliases
`alias serveBin='curl -F upload=@- http://localhost:8080/'`
`alias wasteBinPrivate='curl -F upload=@- -F private=1 http://localhost:8080/' `
Obviously change things and include your secretMessage if you use that.
You can pass any of these keywords as a form to edit that part of the bin
`"private","name","expire","format","key"`You can easily figure out how to use these from the pastebin Docs.
# Security
There isn't much.
Leave the secretMessage blank if you want anyone who can post at your
server to be able to post message as you.Obviously if this is going to be hosted anywhere public that's likely to
be a poor choice.Also obviously this is a terrible way to do security and someone who wants
to write something more appropriate is free to open a pull request :)# Upgrades
Many.- Security.
- Handling all the options from the $_POST variable would be neat.
- Cleaning up the class.
- Cleaning up how requests to paste bin are handled.
- Add real error handling.I will likely do none of those things so feel free!