go-paste/public/index.html

22 lines
6.2 KiB
HTML
Raw Normal View History

<?doctype html?><html ng-app="souris-app"><head><base href="/"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>PasteBox</title><script id="ui/create.html" type="text/ng-template"><div class="row" ng-show="result != undefined"><div class="col-xs-12"><div class="input-group"><span class="input-group-btn"><a class="btn btn-default" ng-click="reload()" type="button">New</a></span> <input type="text" readonly="readonly" class="form-control" select-on-click value="{{$base_url}}/#/{{result.id}}!{{result.key}}"> <span class="input-group-btn"><a class="btn btn-default" ng-href="/#/{{result.id}}!{{result.key}}">Open</a></span></div></div><pre class="col-xs-12"> # Command Line: curl -s {{$base_url}}/api/get/{{result.id}} | sed "1,/^\$/d" | openssl aes-256-cbc -d -a -k {{result.key}} <span ng-if="o.zip == true">| gzip -dc</span>
2017-04-14 16:15:07 -06:00
{{result.text}}</pre></div><div ng-hide="result != undefined"><form name="paste" ng-submit="Encrypt(o)"><div class="form form-inline"><ol class="breadcrumb"><li><label>Syntax</label><select class="form-control input-sm" ng-model="o.lang" ng-options="i.key as i.val for i in HighliteLang | orderBy:&quot;+val&quot;" ng-init="o.lang = &quot;text&quot;"></select></li><li><label>Expires</label><select class="form-control input-sm" ng-model="o.exp" ng-options="i.key as i.val for i in ExpireTimes | orderBy:&quot;+key&quot;" ng-init="o.exp = 604800"></select></li><li><label><input type="checkbox" ng-model="o.burn"> Burn on Read</label></li></ol></div><textarea style="font-family:hack,&quot" required class="form-control" rows="20" ng-model="o.text"></textarea><pre>Additional Entropy: {{entropy}} bytes / Content size: {{o.text|blength|default:0}} bytes</pre><button type="submit" class="btn btn-default btn-lg btn-block" ng-disabled="o.text == undefined || o.text.length == 0">Encrypt</button></form><p>Create pastes from the command line! <a href="./paste.sh">paste.sh</a><pre>
2017-04-14 16:15:07 -06:00
$ echo /etc/passwd | ./paste.sh
env options:
PASTE_URL - Set the url base for paste operations (default: HTTPS://paste.dn42.us)
2017-04-14 16:15:07 -06:00
PASTE_GZIP - 0 = No Compression, 1 = Use gzip compression (default: 0)
PASTE_BURN - 0 = No Burn on Read, 1 = Burn on read (default: 0)
PASTE_DATE - Value to be used when setting expire date. (default: next-week)
</pre></p></div></script><script id="ui/view.html" type="text/ng-template"><div class="row"><div class="col-xs-12"><div class="input-group"><span class="input-group-btn"><a class="btn btn-default" ng-href="/#/" type="button">New</a></span> <input type="text" readonly="readonly" class="form-control" select-on-click value="{{$base_url}}/#/{{id}}!{{key}}"> <span class="input-group-btn"><a class="btn btn-default" ng-click="copy(store.tx)">Copy</a></span></div></div></div><div ng-if="store.err == undefined"><div class="well well-sm"><b>Lang:</b> {{store.lang}}, <b>Expires:</b> <span ng-if="store.exp != &quot;burn_on_read&quot;">{{store.exp*1000|date}}</span><span ng-if="store.exp == &quot;burn_on_read&quot;">Burn on Read</span></div><div hljs language="{{store.lang}}" source="store.tx"></div><pre class="col-xs-12"> # Command Line: curl -s {{$base_url}}/api/get/{{id}} | sed "1,/^\$/d" | openssl aes-256-cbc -d -a -k {{key}} <span ng-if="store.zip != undefined">| gzip -dc</span>
</pre></div><div ng-if="store.err != undefined"><h3>Error: {{store.err}}</h3></div></script></head><body><div id="wrapper"><div class="container-responsive"><article ng-view></article><a onclick="var elm = document.getElementById(&quot;debug&quot;); elm.parentNode.style.display=&quot;block&quot;; window.scrollTop = window.scrollHeight" style="margin:3px;cursor:context-menu;font-family:monospace;position:fixed;bottom:0;right:0">&pi;</a><div class="panel panel-default" style="height:13em;margin-bottom:0;margin-top:2em;display:none;position:relative;bottom:0"><b>Debug Log</b><div style="float:right"><a class="btn" onclick="document.getElementById(&quot;debug&quot;).parentNode.style.display=&quot;none&quot;"><i class="glyphicon glyphicon-remove"></i></a><br><a class="btn" onclick="var elm=document.getElementById(&quot;debug&quot;);while (elm.firstChild) {elm.removeChild(elm.firstChild);}"><i class="glyphicon glyphicon-ban-circle"></i></a></div><pre id="debug" style="height:12em;overflow:scroll"></pre><footer></footer></div></div></div><link rel="stylesheet" href="style.css"><script src="app.js"></script><noscript><div class="container-responsive"><h1>PasteBox</h1><p>It looks like yo don't have javascript enabled for this site. But thats ok. You can still submit and read the content of pastes by using a few curl/openssl/gunzip commands.</p><h2>Get the paste</h2><p>Lets say you have the following link <code>https://domain.tld/#/FeLq42kIQV69hQCJA8m9lg!5EDDziaCjceHjeG5UQ9M7-6wgyq5YVfysAEZ0wUNy6w</code>. Query the REST endpoint for the ID or part before the ! in the url hash.</p><pre><code>$ curl -i https://domain.tld/api/FeLq42kIQV69hQCJA8m9lg</code></pre><h2>Decrypt</h2><p>Using Openssl you want to remove the header and pass the remaining base64 for decryption. The cypher used is aes-256-cbc. The key is the portion after the ! in the link.</p><pre><code>... | sed '1,/^$/d' | openssl aes-256-cbc -d -a -k 5EDDziaCjceHjeG5UQ9M7-6wgyq5YVfysAEZ0wUNy6w</code></pre><h2>Deflate</h2><p>If as in the provided example the paste has been compressed pass it through gunzip. The header will have "zip: true" if it has been compressed.</p><pre><code> ... | gzip -dc </code></pre><h2>Example Output</h2><pre><code>$ curl -s "https://domain.tld/api/FeLq42kIQV69hQCJA8m9lg" | sed "1,/^$/d" | openssl aes-256-cbc -d -a -k 5EDDziaCjceHjeG5UQ9M7-6wgyq5YVfysAEZ0wUNy6w | gzip -dc
2017-04-14 16:15:07 -06:00
. ____ .-.
.-"` `",( __\_
.-==:;-._ .' .-. `'.
.' `"-:'-/ ( \} -=a .)
/ \/ \,== `- __..-'`
'-' | | | .'\ `;
\ _/---'\ ( `"`
/.`._ ) \ `; Sour.is Paste
\`-/.' `"`
`"\`-.</code></pre></div></noscript></body></html>