forked from r4sas/PBinCLI
R4SAS
8 years ago
5 changed files with 32 additions and 10 deletions
@ -0,0 +1,13 @@ |
|||||||
|
def init(): |
||||||
|
global server, proxies, useproxy |
||||||
|
|
||||||
|
"""Edit that variables""" |
||||||
|
server = "https://privatebin.net/" |
||||||
|
proxies = {'http': 'http://127.0.0.1:4444'} |
||||||
|
useproxy = False |
||||||
|
|
||||||
|
""" There is nothing more to do :D """ |
||||||
|
|
||||||
|
"""if you set useproxy to false, we clean proxies variable""" |
||||||
|
if useproxy == False: |
||||||
|
proxies = {} |
@ -1,25 +1,25 @@ |
|||||||
import requests |
import requests |
||||||
|
import pbincli.settings |
||||||
|
|
||||||
class privatebin(object): |
class privatebin(object): |
||||||
def __init__(self): |
def __init__(self): |
||||||
self.proxies = {'http': 'http://127.0.0.1:4444'} |
self.server = pbincli.settings.server |
||||||
self.server = 'http://paste.r4sas.i2p/' |
self.proxies = pbincli.settings.proxies |
||||||
self.headers = {'X-Requested-With': 'JSONHttpRequest'} |
self.headers = {'X-Requested-With': 'JSONHttpRequest'} |
||||||
|
|
||||||
|
|
||||||
def post(self, request): |
def post(self, request): |
||||||
r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=request) |
r = requests.post(url = self.server, headers = self.headers, proxies = self.proxies, data = request) |
||||||
return r.text, self.server |
return r.text |
||||||
|
|
||||||
|
|
||||||
def get(self, request): |
def get(self, request): |
||||||
url = self.server + "?" + request |
url = self.server + "?" + request |
||||||
r = requests.get(url=url, headers=self.headers, proxies=self.proxies) |
r = requests.get(url = url, headers = self.headers, proxies = self.proxies) |
||||||
return r.text |
return r.text |
||||||
|
|
||||||
|
|
||||||
def delete(self, pasteid, token): |
def delete(self, pasteid, token): |
||||||
request = {'pasteid':pasteid,'deletetoken':token} |
request = {'pasteid':pasteid,'deletetoken':token} |
||||||
r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=request) |
r = requests.post(url = self.server, headers = self.headers, proxies = self.proxies, data = request) |
||||||
return r.text |
return r.text |
||||||
|
Loading…
Reference in new issue