Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rcschaff

Pages: [1] 2 3 ... 10
1
New Modules / Re: Two Factor Authorization Mod
« on: February 22, 2020, 04:27:52 AM »
Module moved to github: https://github.com/rcschaff82/cwp_2fa

Created new topic noting so and locking this one.

2
New Modules / [Module] CWP_2FA
« on: February 22, 2020, 04:27:06 AM »
I have decided to move the module to github. 

Please visit: https://github.com/rcschaff82/cwp_2fa

3
New Modules / Re: Two Factor Authorization Mod
« on: February 22, 2020, 04:03:40 AM »

4
New Modules / Re: Two Factor Authorization Mod
« on: February 22, 2020, 03:54:45 AM »
Go-to the end of #!/bin/sh and hit enter after the h.  For some reason a carriage return was added to the end of the line.

5
New Modules / Re: Two Factor Authorization Mod
« on: February 22, 2020, 03:45:51 AM »
Remove the first line.  Didn't realize it copied

6
New Modules / Re: Two Factor Authorization Mod
« on: February 22, 2020, 03:30:56 AM »
Use this, as I forgot to update the check of the user configs was changed as well.
/root/watch.sh
Code: [Select]
#!/bin/sh
pid=` ps aux | grep -v grep | pgrep -f cron.php`
check_user()
{
echo "//////////User Checks//////////"
cd /usr/local/cwpsrv/var/services/users/login
if [ "$(tail -1 index.php)" == "?>" ] ; then
                return
        fi
chattr -i .
chattr -i *
echo "Moving Files"
cp -f index.php abcdefg.php
cp -f login.php index.php
chattr +i *
chattr +i .
}
check_configs()
{
echo "//////////Config Checks//////////"
FILES=/usr/local/cwpsrv/conf.d/users/*
for f in $FILES
do
if ! grep -q "/home/google" $f; then
    echo updateing $f
     sed -i -re 's@open_basedir(.*)(";)@\1:/home/google\2@' $f
fi
done
if grep -q "open_basedir = /tmp" /usr/local/cwpsrv/conf.d/users.conf; then
updating users.conf
sed -i "s@fastcgi_param   PHP_ADMIN_VALUE \"open_basedir = /tmp@fastcgi_param   PHP_ADMIN_VALUE \"open_basedir = /home/:/tmp@g" /usr/local/cwpsrv/conf.d/users.conf

fi
/usr/local/cwpsrv/bin/cwpsrv -s reload
find /home/*/.conf/cwp.ini -exec sed -i "s@original@modified@g" {} +

}
check_admin()
{
echo "//////////Admin Checks//////////"
        cd /usr/local/cwpsrv/htdocs/admin/login/
        if [ "$(tail -1 index.php)" == "?>" ] ; then
                return
        fi
        echo "Moving Admin"
        chattr -i .
        chattr -i *
        ls | grep -P "[a-z0-9]{16}" | xargs -d"\n" rm
        RAND_CHARS=$(openssl rand -hex 16)
        mv index.php $RAND_CHARS.php
        cp index_working.php index.php
        sed -i "s@define(\"DO_LOGIN\",\"\");@define(\"DO_LOGIN\",\"$RAND_CHARS.php\");@g" index.php
        chattr +i *
        chattr +i .
}
if [ "$pid" != "" ]; then
while [ -e /proc/$pid ]
do
    sleep .6
done
fi
echo "Start Checks"
check_user
check_admin
check_configs


7
New Modules / Re: Two Factor Authorization Mod
« on: February 22, 2020, 01:59:46 AM »
Original file should be in cwp_2fa folder from untar

8
New Modules / Re: Two Factor Authorization Mod
« on: February 22, 2020, 01:10:44 AM »
Updated md5sum   b100f5a2bd1f02330cd1da2531749b6e

Changelog:

Bugfix of user filemanager displaying /home/google instead of home directory
Added check for ntpd service.  Installs and starts if not installed
install script disables selinux temporarily if it is enabled, then reenables it.
install script notifies how to set proper timezone at end

9
New Modules / Re: Two Factor Authorization Mod
« on: February 22, 2020, 01:06:13 AM »
I have a patch for you:
first:
edit /root/watch.sh file
Remove line 26  "sed -i "s@fastcgi_param   PHP_ADMIN_VA....."
Add in it's place  "   sed -i -re 's@open_basedir(.*)(";)@\1:/home/google\2@' $f     "

then run: 
 sed -i "s@open_basedir =/home/google/:@open_basedir =@g" /usr/local/cwpsrv/conf.d/users/*

finally run:
/root/watch.sh

This should fix the issue for users.  Root would normally start in /tmp, so I don't think it's too big of a bug ;)

10
New Modules / Re: Two Factor Authorization Mod
« on: February 21, 2020, 10:13:00 PM »
I'll look into it

11
New Modules / Re: Two Factor Authorization Mod
« on: February 21, 2020, 09:26:36 PM »
Turn off 2fa for root and see if it persists while it's off.  They may have changed something on the backend.

12
New Modules / Re: Two Factor Authorization Mod
« on: February 21, 2020, 06:26:29 PM »
Once logged in, a session token is set, so you should have full access to everything.  Anything that is not working isn't because of this mod, I can promise you that.

13
New Modules / Re: Two Factor Authorization Mod
« on: February 21, 2020, 07:31:28 AM »
Correct.  The login user uses /home/google

14
New Modules / Re: Two Factor Authorization Mod
« on: February 21, 2020, 06:49:31 AM »
Edit

/usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php

remove the extra lines ;)

It starts with <noscript>  20 lines or so, end with </script>

15
New Modules / Re: Two Factor Authorization Mod
« on: February 21, 2020, 06:17:33 AM »
Install script has been updated.

Redownload, and rerun the install.

md5sum 8f0f50679d5a37fd49610227b840db60

Pages: [1] 2 3 ... 10