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

Boo.Lang.List conversion fix and revert and recompile of Old Naga engine #151

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion silenttrinity/core/teamserver/comms/http.boo
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Requests:

class HTTP:
public Name as string = 'http'
public CallBackUrls as List = []
public CallBackUrls = []
private _guid as Guid
private Requests as Requests = Requests()

Expand Down
2 changes: 1 addition & 1 deletion silenttrinity/core/teamserver/comms/https.boo
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Requests:

class HTTPS:
public Name as string = 'https'
public CallBackUrls as List = []
public CallBackUrls = []
private _guid as Guid
private Requests as Requests = Requests()

Expand Down
Binary file modified silenttrinity/core/teamserver/data/naga.dll
Binary file not shown.
Binary file modified silenttrinity/core/teamserver/data/naga.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions silenttrinity/core/teamserver/data/stage.boo
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class CompilationException(Exception):
super(message)

class Args:
public args as List
public args = []
public source as string
public references as List
public references = []
public run_in_thread as bool = true

class JsonJob:
Expand Down Expand Up @@ -384,7 +384,7 @@ class STJob:
Client.SendJobResults(self)
return "Sent File"

public def CompileAndRun(source as string, references as List) as string:
public def CompileAndRun(source as string, references) as string:
#print("Received source: \n $source")
parameters = CompilerParameters(false)
parameters.Input.Add( StringInput("$(id).boo", source) )
Expand Down Expand Up @@ -448,8 +448,8 @@ class STJob:
Client.SendJobResults(self)

class STClient:
public Jobs as List = []
public Channels as List = [PUT_COMM_CLASSES_HERE]
public Jobs = []
public Channels = [PUT_COMM_CLASSES_HERE]
public Sleep as int = 5000
public MaxJitter as int = 0
public MinJitter as int = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ public static def Main():
return Enumerable.Range(0, hex.Length).Where({ x | return ((x % 2) == 0) }).Select({ x | return Convert.ToByte(hex.Substring(x, 2), 16) }).ToArray()

private static def ConvertFromPacketOrderedDictionary(packet_ordered_dictionary as OrderedDictionary) as (byte):
byte_list as List[of (byte)] = List[of (byte)]()
byte_list [of (byte)] = List[of (byte)]()
for de as DictionaryEntry in packet_ordered_dictionary:
byte_list.Add((de.Value as (byte)))
flattenedList = byte_list.SelectMany({ bytes | return bytes })
Expand Down
6 changes: 3 additions & 3 deletions silenttrinity/core/teamserver/modules/boo/src/bypassUAC.boo
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ public def TokenIsElevated(hToken as IntPtr) as bool:
return true


