-
Notifications
You must be signed in to change notification settings - Fork 11
/
Common.py
59 lines (47 loc) · 1.13 KB
/
Common.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""
Common functions
Author's website: Mohad.red
"""
from Config import *
import requests
def fix(string,fixNumber):
l = fixNumber - len(string)
string = string + ' '* l
return string
def shift(data, shift, sender = True):
newDate = ""
for c in data:
n = int(ord(c))
#print(n)
if n > 30:
strNumber = chr(int(ord(c) + shift))
newDate += strNumber
if n > 0 and n < 30:
newDate += '\r\n'
if sender:
data = IDentifier + newDate
else:
data = newDate
return data
def loadIPs():
try:
for line in open('ips.conf'):
ip = line.strip()
listOfIPs.append(ip)
except:
if debug:
print("loadIPs() has failed")
pass
"""
Basic python3 function that sends an update to the pwnboard
"""
def sendUpdate(ip, name="Restless"):
host = "http://logs.pwnboard.win:8080/generic"
data = {'ip': ip, 'type': name}
try:
req = requests.post(host, json=data, timeout=3)
print(req.text)
return True
except Exception as E:
print(E)
return False