Commit 43acebc0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

auth: remove scripts with hardcoded passwords

Remove check_passwords/ (john the ripper scripts) and nx/get-list.pl (contains hardcoded DB credentials). Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 6d7183f4
#!/bin/bash
JOHN="/usr/bin/john"
ROOT="/root/etersoft_pass"
SQLDB="$ROOT/database"
PIDFILE="$ROOT/pid"
LOCK="/root/.john/john.rec"
checktcb() {
for f in `find /etc/tcb -name shadow | sort` ; do
check "$f"
done
}
checksql() {
for f in `find $SQLDB -type f | sort` ; do
check "$f"
done
}
check() {
echo $f
rm -f $LOCK
start-stop-daemon --start -b -m -p $PIDFILE --exec "$JOHN" -- "$1"
STARTTIME=`date +%s`
CRITTIME=`expr $STARTTIME + 3600`
while true ; do
if [ `pidof $JOHN` ] ; then
TIME=`date +%s`
if [ $TIME -gt $CRITTIME ] ; then
start-stop-daemon --stop -p $PIDFILE
break
else
sleep 15s
fi
else
break
fi
done
sleep 1s
}
if [ `pidof $JOHN` ] ; then
kill `pidof $JOHN`
fi
#checktcb
#checksql
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
my $dsn = 'DBI:mysql:mail:server';
my $user='nss-root';
my $db_pass='r00tp@ss123';
my $path = "./database/";
my $dbh = DBI->connect($dsn, $user, $db_pass,
{ RaiseError => 1 }
);
my $query="select username,password from accountuser where username like '%office.etersoft.ru' AND enable=1";
my $sth = $dbh->prepare($query);
$sth->execute();
while (my ($email, $password) =
$sth->fetchrow_array())
{
my $res=qr/$email/is;
# s#$res##;
open (FILE, ">$path$email");
print FILE "$email:$password:\n";
close (FILE);
}
$sth->finish();
$dbh->disconnect();
\ No newline at end of file
#!/usr/bin/perl -w
use strict;
use warnings;
use DBI;
my $dsn = 'DBI:mysql:mail:server';
my $user='nss-root';
my $db_pass='r00tp@ss123';
my $dbh = DBI->connect($dsn, $user, $db_pass,
{ RaiseError => 1 }
);
my $file="/root/etersoft_pass/users";
my $query="select username from accountuser where username like '%office.etersoft.ru' AND enable=1";
my $sth = $dbh->prepare($query);
$sth->execute();
open (FILE, ">$file");
while (my ($email, $password) =
$sth->fetchrow_array())
{
my $res=qr/$email/is;
$email =~ m/(.+)@(.+)/i;
my $name=$1;
print FILE "$name\n";
print "$name\n";
}
close (FILE);
$sth->finish();
$dbh->disconnect();
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
my $dsn = 'DBI:mysql:mail:server';
my $user='nss-root';
my $db_pass='r00tp@ss123';
my $file='list';
my $dbh = DBI->connect($dsn, $user, $db_pass,
{ RaiseError => 1 }
);
my $query="select username from grouplist where gid='800' order by username asc";
my $sth = $dbh->prepare($query);
$sth->execute();
open (FILE, ">$file");
while (my ($user) =
$sth->fetchrow_array())
{
open (FILE, ">>$file");
print FILE "$user\n";
close (FILE);
}
$sth->finish();
$dbh->disconnect();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment