need some assistance with gmod i have made a server and keep getting this error when i try to spawn entities - garrys-mod

[DarkRP] The spawning of scripted entities (SENTs) has been disabled! Please see the DarkRP settings.
ive set the setting
-- adminsents - Whether or not SENTs should be admin only. 0 = everyone, 1 = admin or higher, 2 = superadmin or higher, 3 = rcon only
GM.Config.adminsents = 2
so i sould be able to spawn them but it won't let me
im the server owner using a server pc
got superadmin and can spawn everything else except for SENTS (entities)

Related

Run a process as administrator from non admin user - local admin credentials

I have a Window 10 vb.net main process (tester) that needs to create a process to clean up certain registry area. The products we test have a single FTDI serial port adapter, but over time these instances build up and slow the registry to a crawl.
As the main process starts, the desire is to use an off the shelf utility, DeviceCleanupCmd.exe, to search and remove the driver instance build up. This requires administrator privileges for that sub process. I've been able to do this on XP with script, but the system is running with full administrator privileges. Since it's not on the network, there's very little risk.
Moving forward, we are trying to replace the XP system with a Windows 10 Enterprise box that is network connected. I wanted to incorporate the equivalent of the script into the vb.net process and I modified the vb.net application to use
Process() with StartInfo.Verb = "runas"
Local user credentials (not a domain user) the application provides to start the sub process.
Using this method, my sub process executes, but not with administrator level privileges. The Stackoverflow reference below explains that I can't use this method and have to use CreateProcessWithLogonW. I understand Ian Boyd's concerns for security in the post.
Run process as administrator from a non-admin application
I have followed the Microsoft implementation that follows and am still having issues.
https://learn.microsoft.com/en-us/troubleshoot/dotnet/visual-basic/start-process-as-another-user
Here's the essential part of my code. You will see that I truncated the MS example to use the W2K portion, as we won't be going back that far!
wUser = System.Text.Encoding.Default.GetString(UnicodeStringToBytes(UserName + Chr(0)))
wDomain = System.Text.Encoding.Default.GetString(UnicodeStringToBytes(DomainName + Chr(0)))
wPassword = System.Text.Encoding.Default.GetString(UnicodeStringToBytes(Password + Chr(0)))
wCommandLine = System.Text.Encoding.Default.GetString(UnicodeStringToBytes(CommandLine + Chr(0)))
wCurrentDir = System.Text.Encoding.Default.GetString(UnicodeStringToBytes(CurrentDirectory + Chr(0)))
Result = CreateProcessWithLogonW(wUser, wDomain, wPassword, CREATE_DEFAULT_ERROR_MODE, 0&, wCommandLine, CREATE_NEW_CONSOLE, 0&, wCurrentDir, si, pi)
If Result <> 0 Then
CloseHandle(pi.hThread)
CloseHandle(pi.hProcess)
W2KRunAsUser = 0
Else
W2KRunAsUser = Err.LastDllError
Status = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, CType(0&, IntPtr), W2KRunAsUser, 0, strMessage, Len(strMessage), 0)
MsgBox("CreateProcessWithLogonW() failed with error: " & W2KRunAsUser & " " & strMessage, vbExclamation)
End If
Please remember that my target administrator user is only resident on the PC I'm running the application on - not on the domain. I've verified that I can login with the credentials and run DeviceCleanupCmd.exe with success. In order to login locally, I must use a \ before the user. When I run the code, I've attempted the following, with the error message that Windows 10 supplies after the colon (:):
Providing "user", "password", and "domain" (I know it's not required): The directory name is invalid.
Providing "user", "password", and domain as "": The directory name is invalid.
Providing "\user", "password", and domain as "": The directory name is invalid.
Providing ".\user", "password", and domain as "": The stub received bad data.
Providing "user", "password", and domain as "computer name": The directory name is invalid.
Providing "non-admin user", "password", and "domain of user": DeviceCleanupCmd.exe runs but complains 'No admin privileges available'.
Because the application is complaining about an invalid directory name, I've purposely placed the DeviceCleanupCmd.exe in a C:\sub-directory that is not protected by Windows (Like Program Files). Attempt 6 above would seem to prove that there's not rights/access violations.
I have also tried CREATE_NEW_CONSOLE in place of CREATE_DEFAULT_ERROR_MODE and same results as above. I've proved the user is being decoded, as when I provide an incorrect password, I get "The user name or password is incorrect".
#Hurshey provided the insight to look at the Windows Task Scheduler and the following links support full configuring the task + incorporating the exported XML into NSIS - my target deployment method.
https://www.windowscentral.com/how-create-automated-task-using-task-scheduler-windows-10
https://nsis.sourceforge.io/Talk:Scheduled_Tasks

Watch OS 3 NSURLSession issue

I've implemented apple watch app to run independently, So all web services made in Watch itself. It seems to be working fine in watch OS 2 But When request made in watch OS 3 getting Status code as 401.
The flow would be :
1. Making login follwed by get detials web services request in iPhone and share login details to watch app to initiate same request in watch os.
Watch OS 1 & 2.x - No issues
Watch OS 3 - Getting sucess for Login request and 401 error for get details service call.
Please Note : There is no code change made for Watch OS 2 & 3 , also there is no session mangement handled in back end.
Any body facing same issues or any solution for this ? .
Finally got solution, after adding the below lines it worked for me.
if let httpResponse = response as? HTTPURLResponse, let fields = httpResponse.allHeaderFields as? [String : String] {
let cookies = HTTPCookie.cookies(withResponseHeaderFields: fields, for: response!.url!)
HTTPCookieStorage.shared.setCookies(cookies, for: response!.url!, mainDocumentURL: nil)
}
I presume Watch OS2 by default manages cookies but Watch OS3 not. So we manually have to store cookies it seems.

WAS 7.0 Create users and map role to users wtih wsadmin

I have a requirement to create userids and assign Admin role for some users and I am trying to do this through a Jython script as it will speed up the process and saves time.
So,I have created the below Jython script to achieve it.
Script
import sys
filename="C:\Users\harish\Desktop\scripts\input.txt"
fileread = open(filename, 'r')
filelines = fileread.readlines()
for row in filelines:
column=row.strip().split(';')
user_name=column[0]
print user_name
pass_word=column[1]
first=column[2]
last=column[3]
AdminTask.createUser(['-uid',user_name, '-password', pass_word, '-confirmPassword', pass_word, '- cn', first, '-sn', last ])
AdminTask.mapUsersToAdminRole(['-roleName','Administrator','-userids',user_name])
AdminConfig.save()
print 'Userid creation completed for', user_name
fileread.close()
The script runs fine and doesn't throw any errors.However, the users are not able to login to WAS Admin Console and they can only able to do it after I save the configuration by clicking "OK" at page "Users and Groups" -> "Administrative User Roles" ->
Can someone please let me know what am I missing here while working with wsadmin or is there anything else I need to do to accomplish the task ?
I am working on WAS 8.5.5.0 version.
Thanks for your help.
I think you need to add this code to the end of your script (not in the for-loop). This will refresh the security configuration.
agmBean = AdminControl.queryNames('type=AuthorizationGroupManager,process=dmgr,*')
AdminControl.invoke(agmBean, 'refreshAll')
This assumes you're using Network Deployment, process=dmgr. You may need to change the process.

How does logging in interactively to a Windows host effect WMI queries to that host?

I have an application that performs WMI queries on remote hosts. I'm attempting to define the minimal amount of security permissions required for the user used to do the queries.
I've defined a user with minimal permissions. I've found that this user has enough permissions to do the needed queries, but only if the same user is logged in interactively on the remote host.
For example, if I log in to the remote host with the nonadmin user (i.e. open a desktop on the remote host), the query select * from Win32_Environment returns 2 additional entries than if I'm not logged in. The 2 entries are:
instance of Win32_Environment
{
Caption = "COMP-BAF3244E\\nonadmin\\TEMP";
Description = "COMP-BAF3244E\\nonadmin\\TEMP";
Name = "TEMP";
Status = "OK";
SystemVariable = FALSE;
UserName = "COMP-BAF3244E\\nonadmin";
VariableValue = "%USERPROFILE%\\Local Settings\\Temp";
};
and
instance of Win32_Environment
{
Caption = "COMP-BAF3244E\\nonadmin\\TMP";
Description = "COMP-BAF3244E\\nonadmin\\TMP";
Name = "TMP";
Status = "OK";
SystemVariable = FALSE;
UserName = "COMP-BAF3244E\\nonadmin";
VariableValue = "%USERPROFILE%\\Local Settings\\Temp";
};
as seen in MOF representation in the wbemtest tool. The wbemtest connection is to \\remotehost\root\cimv2 as user nonadmin.
How does logging in to the remote host effect the results of the WMI query?
What permissions do I need to add to my user so that the additional information is available even when the remote user is not logged in?
The problem has to do with the user profile not being loaded unless the user has the correct rights.
The user profile not being loaded is also an issue for calling Win32_Process.Create. If the profile is not loaded then this will fail with UNKNOWN FAILURE (8).
Thanks to this blog post for pointing out the cause of the errors!
In order to have the user profile loaded automatically while during remote WMI access, give the user "Backup files and directories" and "Restore files and directories" user rights.
You can find the these rights policies at:
"Run..." --> secpol.msc --> Local Policies --> User Rights Assignment

Using Pgp.exe from a MVC application

I've been tasked with converting a legacy application to mvc. The app used pgp.exe to pgp sign user input and send it as an email. The application works locally and on a test server but won't run on a live server. I've had to jump though hoops such as running a specified user in the application pool so that we can set the keys in the users profile BUT it worked.
For some reason on the live server which is windows 2003 IIS 6 and identical to the testing server it fails. The problem is pgp.exe just wont seem to sign and create files the message I get from the console out put is. "Signature Error"?? When I put the command into a shell window logged in as the app pool user it runs no problem (after a fight with some permissions) but when running through the mvc application/IIS server it fails. The code used to call the process is below.
var startInfo = new ProcessStartInfo();
startInfo.FileName = _pgpexeLocation;
//startInfo.FileName = "pgp.exe";
startInfo.Arguments = string.Format("-sta \"{0}\" -u keyuser-z keypass +COMPATIBLE +FORCE", _tempFilePath);
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.LoadUserProfile = true;
using (Process exeProcess = Process.Start(startInfo))
{
// TODO: set limit to wait for and deal with exit
exeProcess.WaitForExit();
//var stringItem = exeProcess.StandardOutput.ReadToEnd();
//Logger.Info(stringItem);
}
I'm clutching at straws here hoping somebody has done something similar before and can help. I'm guessing it's key location or file location not being picked up somewhere but not sure what else to try?
Turns out that even though the app pool was using a specific user and I'd set the keys up in that users appdata folder when I checked the underlying process call it was actually trying to pick the keys up from the Default User profile. Not sure if this was an IIS config or something similar but moving the keys and pgp folder to this appdata instead worked?

Resources