Jump to content
  • 0

How to parse passwords to log in to the script


h1neky
 Share

Question

Hello everyone, I came across a great script to make a password for the script 

local Passwords = {"4257"}
local Menu = gg.prompt({"Password: "},nil,{"text"})
if not Menu then return end
for l , I in pairs(Passwords) do
if Menu[1] == I then A = true end
end
if A ~= true then gg.alert("️ Incorrect password entered") return else gg.alert(" You have successfully entered the script!") end

Tell me how to make the Passwords variable take passwords from a text document located on the site 

Website with passwords https://hinsite.ga/passwords.txt [not ad]

 

I apologize in advance for the way I write in English. I am Belarus 

Edited by h1neky
Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0
1 hour ago, h1neky said:

Hello everyone, I came across a great script to make a password for the script 

local Passwords = {"4257"}
local Menu = gg.prompt({"Password: "},nil,{"text"})
if not Menu then return end
for l , I in pairs(Passwords) do
if Menu[1] == I then A = true end
end
if A ~= true then gg.alert("️ Incorrect password entered") return else gg.alert(" You have successfully entered the script!") end

Tell me how to make the Passwords variable take passwords from a text document located on the site 

Website with passwords https://hinsite.ga/passwords.txt [not ad]

 

I apologize in advance for the way I write in English. I am Belarus 

Do you mean to take password from txt In website and equals this passwords to the user input?

If you want do this it's can be done with php easily

Link to comment
Share on other sites

  • 0
32 minutes ago, MANDO01 said:

Вы имеете в виду взять пароль из txt на веб-сайте и приравнять этот пароль к вводу пользователя?

Если вы хотите сделать это, это можно легко сделать с помощью php.

Yes, please tell me how to do

Link to comment
Share on other sites

  • 0
35 minutes ago, MANDO01 said:

Do you mean to take password from txt In website and equals this passwords to the user input?

If you want do this it's can be done with php easily

I need that when entering a password, the script looked for whether there is a given password on the site and, if there is, activated the script

Link to comment
Share on other sites

  • 0
2 hours ago, h1neky said:

I need that when entering a password, the script looked for whether there is a given password on the site and, if there is, activated the script

The script 

local Menu = gg.prompt({"Password: "},nil,{"text"})
if not Menu then return end
Variable = "the php file link "
C = gg.makeRequest(Variable).content
pcall(load(C))
for i= 1,#pass do
if Menu[1] == pass[i] then
A = true
break
end
end
if A ~= true then gg.alert("️ Incorrect password entered") return else gg.alert("You have successfully entered the script!") end

The php file 

<?php
$FileName = "passwords.txt";
if (file_exists($FileName)){
$f = fopen($FileName,"r");
$r = fgets($f);
exit("pass = ".$r);
}
?>

The passwords file

{"mo","m1","m2","m3"}

And here is it it's done

Link to comment
Share on other sites

  • 0

Hi @h1neky, you can try to Parse the Password. Judging from the pattern of Spaces " " and Newlines "\n", you can split individual Password and stores them into a table for a later use. For this example, we want to compare the Table Keys with our Password Input. If the Key don't match with given Input or Empty, it will exit the Script instead. You can adjust this to your likings:

--Parsing uri
local passwords = {}
response = gg.makeRequest('https://hinsite.ga/passwords.txt').content --Getting the Password from the URI
for i in response:gmatch('[^\n% ]+') do --Split the Password based on Spaces (% ) and NewLines (\n)
	passwords[i] = true --Stores password into passwords table
end

--Password Input
local askPassword = gg.prompt({"Input your Password: "}, nil, {"text"}) --Ask user for Password
if not askPassword then --Check input is Empty then exit
	print("Password Empty")
	os.exit()
end
for key, value in pairs(passwords) do --Iterate passwords table
	if askPassword[1] == key then --If password exist in passwords, continue script
		print("Password Validated!")
		break
	else --Exit if don't exist
		print("Password Invalid")
		os.exit()
	end
end

--Do Stuff
Edited by MC189
Fixed space to tab
Link to comment
Share on other sites

  • 0
11 hours ago, MC189 said:

Привет@h1neky, вы можете попробовать разобрать пароль. Судя по шаблону пробелов " " и новых строк "\n", вы можете разделить отдельные пароли и сохранить их в таблице для последующего использования. В этом примере мы хотим сравнить ключи таблицы с нашим вводом пароля. Если ключ не совпадает с заданным вводом или пустым, вместо этого он выйдет из сценария. Вы можете настроить это по своему вкусу:


 
     



   
  

  
	  
		
	 
	


Hi, for some reason, only the first password 4257 works for me, and the others that do not work with each new line 

#Don't pay attention to the russian text 

Edited by h1neky
Link to comment
Share on other sites

  • 0

Hi @h1neky, I've fixed some bugs on the Parser and Itters. It's should work now:

for i in response:gmatch('[^\n% ]+') do
	passwords[i:gsub('[%c%s]', '')] = true --Fixed \r not trimmed, now the Parser will remove any blankspace
end

local askPassword = gg.prompt({"Input your Password: "}, nil, {"text"})
if not askPassword then
	print("Password Empty")
	os.exit()
end
for key, value in pairs(passwords) do
	if askPassword[1] == key then --Fixed Iteration only the first item by removing else statement
		print("Password Validated!")
		break
	end
end
Edited by MC189
Link to comment
Share on other sites

  • 0
19 hours ago, MC189 said:

Hi @h1neky, I've fixed some bugs on the Parser and Itters. It's should work now:

for i in response:gmatch('[^\n% ]+') do
	passwords[i:gsub('[%c%s]', '')] = true --Fixed \r not trimmed, now the Parser will remove any blankspace
end

local askPassword = gg.prompt({"Input your Password: "}, nil, {"text"})
if not askPassword then
	print("Password Empty")
	os.exit()
end
for key, value in pairs(passwords) do
	if askPassword[1] == key then --Fixed Iteration only the first item by removing else statement
		print("Password Validated!")
		break
	end
end

You code have some bugs

-- Create an empty table to store the passwords
local passwords = {}
-- Make a request to the password file and store the response content
local response = gg.makeRequest('http://thscriptgg.mygamesonline.org/work/passwords.txt'). contents 

if not response then
print("access to the internet is needed")
    os.exit()
end

-- Parse the response and store the passwords in the table
for password in response:gmatch('%S+') do
    passwords[password] = true
end
-- Ask the user for a password and trim any leading or trailing whitespace
local askPassword = gg.prompt({"Input your Password: "}, nil, {"text"})
if not askPassword or not askPassword[1] then -- Check if the input is empty
    print("Password Empty")
    os.exit()
end
local password = askPassword[1]:match('%S+') -- Trim leading/trailing whitespace from the input
-- Check if the input password matches any of the passwords in the table
if passwords[password] then
    print("Password is right!")
else
    print("Invalid Password!")
    os.exit()
end

You can see the passwords in the link 

Edited by MANDO01
Link to comment
Share on other sites

  • 0
12 hours ago, MANDO01 said:

You code have some bugs

-- Create an empty table to store the passwords
local passwords = {}
-- Make a request to the password file and store the response content
local response = gg.makeRequest('http://thscriptgg.mygamesonline.org/work/passwords.txt'). contents 

if not response then
print("access to the internet is needed")
    os.exit()
end

-- Parse the response and store the passwords in the table
for password in response:gmatch('%S+') do
    passwords[password] = true
end
-- Ask the user for a password and trim any leading or trailing whitespace
local askPassword = gg.prompt({"Input your Password: "}, nil, {"text"})
if not askPassword or not askPassword[1] then -- Check if the input is empty
    print("Password Empty")
    os.exit()
end
local password = askPassword[1]:match('%S+') -- Trim leading/trailing whitespace from the input
-- Check if the input password matches any of the passwords in the table
if passwords[password] then
    print("Password is right!")
else
    print("Invalid Password!")
    os.exit()
end

You can see the passwords in the link 

I changed the script to a working one yesterday 

local passwords = {}
response = gg.makeRequest('https://naebalovobrawlstars.tk/passwords.txt').content --Getting the Password from the URI
for i in response:gmatch('[^\n% ]+') do
  passwords[i] = true
end

local validate = false

--Password Input
local askPassword = gg.prompt({"Input key: "}, nil, {"text"})
if not askPassword then
  gg.alert("Password Empty")
  os.exit()
end
for key, value in pairs(passwords) do
  if askPassword[1] == key then
    gg.alert("Password Validate!")
    validate = true
    break
  end
end
if validate == false then 
    gg.alert("Password Wrong!")
    os.exit()
end

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.