forked from r4sas/PBinCLI
R4SAS
7 years ago
4 changed files with 24 additions and 25 deletions
@ -1,35 +1,28 @@
@@ -1,35 +1,28 @@
|
||||
import requests |
||||
import pbincli.settings |
||||
|
||||
class privatebin(object): |
||||
def __init__(self): |
||||
if args.server: |
||||
self.server = args.server |
||||
else: |
||||
self.server = pbincli.settings.server |
||||
|
||||
class PrivateBin: |
||||
def __init__(self, server = pbincli.settings.server, proxy = pbincli.settings.proxy, useproxy = pbincli.settings.useproxy): |
||||
self.server = server |
||||
self.headers = {'X-Requested-With': 'JSONHttpRequest'} |
||||
|
||||
if args.proxy: |
||||
self.proxies = {args.proxy.split('://')[0]: args.proxy} |
||||
elif pbincli.settings.useproxy: |
||||
self.proxies = pbincli.settings.proxies |
||||
if useproxy: |
||||
self.proxy = {proxy.split('://')[0]: proxy} |
||||
else: |
||||
self.proxies = {} |
||||
self.proxy = {} |
||||
|
||||
|
||||
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.proxy, data = request) |
||||
return r.text |
||||
|
||||
|
||||
def get(self, 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.proxy) |
||||
return r.text |
||||
|
||||
|
||||
def delete(self, pasteid, 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.proxy, data = request) |
||||
return r.text |
||||
|
Loading…
Reference in new issue