hi all,

I need to implement functionality like how can i retrieve registered user's entered username and password for any website? and after that i want to save userid and password in some text,word file.

Any code/link is there then help me ASAP. help would be appreciated.

Thanks,
KK

Dani AI

Generated

Brief answer up front: if you do not administer the site or have explicit, written authorization from its owner, you must not try to “retrieve registered users’ username and password for any website.” That is unlawful and could be prosecuted. As warned, this is not a legitimate task unless you are the site owner or you have clear user consent. (justice.gov)

If you run the site in question (or are building one), you can read usernames from your database but you must never store or export plaintext passwords. Modern guidance says verifiers should store salted, one‑way password hashes (and support algorithm/version metadata so you can migrate later). Never produce a plaintext password export — provide a secure password‑reset flow instead and let users export their profile data without secrets. (pages.nist.gov)

From an implementation point of view (answers from and are on the right track asking what you control): do not build SQL with string concatenation (that is vulnerable to SQL injection and credential theft). Use parameterized queries or an ORM, and use the framework’s vetted password APIs rather than rolling your own crypto. In .NET, prefer ASP.NET Core Identity / PasswordHasher or a vetted KDF (Argon2 / PBKDF2 / bcrypt) and store only the salted hash+metadata. (cheatsheetseries.owasp.org)

Minimal .NET example (verify on login — do not export the plain password):

var hasher = new PasswordHasher<ApplicationUser>();
string hash = hasher.HashPassword(user, plainPassword);
var result = hasher.VerifyHashedPassword(user, hash, suppliedPassword);
if (result == PasswordVerificationResult.Success) { /* authenticated */ }

If you need to access another service on behalf of a user, use delegated auth (OAuth/OpenID Connect) so users grant consent instead of handing you passwords. (datatracker.ietf.org)

Summary: clarify whether you control the site, stop if you meant “any website” owned by others, and if you control it, switch to hashed passwords, parameterized queries, and standard libraries rather than exporting secrets.

Recommended Answers

All 4 Replies

I think you need to explain yourself better. Do you mean how to retrieve the login details from a database to confirm they are registered users? What do you mean by 'any website'? When you say you want to save it to a text file I can only guess you don't have access to the database where the information is stored, otherwise that would be irrelevant.

What have you tried?

First create a class file with access,oracle,or sql,
add data,data.sqlclient() namespace to the class and cs file both,
then add the following code in class file

{
public static bool match(string s)
        {
            //to match record or data
            SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True");
            SqlCommand cmd = new SqlCommand(s, con);
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            int a = 0;
            a=adp.Fill(ds);
            if (a == 0)
                return false;
            else
                return true;
}
        }

then in the cs file code the following:

 string str = "select * from voter_reg where uid='" + TextBox1.Text + "' and password='" + TextBox2.Text + "'";
            if (Class1.match(str) == true)
            {
                string str1= "select applicant_no from voter_reg where uid='" + TextBox1.Text + "'";
                Session["app_no"] = Class1.str(str1); 
                Response.Redirect("Default3.aspx?u=" + TextBox1.Text);
            }
            else
            {
                Response.Write("Invalid user id /password");

            }
        }

I have used the username as Applicant name in voter reg system,u can show it any text or label in the next page....

Hope u get it clear....

Mr krunalkakadia,

there is no code for anyone to get username and password of a person from any website unless you are some hacker or something. But there some access points to get access to the person id of his/her particular profile. e.g: email access. from here you can get users all contacts of friends but only if user insert by self the username & password.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.