North

[RELASE] Multiple login saver

23 posts in this topic

Hello,

Today I wanted to share with you something that I made quite some time ago that might turn useful to somebody.
The package was made without putting too much effort into it so if you find anything that might be off please notify me and I will update it.

The script does some basic encryption and saves the encryption key into your win registry so the decrypt works only on your machine, this doesn't mean that this is somehow secure, it's just the way I did it.

How it works

2soeyr.gif

 

 



-----------------------------


DL (Mega) : https://mega.nz/#!5J4VRKAT!HYUwf_5tfyrpucJR0R46v3giatqsca6_hug0WZqRn5k

If you need the extra compiled libs, here you go: https://mega.nz/#!1RQxjC4R!bqDsc9ivLDofI_7lF3g-B23OHxwc_Dz6XkTl2URR1NE

...I will also relase my other stuff, when I will find it...

  • Like 5
  • Thanks 1

Share this post


Link to post
Share on other sites

Hello, i have a problem:

 

0208 16:59:00478 :: Traceback (most recent call last):

0208 16:59:00478 ::   File "introLogo.py", line 60, in OnUpdate

0208 16:59:00478 ::   File "networkModule.py", line 177, in SetLoginPhase

0208 16:59:00478 ::   File "system.py", line 130, in __pack_import

0208 16:59:00478 ::   File "system.py", line 110, in _process_result

0208 16:59:00478 ::   File "introLogin.py", line 19, in <module>

0208 16:59:00478 ::   File "system.py", line 130, in __pack_import

0208 16:59:00478 ::   File "system.py", line 110, in _process_result

0208 16:59:00478 ::   File "uiSelectCredentials.py", line 5, in <module>

0208 16:59:00478 ::   File "system.py", line 130, in __pack_import

0208 16:59:00479 ::   File "system.py", line 110, in _process_result

0208 16:59:00479 ::   File "intrologin.py", line 20, in <module>

0208 16:59:00479 ::   File "system.py", line 137, in __pack_import

0208 16:59:00479 ::   File "base64.py", line 8, in <module>

0208 16:59:00479 ::   File "system.py", line 137, in __pack_import

0208 16:59:00479 :: ImportError
0208 16:59:00479 :: : 
0208 16:59:00479 :: Bad magic number in C:\Users\Noel\Desktop\Jelenlegi_HU_kliens\lib\re.pyc
0208 16:59:00479 :: 

 

you can help me?

Share this post


Link to post
Share on other sites

Nice idea, but I'd use crypt.triple_des, for save data, like:

# write
open(fileName, 'wb').write((crypt.triple_des(unhex(your_hex_str))).encrypt(cPickle.dumps({'userID': userID, 'userPassword': userPassword}), ' '))
# read
self.loginDataDict = cPickle.loads((crypt.triple_des(unhex(your_hex_str))).decrypt(open(fileName, "rb").read(), ' '))

 

  • Thanks 1

Share this post


Link to post
Share on other sites

 

2 hours ago, Noel said:

Hello, i have a problem:

 

0208 16:59:00478 :: Traceback (most recent call last):

0208 16:59:00478 ::   File "introLogo.py", line 60, in OnUpdate

0208 16:59:00478 ::   File "networkModule.py", line 177, in SetLoginPhase

0208 16:59:00478 ::   File "system.py", line 130, in __pack_import

0208 16:59:00478 ::   File "system.py", line 110, in _process_result

0208 16:59:00478 ::   File "introLogin.py", line 19, in <module>

0208 16:59:00478 ::   File "system.py", line 130, in __pack_import

0208 16:59:00478 ::   File "system.py", line 110, in _process_result

0208 16:59:00478 ::   File "uiSelectCredentials.py", line 5, in <module>

0208 16:59:00478 ::   File "system.py", line 130, in __pack_import

0208 16:59:00479 ::   File "system.py", line 110, in _process_result

0208 16:59:00479 ::   File "intrologin.py", line 20, in <module>

0208 16:59:00479 ::   File "system.py", line 137, in __pack_import

0208 16:59:00479 ::   File "base64.py", line 8, in <module>

0208 16:59:00479 ::   File "system.py", line 137, in __pack_import

0208 16:59:00479 :: ImportError
0208 16:59:00479 :: : 
0208 16:59:00479 :: Bad magic number in C:\Users\Noel\Desktop\Jelenlegi_HU_kliens\lib\re.pyc
0208 16:59:00479 :: 

 

