login-script

Login on password prompt in linux through perl script

萝らか妹 提交于 2021-02-10 05:49:09
问题 I want to pass a password through a Perl script. I am basically writing a script to execute commands on Linux terminal. At a particular commands execution, I get a prompt for Password :← (I need to enter password here through my script) But, my script just stops working. After browsing, I found Expect but I get an error saying: Can't locate Expect.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) I have not used Expect before so have no clue what do I need to install. 回答1: Expect.pm

PHP Login system hard coded username and password

可紊 提交于 2021-02-05 09:32:08
问题 I had to do a basic login system to protect a page, and I have no access to database so i store the username and password hard coded in php page. My question is, can this login system hold againts an attack? I need it to hold about 1 month. Any sugestions to improve will be helpefull. The code is not in laravel, even if it might look like. The username and password, will be changed to something stronger of course. Thank you in advance. <?php class UserController { private $username; private

.htaccess login and redirect based on username and password

夙愿已清 提交于 2021-01-27 21:59:25
问题 Been searching around for a .htaccess code but I just couldn't find the right one. I have a website which is password protected by .htaccess. What I need now is to redirect users (after they login) based on their username and password. ie. user1 with password:xxx would be redirected to mysite.com/page1, user2 with password:xxx would be redirected to mysite.com/page2 and user3 with password:xxx would be redirected to mysite.com/page3 Can this be done with .htaccess and if so, what the code

destroy session after user is deleted but still logged in

半世苍凉 提交于 2020-01-14 14:55:09
问题 In the login.php i check if everething is ok and if its i creat the session and redirect the user $success = $dbh->prepare("SELECT UserId FROM users WHERE username =:username AND password=:password"); $success->bindParam(':username', $username); $success->bindParam(':password', $password); $success->execute(); $rowSuccess = $success->fetch(); $user_id = $rowSuccess['userid']; $_SESSION['user_id'] = $user_id; $_SESSION['loggedIn'] = 1; So how to destroy the user session when i delete him if he

Python Login Script; multiple passwords per account

亡梦爱人 提交于 2020-01-06 14:42:07
问题 I've asked a question similar and can be found here: Python Login Script; Usernames and Passwords in a separate file However, I'm now looking to extend the script so that it can look at multiple passwords per user account in the text file and know that the first password is the legitimate password while any other specified password linked to that account will throw up an error message. So right now the external username file is set up so that its: Admin:AdminPW Now I'm looking to extend it to

How to make PHP errors in text instead of HTML [duplicate]

无人久伴 提交于 2019-12-30 05:38:07
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How can I tell PHP to dump exceptions as raw text instead of HTML? I am trying to make a login script using C# and php and I plan on selling it as a 1 click install so I need it to be error proof. I am purposely trying to make mistakes in the setup, but whenever my php script has a mistake it has an HTML block output with the error when I just want a string output(refer to image). Heres the code I am using // We

PHP Login System ~ session.register and session.start errors

流过昼夜 提交于 2019-12-25 05:09:18
问题 I'm newish to php and i'm trying to use a login system here: <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form action="/?module=admin&n=checklogin" method="post" enctype="multipart/form-data" name="form1" id="form1"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Administrator Login </strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width=

php login script - remember me

最后都变了- 提交于 2019-12-24 19:17:40
问题 Can anyone see anything wrong with this login script: public function login($username, $pass, $remember) { // check username and password with db // else throw exception $connect = new connect(); $conn = $connect->login_connect(); // check username and password $result = $conn->query("select * from login where username='".$username."' and password=sha1('".$pass."')"); if (!$result) { throw new depException('Incorrect username and password combination. Please try again.'); } else { echo

TCL / Expect Scripting - Using a conditional statement to attempt a secondary login password

陌路散爱 提交于 2019-12-24 08:55:46
问题 I am very close to finish a TCL/TK app that logs into a Cisco Access Point via a serial connection (RS232} and gives it an IP address (very basic) However, I would like my script to attempt a secondary password if the first one fails This is how the Cisco CLI behaves with a serial connection when the incorrect password is entered 3 times (No User Name is needed, only prompts for a password) Password: Password: Password: % Bad secrets Again, if the default password of "Cisco" does not work, I

Python : Problems getting past the login page of an .aspx site

旧城冷巷雨未停 提交于 2019-12-23 18:24:30
问题 Problem: I have searched several websites/blogs/etc to find a solution but did not get to what I was looking for. The problem in short, is that I would like to scrape a site - but to get to that site - I have to get past the login page. What I did: I did manage to use urllib2 and httplib to open the page, but even after logging in (no errors being displayed) the redirection of the login page as shown in the browser does not happen. My code was not too different than what was displayed here: