Author Topic: Change /etc/shadow password interest?  (Read 51558 times)

Offline SViRU

  • Jr. Member
  • **
  • Posts: 20
Re: Change /etc/shadow password interest?
« Reply #15 on: September 26, 2006, 10:12:00 AM »
Plugin is the best, thx :)

Offline kali

  • Jr. Member
  • **
  • Posts: 57
Re: Change /etc/shadow password interest?
« Reply #16 on: September 29, 2006, 12:40:55 AM »
Quote from: ViRUS
Plugin is the best, thx :)

Thanks!  8)

Feedback, suggestions welcome. It's working very well for me - and is quite easy. I also intend to keep the cgi current for RC and continue to host it.

Offline Heritz

  • Jr. Member
  • **
  • Posts: 58
Re: Change /etc/shadow password interest?
« Reply #17 on: September 29, 2006, 09:51:27 AM »
Well guys,

I just tried the kali's plugin and it didn't work in my cPanel installation. So I decided to make a plugin for my cPanel installation and it's working as hell at this moment. I expect to publish the plugin this weekend so all the cPanel users can have this change password utility.

Its based on CURL. Regards,
Heritz

Offline kali

  • Jr. Member
  • **
  • Posts: 57
Re: Change /etc/shadow password interest?
« Reply #18 on: September 29, 2006, 02:54:11 PM »
Heritz -- in all fairness to this plugin, your users are not stored in /etc/passwd or /etc/shadow (see title of thread). Just as this plugin will not work with ldap user databases...

Offline Heritz

  • Jr. Member
  • **
  • Posts: 58
Re: Change /etc/shadow password interest?
« Reply #19 on: September 29, 2006, 03:09:46 PM »
Yeah, but I just made a plugin for cPanel installations since cPanel installations store all the passwords in different directories.
Heritz

Offline AzBlk

  • Jr. Member
  • **
  • Posts: 10
Re: Change /etc/shadow password interest?
« Reply #20 on: October 04, 2006, 04:01:29 PM »
Quote from: Heritz
Yeah, but I just made a plugin for cPanel installations since cPanel installations store all the passwords in different directories.
Are you willing to share to sahre this plugin? There alot of cpanel people outthere that are interested in this.

Offline Heritz

  • Jr. Member
  • **
  • Posts: 58
Re: Change /etc/shadow password interest?
« Reply #21 on: October 04, 2006, 06:20:58 PM »
Yes, I will publish the plugin. I am trying to find the best way to make it "easy" to install.
Heritz

Offline Heritz

  • Jr. Member
  • **
  • Posts: 58
Re: Change /etc/shadow password interest?
« Reply #22 on: October 04, 2006, 08:21:17 PM »
Do you guys know how to generate a unix patch file? I mean, those with lots of ++++++++++ and stuff? Would be easier for me to generate a patch file like that.

The cPanel patch is very similar to the "pretty change password" patch published in this forum, there is just a difference in the core files.
Heritz

Offline AzBlk

  • Jr. Member
  • **
  • Posts: 10
Re: Change /etc/shadow password interest?
« Reply #23 on: October 04, 2006, 10:28:05 PM »
Quote from: Heritz
Do you guys know how to generate a unix patch file? I mean, those with lots of ++++++++++ and stuff? Would be easier for me to generate a patch file like that.

The cPanel patch is very similar to the "pretty change password" patch published in this forum, there is just a difference in the core files.

Personally I think the way go to is provide the modified files plus instructions of where these need to be uploaded to. Or to provide a patched version where user only has to change thier config files. thanks..that my2cents

Offline Heritz

  • Jr. Member
  • **
  • Posts: 58
Re: Change /etc/shadow password interest?
« Reply #24 on: October 04, 2006, 10:54:00 PM »
Ok, perfect. Working on it.
Heritz

Offline AzBlk

  • Jr. Member
  • **
  • Posts: 10
Re: Change /etc/shadow password interest?
« Reply #25 on: October 05, 2006, 06:15:25 AM »
Quote from: Heritz
Ok, perfect. Working on it.
:'( waiting anxiously for this mode..after the remote email account creation mod this is the mod that has been missing in RC

Offline Heritz

  • Jr. Member
  • **
  • Posts: 58
Re: Change /etc/shadow password interest?
« Reply #26 on: October 05, 2006, 08:33:00 AM »
Do you have SSH access to your cPanel server? can you please check if you have this file in your server?

/usr/local/cpanel/base/dowebmailpasswd.cgi

This file comes with all the cPanel installations. And its needed to install the plugin. I just want to be sure if you have it as I do.
Heritz

Offline AzBlk

  • Jr. Member
  • **
  • Posts: 10
Re: Change /etc/shadow password interest?
« Reply #27 on: October 05, 2006, 05:19:37 PM »
Quote from: Heritz
Do you have SSH access to your cPanel server? can you please check if you have this file in your server?

/usr/local/cpanel/base/dowebmailpasswd.cgi

This file comes with all the cPanel installations. And its needed to install the plugin. I just want to be sure if you have it as I do.
I am hosted on site5 with a shared server and I could not find the file in sitemanager or by ftp. I have requested shell access but I have no idea how to use that thing. However I have a piece of code that might be help you write this plugin for even those that do not have shell access.It works by logining into cpanel and then changing password and closing file. It can be amde to redirect to inbox or wherever.
Changepass.php-- just a form.
Code: [Select]
<?php //changepass.php?>

<style type=&quot;text/css&quot;>
td
{
color: #014D5F;
}
</style>
<table cellpadding=&quot;2&quot; cellspacing=&quot;2&quot; border=&quot;0&quot; align=&quot;center&quot;>
<tr><td> Change Password</td></tr>

</table>
<form name=&quot;emsignup&quot; method=&quot;POST&quot; action=&quot;cppass.php&quot; autocomplete=&quot;off&quot;>
<table cellpadding=&quot;5&quot; cellspacing=&quot;2&quot; border=&quot;0&quot; align=&quot;center&quot;>

</td>
</tr>
<tr>
<td bgcolor=&quot;#DDDDDD&quot;>User Name: </td><td bgcolor=&quot;#DDDDDD&quot;><input type=&quot;text&quot; name=&quot;NewEmail&quot;> </td>
</tr>
<tr>
<td bgcolor=&quot;#DDDDDD&quot;>New Password: </td><td bgcolor=&quot;#DDDDDD&quot;><input type=&quot;text&quot; name=&quot;Password&quot;></td>
</tr>

<tr>
<td colspan=&quot;2&quot;><input type=&quot;submit&quot; value=&quot;Change&quot; class=&quot;button&quot;></td>
</tr>
</table>

</form>

The guts:
Code: [Select]
cppass.php
//cppass.php


// cPanel info
$cpuser = 'username'; // cPanel username
$cppass = 'password'; // cPanel password
$cpdomain = 'domain.com'; // cPanel domain or IP
$cpskin = 'skin'; // cPanel skin. Mostly x or x2, na4 etc
$edomain = 'domain.com'; // email domain (usually same as cPanel domain above)


$euser = $_POST['NewEmail'];
$epass = $_POST['Password'];
if ( $euser == "" OR $epass == "" ) {
$ermsg = "All fields of the form must be completed.";
}


###############################################################
# END OF SETTINGS
###############################################################





// change password of entered email account
$f = fopen ("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/poppasswordchanged.html?email=$euser&domain=$edomain&password=$epass", "r");

// note the 'poppasswordchanged.html' changes depending on your cp version

if (!$f) {
 die('Cannot change password. Possible reasons: "fopen" function allowed on your server, PHP is running in SAFE mode');
}

// Check result
while (!feof ($f)) {
 $line = fgets ($f, 1024);
 if (ereg ("already exists!", $line, $out)) {
  die('Such email account already exists.');
 }
}
fclose($f);

echo "Password for $euser@$edomain has been changed to $epass.";

?>

I think finding a way to include this in RC will make it much easier tha SSH or telnet. On the pretty password change they have a file called password.inc in program/steps/settings/passwd.inc , where I think you can incorprate this code. Just get username and domain from RC and have user enter new password log them into cp and change their password and redirect to inbox or back to settings.

 ::) Now if only I coud do that

Offline Heritz

  • Jr. Member
  • **
  • Posts: 58
Re: Change /etc/shadow password interest?
« Reply #28 on: October 05, 2006, 08:45:40 PM »
Yes bro, actually my patch does what you said, but mine doesn't use the poppasswordchanged.html. Mine use a CGI script that all the cPanel installations have.

I made it using CURL and it works basically like you said. I took the program/steps/settings/passwd.inc and I changed it to make it work using the CGI script.

You wont need SSH access or something to use this patch. Its completely friendly and there is no "avanced" knowledge requirements.

I am creating a package for this. I will make a new thread as soon as I have everything set up.
Heritz

Offline AzBlk

  • Jr. Member
  • **
  • Posts: 10
Re: Change /etc/shadow password interest?
« Reply #29 on: October 05, 2006, 10:37:26 PM »
Quote from: Heritz
Yes bro, actually my patch does what you said, but mine doesn't use the poppasswordchanged.html. Mine use a CGI script that all the cPanel installations have.

I made it using CURL and it works basically like you said. I took the program/steps/settings/passwd.inc and I changed it to make it work using the CGI script.

You wont need SSH access or something to use this patch. Its completely friendly and there is no "avanced" knowledge requirements.

I am creating a package for this. I will make a new thread as soon as I have everything set up.

oh ok thanks will be anxiously waiting for this mod