you can help me?

Bad magic number seems to be because the pyc file mismatches with your python version.

Check your python version, I took these libraries from python27 . You can download the correct python version from the official website and you will have the libs by adding them if needed with pip. The version is listed in the properties of your python dll.

Re.pyc seems odd though, I did not use it my script but maybe it got upset because of the extra libs.

Good idea @VegaS™, with some goodwill on my side I will eventually update the package but any help beforehand by anybody who wants to rewrite that part is welcome

  • Like 1

Share this post


Link to post
Share on other sites

Hi i get this error 

0219 00:01:19765 :: Traceback (most recent call last):

0219 00:01:19766 ::   File "ui.py", line 1023, in CallEvent

0219 00:01:19766 ::   File "ui.py", line 88, in __call__

0219 00:01:19766 ::   File "ui.py", line 70, in __call__

0219 00:01:19766 ::   File "introLogin.py", line 1438, in __OnClickSaveLoginButton

0219 00:01:19766 ::   File "introLogin.py", line 1431, in __ReadSavedPassword

0219 00:01:19766 ::   File "introLogin.py", line 1425, in __GeneratePassword

0219 00:01:19767 ::   File "introLogin.py", line 1421, in __GenerateRandomWord

0219 00:01:19767 :: NameError
0219 00:01:19767 :: : 
0219 00:01:19767 :: global name 'string' is not defined
0219 00:01:19767 :: 

0219 00:02:13189 :: Traceback (most recent call last):

0219 00:02:13189 ::   File "ui.py", line 1023, in CallEvent

0219 00:02:13189 ::   File "ui.py", line 88, in __call__

0219 00:02:13189 ::   File "ui.py", line 70, in __call__

0219 00:02:13189 ::   File "introLogin.py", line 1459, in __OnClickLoginAutoButton

0219 00:02:13190 ::   File "system.py", line 115, in open

0219 00:02:13190 :: IOError
0219 00:02:13190 :: : 
0219 00:02:13190 :: [Errno 2] No such file or directory: 'user//preferred'
0219 00:02:13190 :: 

0219 00:02:14113 :: Traceback (most recent call last):

0219 00:02:14113 ::   File "ui.py", line 1023, in CallEvent

0219 00:02:14113 ::   File "ui.py", line 88, in __call__

0219 00:02:14113 ::   File "ui.py", line 70, in __call__

0219 00:02:14113 ::   File "introLogin.py", line 1459, in __OnClickLoginAutoButton

0219 00:02:14113 ::   File "system.py", line 115, in open

0219 00:02:14113 :: IOError
0219 00:02:14113 :: : 
0219 00:02:14113 :: [Errno 2] No such file or directory: 'user//preferred'
0219 00:02:14113 :: 

0219 00:02:22279 :: Traceback (most recent call last):

0219 00:02:22279 ::   File "ui.py", line 1023, in CallEvent

0219 00:02:22280 ::   File "ui.py", line 88, in __call__

0219 00:02:22280 ::   File "ui.py", line 70, in __call__

0219 00:02:22280 ::   File "introLogin.py", line 1438, in __OnClickSaveLoginButton

0219 00:02:22280 ::   File "introLogin.py", line 1431, in __ReadSavedPassword

0219 00:02:22280 ::   File "introLogin.py", line 1425, in __GeneratePassword

0219 00:02:22280 ::   File "introLogin.py", line 1421, in __GenerateRandomWord

0219 00:02:22280 :: NameError
0219 00:02:22280 :: : 
0219 00:02:22280 :: global name 'string' is not defined
0219 00:02:22280 :: 

in cliente 

image.th.png

open but no save any password

 

Share this post


Link to post
Share on other sites

Hi! Nice save login, i tried it but it give me error in this line (syntax error, tabs are fine):

        return ''.join(random.choice(letters) for i in range(length))

Share this post


Link to post
Share on other sites
1 hour ago, VegaS™ said:

Did you tried to add imports at begin of file < introLogin.py?


import random, string

 

Hi Vegas! Yes!

Spoiler

YwnXe9c.png

Spoiler

vUH4pSV.png

 

Spoiler

hG7j1N2.png

tabs are ok, and i tried even with "".join (thinking it was '' fault) 
p.s: the line is 1052 (i added an import later)

and this is the .py

https://pastebin.com/3xZRuLb8

could be because i'm using python 2.2? I can't get it work with 2.2?

Share this post


Link to post
Share on other sites
1 hour ago, Aioria said:

could be because i'm using python 2.2? I can't get it work with 2.2?

I can't read your file because atm i'm at phone,  you're not using the same minor version of python interpreter, the pyc (compiled bytecode) module was compiled for example 2.7 vs. 2.2, but this can't be the real problem since you don't get Bad magic number.

1 hour ago, Aioria said:

vUH4pSV.png

So i assume your problem is with the sequence (sequence of the elements to be joined) from join method.
Basically there's a list comprehensions, list comprehensions provide a concise way to create lists.

new_list = []
for item in old_list:
    new_list.append(item)

You can obtain the same thing using list comprehension:

new_list = [item for item in old_list]

The list comprehension always returns a result list.

# Now
return ''.join(random.choice(letters) for i in range(length))
# After
return ''.join([random.choice(letters) for i in range(length)])

That's because python22 isn't so smart. (18 years ago)

  • Thanks 1

Share this post


Link to post
Share on other sites

😮 that's interesting, thank you! 
Anyway it did work for that issue, (thank you again), but now it gives me a new error and don't know where looking for cause it just print me this

Spoiler

vDQ1hdi.png

while in intrologin.py at 176 there is this:

Spoiler

aikjj26.png

and a line 24 there are imports:

Spoiler

Joom4ov.png

I hate these errors, (I) never know where to look.

and at system.py 136:

Spoiler

d6XepuS.png

 

--- edit 1
Ok the issue is with the importing file in intrologin.py, but i don't know why, and mostly why syntax error and another error?

--- edit 2
I checked and probably there is another issue about python version in uiselectcredentials i think, am i wrong? 😮

--- edit 3
I think the issue is here:

	def __OnOK(self):
		selItem=self.fileListBox.GetSelectedItem()
		if selItem:
			if self.selectEvent:
				self.selectEvent(selItem.GetText())
			with open('user//preferred','w') as mainpg:
				mainpg.write("{};{}".format(selItem.GetText(),self.GetPwdFromId(selItem.GetText())) )
			self.__PopupMessage("Account name {} selected.".format(selItem.GetText()))
			self.Hide()
		else:
			self.__PopupMessage("You did not select any account.")

 but i don't know, i though it was the double slash / / in "with open" but stil gives me syntax error

ok I'm pretty sure (but i could be wrong) that it's this lines fault:

			with open('user//preferred','w') as mainpg:
				mainpg.write("{};{}".format(selItem.GetText(),self.GetPwdFromId(selItem.GetText())))

but how make them work in python 2.2? 😮

ok probably i'm wrong but i'm trying in this way

				mainpg = open("user//preferred", "w")
				mainpg.write("{};{}".format(selItem.GetText(),self.GetPwdFromId(selItem.GetText())))

but now i have to fight against bad magic number, and can't fine base64 for python 2.2 😧

--- edit idon'trememberthenumber

Ok base64 is the only .pyc for python 2.2 i found, missing random.pyc, struct.pyc, hashlib.pyc  and _winreg.pyc 

Share this post


Link to post
Share on other sites

How can i use the keys f1, f2, f3, f4 for choosing the saved account data? Would be amazing if someone help 

Share this post


Link to post
Share on other sites
On 4/25/2019 at 1:01 PM, Aioria said:

😮 that's interesting, thank you! 
Anyway it did work for that issue, (thank you again), but now it gives me a new error and don't know where looking for cause it just print me this 

  Reveal hidden contents

vDQ1hdi.png

while in intrologin.py at 176 there is this:

  Reveal hidden contents

aikjj26.png

and a line 24 there are imports:

  Reveal hidden contents

Joom4ov.png

I hate these errors, (I) never know where to look.

and at system.py 136:

  Reveal hidden contents

d6XepuS.png

 

--- edit 1
Ok the issue is with the importing file in intrologin.py, but i don't know why, and mostly why syntax error and another error?

--- edit 2
I checked and probably there is another issue about python version in uiselectcredentials i think, am i wrong? 😮

