forked from r4sas/PBinCLI
transports started
This commit is contained in:
parent
8014c386ac
commit
0343e318fb
@ -4,6 +4,7 @@ import pbincli.actions
|
|||||||
from Crypto.Hash import SHA256
|
from Crypto.Hash import SHA256
|
||||||
from Crypto.Random import get_random_bytes
|
from Crypto.Random import get_random_bytes
|
||||||
from pbincli.sjcl_gcm import SJCL
|
from pbincli.sjcl_gcm import SJCL
|
||||||
|
from pbincli.transports import privatebin
|
||||||
from pbincli.utils import PBinCLIException, check_readable, check_writable
|
from pbincli.utils import PBinCLIException, check_readable, check_writable
|
||||||
from zlib import compress
|
from zlib import compress
|
||||||
|
|
||||||
@ -23,5 +24,7 @@ def send(args):
|
|||||||
password = passphrase + p.hexdigest().encode("UTF-8")
|
password = passphrase + p.hexdigest().encode("UTF-8")
|
||||||
|
|
||||||
data = SJCL().encrypt(file, password)
|
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'''
|
'''Here we must run function post from pbincli.transports'''
|
||||||
print(data)
|
print(request)
|
||||||
|
privatebin().post(request)
|
||||||
|
@ -133,11 +133,11 @@ class SJCL(object):
|
|||||||
ciphertext = ciphertext + mac
|
ciphertext = ciphertext + mac
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"salt": base64.b64encode(salt),
|
"salt": base64.b64encode(salt).decode('UTF-8'),
|
||||||
"iter": count,
|
"iter": count,
|
||||||
"ks": dkLen*8,
|
"ks": dkLen*8,
|
||||||
"ct": base64.b64encode(ciphertext),
|
"ct": base64.b64encode(ciphertext).decode('UTF-8'),
|
||||||
"iv": base64.b64encode(iv),
|
"iv": base64.b64encode(iv).decode('UTF-8'),
|
||||||
"cipher": "aes",
|
"cipher": "aes",
|
||||||
"mode": "gcm",
|
"mode": "gcm",
|
||||||
"adata": "",
|
"adata": "",
|
||||||
|
16
pbincli/transports.py
Normal file
16
pbincli/transports.py
Normal 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)
|
@ -1 +1,2 @@
|
|||||||
pycryptodome
|
pycryptodome
|
||||||
|
requests
|
Loading…
x
Reference in New Issue
Block a user