PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: Cp6uja on 01 June, 2004, 14:13:53

Title: Get Password !!!
Post by: Cp6uja on 01 June, 2004, 14:13:53
Very GOOD Script !!!__________________________________________

-- simple standalone get-password-by-nick-bot by bonki 09/06/03

sBotName         = "PasswdBot";
sGetPasswdPhrase = "!getpasswd";
sPasswdFile      = "../RegisteredUsers.dat";

function DataArrival(curUser, sData)
  local _, _, cmd, args = strfind(sData, "%b<>%s+(%S+)%s*([^%|]*)%|$");

  if(cmd == nil) then
    return 0; end

  cmd = strlower(cmd);

  if (cmd == sGetPasswdPhrase) then
    curUser:SendData(sData);

    if (curUser.bOperator) then
      if (strlen(args) > 0) then
        local sPasswd = GetPassword(args);
        if (sPasswd) then
          curUser:SendData(sBotName, args.."'s password is: '"..sPasswd.."'");
        else
          curUser:SendData(sBotName, "User "..args.." doesn't exist!");
        end
      else
        curUser:SendData(sBotName, "Syntax: "..sGetPasswdPhrase.." ");
      end
    else
      curUser:SendData(sBotName, "You don't have sufficient rights to run that command!");
    end
    return 1;
  end

  return 0;
end

function GetPassword(sFrom)
  local flPasswdFile = openfile(sPasswdFile, "r");
  local line         = "";

  sFrom = strlower(sFrom);

  if (flPasswdFile) then
    line = read(flPasswdFile);
    while (line) do
      _, _, sNick, sPasswd = strfind(line, "^(%S+)|(%S+)|");
      if (strlower(sNick) == sFrom) then
        return sPasswd;
      end
      line = read(flPasswdFile);
    end
    closefile(flPasswdFile);
  end

  return nil;
end
Title:
Post by: NotRabidWombat on 01 June, 2004, 15:06:23
Why should operators have the right to see passwords of all users, including other operators, masters, etc?

-NotRabidWombat
Title:
Post by: Typhoon on 02 June, 2004, 22:04:32
i'm impressed of the resemblence with the same script Bonki made somt time ago....

-- simple standalone get-password-by-nick-bot by bonki 09/06/03

sBotName         = "PasswdBot";
sGetPasswdPhrase = "!getpasswd";
sPasswdFile      = "../RegisteredUsers.dat";

function DataArrival(curUser, sData)
  local _, _, cmd, args = strfind(sData, "%b<>%s+(%S+)%s*([^%|]*)%|$");

  if(cmd == nil) then
    return 0; end

  cmd = strlower(cmd);

  if (cmd == sGetPasswdPhrase) then
    curUser:SendData(sData);

    if (curUser.bOperator) then
      if (strlen(args) > 0) then
        local sPasswd = GetPassword(args);
        if (sPasswd) then
          curUser:SendData(sBotName, args.."'s password is: '"..sPasswd.."'");
        else
          curUser:SendData(sBotName, "User "..args.." doesn't exist!");
        end
      else
        curUser:SendData(sBotName, "Syntax: "..sGetPasswdPhrase.." ");
      end
    else
      curUser:SendData(sBotName, "You don't have sufficient rights to run that command!");
    end
    return 1;
  end

  return 0;
end

function GetPassword(sFrom)
  local flPasswdFile = openfile(sPasswdFile, "r");
  local line         = "";

  sFrom = strlower(sFrom);

  if (flPasswdFile) then
    line = read(flPasswdFile);
    while (line) do
      _, _, sNick, sPasswd = strfind(line, "^(%S+)|(%S+)|");
      if (strlower(sNick) == sFrom) then
        return sPasswd;
      end
      line = read(flPasswdFile);
    end
    closefile(flPasswdFile);
  end

  return nil;
end

*Typhoon?
Title: wow
Post by: Psycho_Chihuahua on 02 June, 2004, 22:44:26
ouch, that hit the spot right on
Title:
Post by: Optimus on 02 June, 2004, 22:58:24
Verry good Clone haha
Title:
Post by: Sudds on 03 June, 2004, 01:02:36
Wow the user who posted this does not just steal users and send out bad scripts but he also COPYS scripts and takes the credit 4 them.
Adds to my case he should be kicked off the forum.lol
Sudds
Title: WhY ?!
Post by: Cp6uja on 09 June, 2004, 22:42:05
Why "clone" Optimus ???
 :(
Title:
Post by: [NL]Pur on 09 June, 2004, 23:26:45
QuoteWhy should operators have the right to see passwords of all users, including other operators, masters, etc?

i don't see any reason for it. This is btw a weird thing normally admins can't see passwords of their users.