--- edit 3
I think the issue is here:


	def __OnOK(self):
		selItem=self.fileListBox.GetSelectedItem()
		if selItem:
			if self.selectEvent:
				self.selectEvent(selItem.GetText())
			with open('user//preferred','w') as mainpg:
				mainpg.write("{};{}".format(selItem.GetText(),self.GetPwdFromId(selItem.GetText())) )
			self.__PopupMessage("Account name {} selected.".format(selItem.GetText()))
			self.Hide()
		else:
			self.__PopupMessage("You did not select any account.")

 but i don't know, i though it was the double slash / / in "with open" but stil gives me syntax error 

ok I'm pretty sure (but i could be wrong) that it's this lines fault: 


			with open('user//preferred','w') as mainpg:
				mainpg.write("{};{}".format(selItem.GetText(),self.GetPwdFromId(selItem.GetText())))

but how make them work in python 2.2? 😮

ok probably i'm wrong but i'm trying in this way


				mainpg = open("user//preferred", "w")
				mainpg.write("{};{}".format(selItem.GetText(),self.GetPwdFromId(selItem.GetText())))

but now i have to fight against bad magic number, and can't fine base64 for python 2.2 😧

--- edit idon'trememberthenumber

Ok base64 is the only .pyc for python 2.2 i found, missing random.pyc, struct.pyc, hashlib.pyc  and _winreg.pyc  

https://www.python.org/download/releases/2.2/

No idea if you still need help but to answer the last part:

Just download python from the official website and you can get the libs from there, most of them should be already inside the installation folder but if not, follow this: http://effbot.org/pyfaq/how-do-i-create-a-pyc-file.htm

 

If you have syntax errors try to not use with open instead use `mainpg = open('user//preferred', 'w')` instead, remember to `mainpg.close()` if you use this method, also .format() was not a thing yet if I recall correctly, you should use other kind of string formatting (https://docs.python.org/2.2/lib/typesseq-strings.html)

21 hours ago, Syriza said:

How can i use the keys f1, f2, f3, f4 for choosing the saved account data? Would be amazing if someone help  

You should bind them to the index of the list you get printed in the interface, probably usin try except since the list index might not exist (empty slots).

It's not much work but I haven't got any working environment at the moment where I could write this, I stopped doing stuff for metin2 at least for now

  • Like 1

Share this post


Link to post
Share on other sites
On 4/29/2019 at 12:16 AM, Syriza said:

How can i use the keys f1, f2, f3, f4 for choosing the saved account data? Would be amazing if someone help 

Something I wrote in a hurry.

  • introLogin.py (add it to the end of the lines)
	def OnKeyDown(self, key):
		''' A fast method to login by keyboard shortcuts. '''
		
		# Create a keyboard range enum as tuple from F1 to F4.
		dikAvailableList = range(0x3B, 0x3E + 1)
		if not key in dikAvailableList:
			return

		try:
			# Creates a file object, which would be utilized to call other support methods associated with it.
			# Change old_open method with open if you get error.
			file = old_open('user//credentials', 'r')

			try:
				# Finds the given element in a list and returns its position.
				account_index = dikAvailableList.index(key)
				# Reads until EOF using readline() and returns a list containing the lines.
				account_data = file.readlines().__getitem__(account_index)
				# Returns a list of all the words in the string, using str as the separator.
				account_data = account_data.split(':')
				# Applies a function to all the items in an input list.
				account_data = map(lambda item: item.rstrip(), account_data)
				# Decode the password.
				account_data[-1] = self.decode(self.__ReadSavedPassword(), next(reversed(account_data)))

				# Connect to the server by using list [id, pw].
				self.Connect(*account_data)
			# Raised when a sequence subscript is out of range.
			except IndexError:
				pass

			# A closed file cannot be read or written any more.
			file.close()
		# Raised when an I/O operation fails for an I/O-related reason, e.g., “file not found” or “disk full”.
		except IOError:
			return

 

  • Like 1
  • Thanks 3
  • Haha 1

Share this post


Link to post
Share on other sites

Your a true god thank you !

 

Edit: i added onkeydown at the end of the lines but it doesnt work, i do not understand much with python do i have to call it? @VegaS™

Share this post


Link to post
Share on other sites

Thank you for your work, but it only works if the Password is not hashed.

example:

admin:dev works

but this Login saver does not save the account data like this, it saves like this:

admin:3tjs

 

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.