1
1
mirror of https://github.com/r4sas/PBinCLI synced 2025-01-10 14:58:04 +00:00

transports started

This commit is contained in:
R4SAS 2017-02-19 13:26:22 +03:00
parent 8014c386ac
commit 0343e318fb
4 changed files with 24 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import pbincli.actions
from Crypto.Hash import SHA256
from Crypto.Random import get_random_bytes
from pbincli.sjcl_gcm import SJCL
from pbincli.transports import privatebin
from pbincli.utils import PBinCLIException, check_readable, check_writable
from zlib import compress
@ -23,5 +24,7 @@ def send(args):
password = passphrase + p.hexdigest().encode("UTF-8")
data = SJCL().encrypt(file, password)
request = "data={}&expire={}&formatter={}&burnafterreading={}&opendiscussion={}".format(data, args.expire, args.format, int(args.burn), int(args.discus))
'''Here we must run function post from pbincli.transports'''
print(data)
print(request)
privatebin().post(request)

View File

@ -133,11 +133,11 @@ class SJCL(object):
ciphertext = ciphertext + mac
return {
"salt": base64.b64encode(salt),
"salt": base64.b64encode(salt).decode('UTF-8'),
"iter": count,
"ks": dkLen*8,
"ct": base64.b64encode(ciphertext),
"iv": base64.b64encode(iv),
"ct": base64.b64encode(ciphertext).decode('UTF-8'),
"iv": base64.b64encode(iv).decode('UTF-8'),
"cipher": "aes",
"mode": "gcm",
"adata": "",

16
pbincli/transports.py Normal file
View File

@ -0,0 +1,16 @@
import requests
import json
import urllib
class privatebin(object):
def __init__(self):
self.proxies = {'http': 'http://127.0.0.1:4444'}
self.server = 'http://paste.r4sas.i2p/'
self.headers = {'X-Requested-With': 'JSONHttpRequest'}
def post(self, data):
r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=data)
print(r.request)
print(r.status_code)
print(r.text)

View File

@ -1 +1,2 @@
pycryptodome
requests