forked from r4sas/PBinCLI
R4SAS
8 years ago
5 changed files with 110 additions and 24 deletions
@ -1,19 +1,26 @@ |
|||||||
import requests |
import requests |
||||||
import json |
import json |
||||||
import urllib |
import urllib |
||||||
from pprint import pprint |
|
||||||
class privatebin(object): |
class privatebin(object): |
||||||
|
|
||||||
|
|
||||||
def __init__(self): |
def __init__(self): |
||||||
#self.proxies = {'http': 'http://127.0.0.1:4444'} |
self.proxies = {'http': 'http://127.0.0.1:4444'} |
||||||
self.server = 'http://paste.r4sas.i2p/' |
self.server = 'http://paste.r4sas.i2p/' |
||||||
self.headers = {'X-Requested-With': 'JSONHttpRequest'} |
self.headers = {'X-Requested-With': 'JSONHttpRequest'} |
||||||
|
|
||||||
def post(self, data, password): |
|
||||||
#r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=data) |
def post(self, request): |
||||||
r = requests.post(url=self.server, headers=self.headers, data=data) |
r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=request) |
||||||
print(r.text) |
return r.text, self.server |
||||||
result = json.loads(r.text) |
|
||||||
'''Standart response: {"status":0,"id":"aaabbb","url":"\/?aaabbb","deletetoken":"aaabbbccc"}''' |
|
||||||
if result['status'] == 0: |
def get(self, request): |
||||||
print("Paste uploaded!\nPasteID:\t{}\nPassword:\t{}\nDelete token:\t{}\n".format(result['id'], password.decode("UTF-8"), result['deletetoken'])) |
url = self.server + "?" + request |
||||||
|
r = requests.get(url=url, headers=self.headers, proxies=self.proxies) |
||||||
|
return r.text |
||||||
|
|
||||||
|
|
||||||
|
def delete(self, request): |
||||||
|
r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=request) |
||||||
|
return r.text |
||||||
|
Loading…
Reference in new issue