public def GetElevatedProcessTokens() as List:
result as List = []
public def GetElevatedProcessTokens():
result = []
IsElevated as bool
hProcessToken as IntPtr
hProcess as IntPtr
Expand Down Expand Up @@ -417,7 +417,7 @@ public static def BypassUAC(binary as string, arguments as string, path as strin
SE_GROUP_INTEGRITY_32 as UInt32 = 0x00000020

Username as string = WindowsIdentity.GetCurrent().Name
processes as List = []
processes = []
if processId == 0:
processes = GetElevatedProcessTokens()
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
if (PropertyName == "objectsid"):
value = SecurityIdentifier(Properties["objectsid"][0], 0).Value
elif (PropertyName == "sidhistory"):
historyListTemp as List = []
historyListTemp = []
for bytes in Properties["sidhistory"]:
historyListTemp.Add(SecurityIdentifier(bytes, 0).Value)
value = historyListTemp.Join(", ")
elif (PropertyName == "grouptype"):
try:
value = Properties["grouptype"][0] + " => "
gtactivated as List = []
gtactivated = []
for gt in System.Enum.GetValues(GroupTypeEnum):
if Properties["grouptype"][0] % gt cast int:
gtactivated.Add(gt)
Expand All @@ -92,7 +92,7 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
elif (PropertyName == "useraccountcontrol"):
try:
value = Properties["useraccountcontrol"][0] + " => "
uacactivated as List = []
uacactivated = []
for uac in System.Enum.GetValues(UACEnum):
if Properties["useraccountcontrol"][0] % uac cast int:
uacactivated.Add(uac)
Expand Down Expand Up @@ -129,7 +129,7 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
low = comobj.GetType().InvokeMember("LowPart", System.Reflection.BindingFlags.GetProperty, null, comobj, null)
property = int.Parse("0x" + high + "" + low, System.Globalization.NumberStyles.HexNumber).ToString()
else:
propertyList as List = []
propertyList = []
for prop as object in Properties[PropertyName]:
propertyList.Add(prop.ToString())
property = propertyList.Join(", ")
Expand Down Expand Up @@ -192,7 +192,7 @@ public static def Main():

print "[*] Creating DirectorySearcher with filter: " + Filter
directorysearcher as DirectorySearcher = DirectorySearcher(Filter)
value as List
value = []
directoryentry as DirectoryEntry
try:
if findone:
Expand Down
10 changes: 5 additions & 5 deletions silenttrinity/core/teamserver/modules/boo/src/domaingroups.boo
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
if (PropertyName == "objectsid"):
value = SecurityIdentifier(Properties["objectsid"][0], 0).Value
elif (PropertyName == "sidhistory"):
historyListTemp as List = []
historyListTemp = []
for bytes in Properties["sidhistory"]:
historyListTemp.Add(SecurityIdentifier(bytes, 0).Value)
value = historyListTemp.Join(", ")
elif (PropertyName == "grouptype"):
try:
value = Properties["grouptype"][0] + " => "
gtactivated as List = []
gtactivated = []
for gt in System.Enum.GetValues(GroupTypeEnum):
if Properties["grouptype"][0] % gt cast int:
gtactivated.Add(gt)
Expand All @@ -92,7 +92,7 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
elif (PropertyName == "useraccountcontrol"):
try:
value = Properties["useraccountcontrol"][0] + " => "
uacactivated as List = []
uacactivated = []
for uac in System.Enum.GetValues(UACEnum):
if Properties["useraccountcontrol"][0] % uac cast int:
uacactivated.Add(uac)
Expand Down Expand Up @@ -129,7 +129,7 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
low = comobj.GetType().InvokeMember("LowPart", System.Reflection.BindingFlags.GetProperty, null, comobj, null)
property = int.Parse("0x" + high + "" + low, System.Globalization.NumberStyles.HexNumber).ToString()
else:
propertyList as List = []
propertyList = []
for prop as object in Properties[PropertyName]:
propertyList.Add(prop.ToString())
property = propertyList.Join(", ")
Expand Down Expand Up @@ -191,7 +191,7 @@ public static def Main():

print "[*] Creating DirectorySearcher with filter: " + Filter
directorysearcher as DirectorySearcher = DirectorySearcher(Filter)
value as List
value = []
directoryentry as DirectoryEntry
try:
if findone:
Expand Down
10 changes: 5 additions & 5 deletions silenttrinity/core/teamserver/modules/boo/src/domainquery.boo
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
if (PropertyName == "objectsid"):
value = SecurityIdentifier(Properties["objectsid"][0], 0).Value
elif (PropertyName == "sidhistory"):
historyListTemp as List = []
historyListTemp = []
for bytes in Properties["sidhistory"]:
historyListTemp.Add(SecurityIdentifier(bytes, 0).Value)
value = historyListTemp.Join(", ")
elif (PropertyName == "grouptype"):
try:
value = Properties["grouptype"][0] + " => "
gtactivated as List = []
gtactivated = []
for gt in System.Enum.GetValues(GroupTypeEnum):
if Properties["grouptype"][0] % gt cast int:
gtactivated.Add(gt)
Expand All @@ -92,7 +92,7 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
elif (PropertyName == "useraccountcontrol"):
try:
value = Properties["useraccountcontrol"][0] + " => "
uacactivated as List = []
uacactivated = []
for uac in System.Enum.GetValues(UACEnum):
if Properties["useraccountcontrol"][0] % uac cast int:
uacactivated.Add(uac)
Expand Down Expand Up @@ -129,7 +129,7 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
low = comobj.GetType().InvokeMember("LowPart", System.Reflection.BindingFlags.GetProperty, null, comobj, null)
property = int.Parse("0x" + high + "" + low, System.Globalization.NumberStyles.HexNumber).ToString()
else:
propertyList as List = []
propertyList = []
for prop as object in Properties[PropertyName]:
propertyList.Add(prop.ToString())
property = propertyList.Join(", ")
Expand All @@ -146,7 +146,7 @@ public static def Main():

print "[*] Creating DirectorySearcher with filter: " + Filter
directorysearcher as DirectorySearcher = DirectorySearcher(Filter)
value as List
value = []
directoryentry as DirectoryEntry
try:
if findone:
Expand Down
10 changes: 5 additions & 5 deletions silenttrinity/core/teamserver/modules/boo/src/domainusers.boo
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
if (PropertyName == "objectsid"):
value = SecurityIdentifier(Properties["objectsid"][0], 0).Value
elif (PropertyName == "sidhistory"):
historyListTemp as List = []
historyListTemp = []
for bytes in Properties["sidhistory"]:
historyListTemp.Add(SecurityIdentifier(bytes, 0).Value)
value = historyListTemp.Join(", ")
elif (PropertyName == "grouptype"):
try:
value = Properties["grouptype"][0] + " => "
gtactivated as List = []
gtactivated = []
for gt in System.Enum.GetValues(GroupTypeEnum):
if Properties["grouptype"][0] % gt cast int:
gtactivated.Add(gt)
Expand All @@ -92,7 +92,7 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
elif (PropertyName == "useraccountcontrol"):
try:
value = Properties["useraccountcontrol"][0] + " => "
uacactivated as List = []
uacactivated = []
for uac in System.Enum.GetValues(UACEnum):
if Properties["useraccountcontrol"][0] % uac cast int:
uacactivated.Add(uac)
Expand Down Expand Up @@ -129,7 +129,7 @@ private static def ConvertLDAPProperty(Properties as ResultPropertyCollection, P
low = comobj.GetType().InvokeMember("LowPart", System.Reflection.BindingFlags.GetProperty, null, comobj, null)
property = int.Parse("0x" + high + "" + low, System.Globalization.NumberStyles.HexNumber).ToString()
else:
propertyList as List = []
propertyList = []
for prop as object in Properties[PropertyName]:
propertyList.Add(prop.ToString())
property = propertyList.Join(", ")
Expand Down Expand Up @@ -187,7 +187,7 @@ public static def Main():

print "[*] Creating DirectorySearcher with filter: " + Filter
directorysearcher as DirectorySearcher = DirectorySearcher(Filter)
value as List
value = []
directoryentry as DirectoryEntry
try:
if findone:
Expand Down
8 changes: 4 additions & 4 deletions silenttrinity/core/teamserver/modules/boo/src/getsystem.boo
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ public def ImpersonateProcess(ProcessID as UInt32) as bool:
return false


public def GetUserProcessTokensForUser(Username as string) as List:
result as List = []
public def GetUserProcessTokensForUser(Username as string):
result = []
IsElevated as bool
hProcessToken as IntPtr
hProcess as IntPtr
Expand All @@ -492,7 +492,7 @@ public def GetUserProcessTokensForUser(Username as string) as List:


public def ImpersonateUser(Username as string):
userProcessTokens as List
userProcessTokens = []
userProcessTokens = GetUserProcessTokensForUser(Username)
print "Processes for " + Username + ": " + userProcessTokens.Count
print "Attempting to impersonate: " + Username
Expand Down Expand Up @@ -531,7 +531,7 @@ public def GetCurrentProcessToken() as IntPtr:


public def EnableTokenPrivilege(ref hToken as IntPtr, Privilege as string) as bool:
Privileges as List = ["SeAssignPrimaryTokenPrivilege",
Privileges = ["SeAssignPrimaryTokenPrivilege",
"SeAuditPrivilege", "SeBackupPrivilege", "SeChangeNotifyPrivilege", "SeCreateGlobalPrivilege",
"SeCreatePagefilePrivilege", "SeCreatePermanentPrivilege", "SeCreateSymbolicLinkPrivilege",
"SeCreateTokenPrivilege", "SeDebugPrivilege", "SeEnableDelegationPrivilege",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public def GetCurrentProcessToken() as IntPtr:


public def EnableTokenPrivilege(ref hToken as IntPtr, Privilege as string) as bool:
Privileges as List = ["SeAssignPrimaryTokenPrivilege",
Privileges = ["SeAssignPrimaryTokenPrivilege",
"SeAuditPrivilege", "SeBackupPrivilege", "SeChangeNotifyPrivilege", "SeCreateGlobalPrivilege",
"SeCreatePagefilePrivilege", "SeCreatePermanentPrivilege", "SeCreateSymbolicLinkPrivilege",
"SeCreateTokenPrivilege", "SeDebugPrivilege", "SeEnableDelegationPrivilege",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ public def ImpersonateProcess(ProcessID as UInt32) as bool:
return false


public def GetUserProcessTokensForUser(Username as string) as List:
result as List = []
public def GetUserProcessTokensForUser(Username as string):
result = []
IsElevated as bool
hProcessToken as IntPtr
hProcess as IntPtr
Expand All @@ -492,7 +492,7 @@ public def GetUserProcessTokensForUser(Username as string) as List:


public def ImpersonateUser(Username as string):
userProcessTokens as List
userProcessTokens = []
userProcessTokens = GetUserProcessTokensForUser(Username)
print "Processes for " + Username + ": " + userProcessTokens.Count
print "Attempting to impersonate: " + Username
Expand Down Expand Up @@ -531,7 +531,7 @@ public def GetCurrentProcessToken() as IntPtr:


public def EnableTokenPrivilege(ref hToken as IntPtr, Privilege as string) as bool:
Privileges as List = ["SeAssignPrimaryTokenPrivilege",
Privileges = ["SeAssignPrimaryTokenPrivilege",
"SeAuditPrivilege", "SeBackupPrivilege", "SeChangeNotifyPrivilege", "SeCreateGlobalPrivilege",
"SeCreatePagefilePrivilege", "SeCreatePermanentPrivilege", "SeCreateSymbolicLinkPrivilege",
"SeCreateTokenPrivilege", "SeDebugPrivilege", "SeEnableDelegationPrivilege",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static def CheckModifiableAccess(Path as string) as bool:
// TODO: check if file exists, check file's parent folder

// rights that signify modiable access
ModifyRights as List = [
ModifyRights = [
FileSystemRights.ChangePermissions,
FileSystemRights.FullControl,
FileSystemRights.Modify,
Expand All @@ -45,7 +45,7 @@ public static def CheckModifiableAccess(Path as string) as bool:
FileSystemRights.CreateFiles
]

paths as List = [Path]
paths = [Path]

try:
attr as FileAttributes = System.IO.File.GetAttributes(Path)
Expand Down Expand Up @@ -83,7 +83,7 @@ public static def GetRegValue(path as string, value as string) as string:
public static def GetModifiableRegistryAutoRuns() as void:
print "\r\n=== Modifiable Registry Autoruns ===\r\n"

autorunLocations as List = [
autorunLocations = [
"SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run",
"SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\RunOnce",
"SOFTWARE\\\\Wow6432Node\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static def CheckModifiableAccess(Path as string) as bool:
// TODO: check if file exists, check file's parent folder

// rights that signify modiable access
ModifyRights as List = [
ModifyRights = [
FileSystemRights.ChangePermissions,
FileSystemRights.FullControl,
FileSystemRights.Modify,
Expand All @@ -45,7 +45,7 @@ public static def CheckModifiableAccess(Path as string) as bool:
FileSystemRights.CreateFiles
]

paths as List = [Path]
paths = [Path]

try:
attr as FileAttributes = System.IO.File.GetAttributes(Path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static def GetModifiableServiceRegistry() as void:

// rights that signify modifiable access
// https://docs.microsoft.com/fr-fr/dotnet/api/system.security.accesscontrol.registryrights?view=netframework-4.8
ModifyRights as List = [RegistryRights.ChangePermissions, RegistryRights.FullControl, RegistryRights.TakeOwnership, RegistryRights.SetValue, RegistryRights.WriteKey]
ModifyRights = [RegistryRights.ChangePermissions, RegistryRights.FullControl, RegistryRights.TakeOwnership, RegistryRights.SetValue, RegistryRights.WriteKey]

print "\r\n=== Modifiable Registry Services ===\r\n"

Expand Down
4 changes: 2 additions & 2 deletions silenttrinity/core/teamserver/modules/boo/src/pathhijack.boo
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static def CheckModifiableAccess(Path as string) as bool:
// TODO: check if file exists, check file's parent folder

// rights that signify modiable access
ModifyRights as List = [
ModifyRights = [
FileSystemRights.ChangePermissions,
FileSystemRights.FullControl,
FileSystemRights.Modify,
Expand All @@ -53,7 +53,7 @@ public static def CheckModifiableAccess(Path as string) as bool:
FileSystemRights.CreateFiles
]

paths as List = [Path]
paths = [Path]

try:
attr as FileAttributes = System.IO.File.GetAttributes(Path)
Expand Down
Loading