Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

[Request] An app to call my website's API (a pastebin alt.)

Hey guys,

Not sure if this is allowed (a request). But i basically need a simple desktop app that creates a context menu link that would contact my api at http://paste.sx
Then it would upload the selected files contents.

So right click > upload to paste.sx
The app could have a settings page to specify the API key to contact the API.

The API docs are here: http://paste.sx/029
They're only in PHP for now but hopefully others can expand it when needed.

I would be grateful if someone could do this, i think this is very useful for many people. I cannot pay, unfortunately but the source will have your name and you will be credited where credit is due.
I will do this once I get off my next flight (assuming I'm not to tired, I don't move back into my new home until about 12). But on a side note, there isn't a real big need for an API for this. Your csrfToken can be brought out by [<input type="hidden" name="csrfToken" value="Y8mUYbh3yrm4UfDYytRfpKfGa4rDOzR/goSKJq/u/mY"], then just upload title + content + password if wanted into a single request. Would be the same speed. On a side note, you may want to make that a little more secure, I could spam thousands of them a second and fill your server otherwise. However, I will give you that, it looks beautiful. I love what your website looks like. (I just posted one 'test' 'test' just to demonstrate, I can't see any blockers for spam so.)

But ya, I'll write for your api soon. (well hopefully within next 8-10 hours)

On a side note, I like how your pastes are doxes, saying fuck paste.sx or dos scripts. Lol
(Aug 1, 2014 05:02 PM)Dispersia Wrote:  I will do this once I get off my next flight (assuming I'm not to tired, I don't move back into my new home until about 12). But on a side note, there isn't a real big need for an API for this. Your csrfToken can be brought out by [<input type="hidden" name="csrfToken" value="Y8mUYbh3yrm4UfDYytRfpKfGa4rDOzR/goSKJq/u/mY"], then just upload title + content + password if wanted into a single request. Would be the same speed. On a side note, you may want to make that a little more secure, I could spam thousands of them a second and fill your server otherwise. However, I will give you that, it looks beautiful. I love what your website looks like. (I just posted one 'test' 'test' just to demonstrate, I can't see any blockers for spam so.)

But ya, I'll write for your api soon. (well hopefully within next 8-10 hours)

On a side note, I like how your pastes are doxes, saying fuck paste.sx or dos scripts. Lol

Hi, thanks for your comment.
There already is an API, so it would just be a C# api caller (POSTer). Refer here: https://paste.sx/029

What do you mean the csrfToken can be brought out?

I would like you to demonstrate that the home page is spam-able.

About the doxes and such, there will be a report button later on.

Looking forward for the app and goodluck with your flight :)
Just use GET variables on your php to send the data using a webclient on c#
(Aug 1, 2014 05:42 PM)+Haze Wrote:  Just use GET variables on your php to send the data using a webclient on c#

If i understand you correctly, GET wouldn't be the best since it has a data limit.
I would write this for you, working on it right now. However with your json request thingy it is quite hard to defer upload instead of buffer it. The problem is that you require to put the file content as a string in the json format. So that means we have to load the whole file into memory, and that isn't a very good idea if it is a large file. I try to figure it out..
But the real reason for this reply is, can you provide me an api key and what exactly is the format of the response? I'm not good at json but is this right:
Code
{"status":"Error","message":"API Key not set."}

public string Status { get; set; }
public string Message { get; set; }

What other statuses can you return? Only indication of failure and success? Btw the context menu is just registry change.

Note: If you want more then just this api like a fancy gui you have to ask someone else or provide your own :P
You cannot use POST webrequest method because you have CSRF protection.
(Aug 2, 2014 02:00 PM)iVision Wrote:  I would write this for you, working on it right now. However with your json request thingy it is quite hard to defer upload instead of buffer it. The problem is that you require to put the file content as a string in the json format. So that means we have to load the whole file into memory, and that isn't a very good idea if it is a large file. I try to figure it out..
But the real reason for this reply is, can you provide me an api key and what exactly is the format of the response? I'm not good at json but is this right:
Code
{"status":"Error","message":"API Key not set."}

public string Status { get; set; }
public string Message { get; set; }

What other statuses can you return? Only indication of failure and success? Btw the context menu is just registry change.

Note: If you want more then just this api like a fancy gui you have to ask someone else or provide your own :P

Hi, you can get an API by registering then go to your account page :)

For now you can only create a paste so it will only output either success or error!


(Aug 2, 2014 02:06 PM)Secret Agent Wrote:  You cannot use POST webrequest method because you have CSRF protection.

The API does not have CSRF, only the homepage does.
https://mega.co.nz/#!3M9ghJxa!CoSllwSoZL...IS0K7fSKe0

Download that. Tell me if thats what you wanted
[Image: GwdtvQ8.png]
(Aug 2, 2014 02:47 PM)base Wrote:  https://mega.co.nz/#!3M9ghJxa!CoSllwSoZL...IS0K7fSKe0

Download that. Tell me if thats what you wanted

Hey, the program doesn't work. It just crashes on start.
the site don't need an api.
this is the post code and is easy to bypass the csrf (like disperia says) so spam is possible

Code
title=&submit_paste=&csrfToken=RO5nuzQqxDokRbCImwOV0GNalxHbpThxvk%2FWxq9beaM%3D&password=&expiry=0&syntax=cirru&visibility=0&content=text

i don't know php but maybe is better if you insert csrf token in php page that post message and not in home page
(Aug 2, 2014 09:54 PM)Damdomy Wrote:  Hey, the program doesn't work. It just crashes on start.

Any error messages? o.o

Also what version of .net framework are you running




https://mega.co.nz/#!eRklhRRR!39nRVwbTQE...3XlXbf_5xQ

I added some additional error handling to see what is causing it to crash.
[Image: GwdtvQ8.png]
(Aug 3, 2014 01:33 AM)aleeeeeee Wrote:  the site don't need an api.
this is the post code and is easy to bypass the csrf (like disperia says) so spam is possible

Code
title=&submit_paste=&csrfToken=RO5nuzQqxDokRbCImwOV0GNalxHbpThxvk%2FWxq9beaM%3D&password=&expiry=0&syntax=cirru&visibility=0&content=text

i don't know php but maybe is better if you insert csrf token in php page that post message and not in home page

Then try to bypass CSRF and tell me how you failed

(Aug 1, 2014 05:02 PM)Dispersia Wrote:  I will do this once I get off my next flight (assuming I'm not to tired, I don't move back into my new home until about 12). But on a side note, there isn't a real big need for an API for this. Your csrfToken can be brought out by [<input type="hidden" name="csrfToken" value="Y8mUYbh3yrm4UfDYytRfpKfGa4rDOzR/goSKJq/u/mY"], then just upload title + content + password if wanted into a single request. Would be the same speed. On a side note, you may want to make that a little more secure, I could spam thousands of them a second and fill your server otherwise. However, I will give you that, it looks beautiful. I love what your website looks like. (I just posted one 'test' 'test' just to demonstrate, I can't see any blockers for spam so.)

But ya, I'll write for your api soon. (well hopefully within next 8-10 hours)

On a side note, I like how your pastes are doxes, saying fuck paste.sx or dos scripts. Lol

Good luck with that
(Aug 3, 2014 07:55 AM)base Wrote:  Any error messages? o.o

Also what version of .net framework are you running




https://mega.co.nz/#!eRklhRRR!39nRVwbTQE...3XlXbf_5xQ

I added some additional error handling to see what is causing it to crash.

I was running 4.0. The problem was i didn't run it as admin. Works great now! This is exactly what i want except maybe you can grab the file name with it too :D
(Aug 3, 2014 12:02 PM)Damdomy Wrote:  I was running 4.0. The problem was i didn't run it as admin. Works great now! This is exactly what i want except maybe you can grab the file name with it too :D

Alright, I'll add the name as well. If you can modify the API to respond with the link it gave it, I can also add that in (to make it open the paste)




https://mega.co.nz/#!DNNmRLTS!9TFN9inJKc...75Jur_ZvlI <- final
[Image: GwdtvQ8.png]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by skinnypete2Apr 28, 2022 09:45 PM 6 211 Apr 28, 2022 09:45 PM
Last Post: Crackist
[C] by SIM-3437924Jul 2, 2021 12:02 PM 6 368 Jul 2, 2021 12:02 PM
Last Post: sigmasmom
[C#] by rock1zzNov 11, 2020 10:09 AM 10 432 Nov 11, 2020 10:09 AM
Last Post: rock1zz