Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 69

Thread: Saving a variable client-side (persistently)

  1. #11
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by serthy View Post
    Sorry for beeing blind, but whats the difference to the one that is already used on alot of servers?
    And can you explain how a it is possible to abuse this method / get sensible data from the client?
    The difference is that it uses a challenge-response combination.

    It works as follows:

    Client creates an account, stores a loginname cvar and a randomized challenge cvar. Looks like this:
    Code:
    seta izno_challenge_bhwv95nfivapvr3r2co5z88m9tfk4t "openscriptmenu clientcmd chal_4delnmwge5n5qyl6o0tau9dfnwdmjj"
    seta izno_loginsystem "openscriptmenu clientcmd login_0tljzgz93cwhdm0fafixr8c9w2mrta"
    For now, lets replace this random numbers and shit with the following (for example sake):
    Code:
    seta izno_challenge_CHALLENGE"openscriptmenu clientcmd chal_RESPONSE"
    seta izno_loginsystem "openscriptmenu clientcmd login_USERNAME"
    So, server creates a USERNAME.txt file, in which both CHALLENGE and RESPONSE are stored.

    Next time a client connects to the server, the client executes the given .cfg file (atm it is izno_login.cfg), and the cvars are loaded.
    Now, the server tells the client to vstr izno_loginsystem, thus generating a menuresponse (clientcmd, login_USERNAME).
    The server now opens the USERNAME.txt file, looks for the challenge and does the following:
    [player] execclientcmd("vstr izno_challenge_CHALLENGE");

    From this, the client responds with the appropriate menuresponse that was stored in this randomized cvar (clientcmd, chal_RESPONSE).

    Now, the response given by the client should match the one on file at the server.

    The added layer of protection here is that the server has to KNOW which cvar the client has to execute, as it is randomized on a per-client basis, thus not allowing rogue admins to clone the serv and steal the login details directly.

    The security hole with this is, if the rogue admin gets the USERNAME, he can try to authenticate himself on the real server, which will require the CHALLENGE. As the admin can intercept this command, he can then modify his server to also request this data from the targetted client. This requires a lot of work for the rogue admin (as he has to mod his serv for every client he wants to hack), it is most likely not a feasible angle of attack. However, once in, no one can stop him.

  2. #12
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    I still dont get it how people can stole other peoples data with the code serthy wrote? Because its saved on the players pc, how are they able to get that data?

  3. #13
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    In the Hardware Bans thread Serthy posted the code:

    http://killtube.org/showthread.php?1...light=hardware
    PHP Code:
    player setClientCvar"autologin" "openscriptmenu login Serthy|unsafepass" ); //load this to script
    player setClientCvar"username" "Serthy" ); //showed on login menu
    player setClientCvar"password" "unsafepass" ); //showed on login menu
    player setClientCvar"autoexec" "vstr autologin" ); //autoexec executes on connect
    player execClientCommand"writeconfig save.cfg" ); //save the config clientside 
    The only thing an evil server admin needs to do:
    1) use the same fs_game as the server, which users shall be attacked (so you have the .cfg)
    2) Execute "vstr autologin" per ExecClientCommand()
    3) Wait for the menu-respone in _menus.gsc

    IzNoGod wanted to add a "secret" to the procedure, so an evil server admin doesn't have the name of the cvar, but an evil server admin just can emulate beeing a "normal login user" on the attacked server and get the secret cvar-name. There is no way to tell that a Client is the real client. Maybe somebody has Ideas how to fix that though.
    timescale 0.01

  4. #14
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Quote Originally Posted by IzNoGoD View Post

    Using this technique allows you to remotely save a username and password.
    [Not talking about the info stealing] So, using this technique you can set cvar values for players. I still don't understand, how exactly can the server use those values? I'm still trying to figure out a way to either use the value of a player's cvar to disconnect a banned player depending on the value of that cvar (which I was told is not possible), or to simply write disconnect in a .cfg file that will later be executed by a banned player.
    Last edited by guiismiti; 3rd January 2014 at 01:27.
    set logfile 2

  5. #15
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    You see how values in cvars can be submitted to server one post above your question ^^
    timescale 0.01

  6. #16
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Quote Originally Posted by kung foo man View Post
    You see how values in cvars can be submitted to server one post above your question ^^
    Looks like I got some reading to do
    set logfile 2

  7. #17
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Has anybody tried to implement a weapon unlock system? Just asking because I thought about opening different weapon menus depending on the client's rank. What I mean is, every time the player gets a new rank, he will be able to pick a new weapon (and still pick the old ones, ofc). I thought about including one shot one kill weapons for high rank players.
    Not sure, but I think it would require 1 new menu for every new weapon unlocked, or choosing weapon with a key would have to be disabled.
    set logfile 2

  8. #18
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    just look in _menus.gsc and add some restrictions

  9. The Following User Says Thank You to Ni3ls For This Useful Post:

    guiismiti (8th January 2014)

  10. #19
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Just take a look at my cod4mod ( www.iznogod.tweak.nl/CoD4MoD.rar ) for reference.

    Dont reuse the code, its old and can be improved very much.

  11. The Following User Says Thank You to IzNoGoD For This Useful Post:

    guiismiti (8th January 2014)

  12. #20
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    I will whenever I have time again, thank you.
    set logfile 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •