Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 921e449

Browse files
committed
added support for cloaking Churrasco.exe file
1 parent 4559ded commit 921e449

5 files changed

Lines changed: 21 additions & 5 deletions

File tree

-123 KB
Binary file not shown.
122 KB
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Due to the anti-virus positive detection of executable stored inside this folder,
2+
we needed to somehow circumvent this. As from the plain sqlmap users perspective nothing
3+
has to be done prior to it's usage by sqlmap, but if you want to have access to the
4+
original use the decrypt functionality of the ../extra/cloak/cloak.py utility.
5+
6+
To prepare the executable to the cloaked form use this command:
7+
python ../extra/cloak/cloak.py -i Churrasco.exe
8+
9+
To get back the original executable use this:
10+
python ../extra/cloak/cloak.py -d -i Churrasco.exe_

lib/takeover/web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import re
2727
from tempfile import NamedTemporaryFile
2828

29+
from extra.cloak.cloak import decloak
2930
from lib.core.agent import agent
3031
from lib.core.common import fileToStr
3132
from lib.core.common import getDirs
@@ -38,7 +39,6 @@
3839
from lib.core.data import paths
3940
from lib.core.exception import sqlmapUnsupportedDBMSException
4041
from lib.core.shell import autoCompletion
41-
from extra.cloak.cloak import decloak
4242
from lib.request.connect import Connect as Request
4343

4444

plugins/generic/takeover.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
import os
2626
import re
27+
from tempfile import NamedTemporaryFile
2728

29+
from extra.cloak.cloak import decloak
2830
from lib.core.agent import agent
2931
from lib.core.common import fileToStr
3032
from lib.core.common import getDirs
@@ -45,7 +47,6 @@
4547
from lib.takeover.registry import Registry
4648
from lib.techniques.outband.stacked import stackedTest
4749

48-
4950
class Takeover(Abstraction, Metasploit, Registry):
5051
"""
5152
This class defines generic OS takeover functionalities for plugins.
@@ -66,12 +67,17 @@ def uploadChurrasco(self):
6667
output = readInput(msg, default="Y")
6768

6869
if not output or output[0] in ( "y", "Y" ):
69-
wFile = os.path.join(paths.SQLMAP_CONTRIB_PATH, "tokenkidnapping", "Churrasco.exe")
70-
70+
tmpFile = NamedTemporaryFile()
71+
tmpFile.write(decloak(os.path.join(paths.SQLMAP_CONTRIB_PATH, "tokenkidnapping", "Churrasco.exe_")))
72+
tmpFile.seek(0)
73+
74+
wFile = tmpFile.name
7175
self.churrascoPath = "%s/sqlmapchur%s.exe" % (conf.tmpPath, randomStr(lowercase=True))
7276
self.cmdFromChurrasco = True
73-
77+
7478
self.writeFile(wFile, self.churrascoPath, "binary", confirm=False)
79+
80+
tmpFile.close()
7581

7682
return True
7783
else:

0 commit comments

Comments
 (0)