Collection of e-TRAYz Guides by thehijacker

Warning: for advanced users only!
for ver1.0
*******************************
o Fixing the FTP share
*******************************
vim /etc/proftpd/proftpd.conf
i
change
DefaultRoot ~
to
DefaultRoot /home
To save and quit:
ESCAPE
:wq
To quit without save:
ESCAPE
:q!
*******************************
o Checking the hard drive LCC values and hours
*******************************
/usr/sbin/smartctl -a -d ata /dev/sda
Look at: "9 Power_On_Hours" and "193 Load_Cycle_Count"
If it gives you error you need to install smartmontools via ipkg: (/opt/bin/ipkg install smartmontools)
or type:
/usr/sbin/smartctl -a -d ata /dev/sda | grep Power_On_Hours
/usr/sbin/smartctl -a -d ata /dev/sda | grep Load_Cycle_Count
/usr/sbin/smartctl -a -d ata /dev/sda | grep "Device Model"
*******************************
o MySQL instalation
*******************************
/usr/bin/mysql_install_db
*******************************
o MySQL restarting/starting
*******************************
/etc/init.d/mysqld restart
*******************************
o MySQL set root password
*******************************
/usr/bin/mysqladmin -u root password NEW_PASSWORD
to reset the password:
mysqladmin -u root -p'oldpassword' password heretypenewpassword
*******************************
o MySQL console login
*******************************
mysql -u root -p
*******************************
o MySQL change access network
*******************************
vim /etc/mysql/my.cnf
bind-address 127.0.0.0
to
bind-address ET_IP
then restart MySQL with:
/etc/init.d/mysqld restart
*******************************
o MySQL add new root user who can connect from every computer
*******************************
mysql -u root -p
CREATE USER 'root'@'%' IDENTIFIED BY 'some_password';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
*******************************
o MySQL PHP extension installation
*******************************
Taken from here
Code:
wget http://forum.xtreamer.net/download/file.php?id=710 -O /tmp/LAMPfix.tar.bz2
cd /
tar xvjf /tmp/LAMPfix.tar.bz2
/etc/init.d/apache restart
You can test it by making a sample PHP script:
<?php
phpinfo();
?>
Upload it to WWW folder (/home/sysadmin/WWW).
*******************************
o MySQL autostartup on reboot
*******************************
chkconfig --add mysqld
chkconfig --level 3 mysqld on
*******************************
o PHP extensions path
*******************************
/usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613
*******************************
o Mapping drives manualy
*******************************
e-TRAYz Disk via \\etrayz.ip.address\sysadmin .. sysadmin's password will be requested
Private Disk(s) via \\etrayz.ip.address\[username] .. username's password will be requested
Public Disk via \\etrayz.ip.address\Public
External Disk1 via \\etrayz.ip.address\External Disk\USB1\part1
External Disk2 via \\etrayz.ip.address\External Disk\USB2\part1
*******************************
o Installing IPKG
*******************************
Code:
cd /opt
mkdir tmp
cd tmp
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk
tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf -
mkdir -p /opt/etc/ipkg
echo "src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable" > /opt/etc/ipkg/armel-feed.conf
echo "src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/unstable" >> /opt/etc/ipkg/armel-feed.conf
/opt/bin/ipkg update
*******************************
o Setting all rights to Public folders (rename, delete)
*******************************
You need to be root to be able to do this.
chown -R sysadmin:etrayz /home/Public
chmod -R 777 /home/Public
No need to restart after the commands.
*******************************
o Checking the process list and its utilization
*******************************
top
Press q to close.
*******************************
o Checking hard disk free space and partitions
*******************************
df
*******************************
o Testing MAX performance with iperf
*******************************
You need to have ipkg running.
/opt/bin/ipkg install iperf
/opt/bin/iperf -s
On windows PC, download: http://www.noc.ucf.edu/Tools/Iperf/iperf.exe
Run in command line with parameters:
iperf.exe -c ET_IP
Kill client on ET with CTRL C
*******************************
o Check Linux version
*******************************
uname -a
*******************************
o Find any filename on HDD
*******************************
find / -name FILENAME
*******************************
o Installing Sabnzbd Usenet client - Thanks to SteeringWheel
*******************************
Download etrayz_sabnzbd_v100.zip from http://drop.io/etrayz_sabnzbd/
Extract the contents to the WWW folder on your eTRAYz
Open your webbrowser and browse to http://etrayz:8000/installetrayz_sabnzbd.php
Click Install and wait a moment, DON'T DO ANYTHING, just wait while the page finishes loading
If all went well, you get the message 'Copying completed succesfully'.
Reboot your eTRAYz
SABnzbd webinterface is reachable at http://<your etrayz ip>:8888/sabnzbd
To enable SSL type:
chmod o=rw /dev/random
To fix problems with permissions change setting in:
Config->Folders->Permissions for completed downloads
to
777
*******************************
o Installing transmission (better Torrent client)
*******************************
Install it via ipkg:
/opt/bin/ipkg install transmission
Then start it:
sudo -u sysadmin /opt/bin/transmission-daemon -g /home/sysadmin/.config/transmission-daemon
or directly as root user (PREFERABLE):
/opt/bin/transmission-daemon -g /root/.config/transmission-daemon
Then kill it:
killall transmission-daemon
And edit its settings:
vim /root/.config/transmission-daemon/settings.json
To access it via webgui setup something like this in settings.json:
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "password",
"rpc-port": 9091,
"rpc-username": "username",
"rpc-whitelist": "*",
"rpc-whitelist-enabled": true,
To setup watched folder add this at the end of settings.json:
"upload-slots-per-torrent": 14,
"watch-dir": "\/home\/Public\/Temp",
"watch-dir-enabled": true
You can use this windows clients to connect:
http://code.google.com/p/transmission-remote-dotnet/
http://code.google.com/p/transmisson-remote-gui/
or its webgui:
http://ip:9091
If you wish to delete the settings so it will reset back to default:
rm -rf /home/sysadmin/.config/
or if running it under root:
rm -rf /root/.config/
*******************************
o Autostarting Transmission
*******************************
Download the startup script:
wget http://skrci.me/trans -O /etc/init.d/transmission
Make it executable:
chmod 777 /etc/init.d/transmission
Make symbolic links to it:
ln -s /etc/init.d/transmission /etc/rc0.d/K99transmission
ln -s /etc/init.d/transmission /etc/rc1.d/K99transmission
ln -s /etc/init.d/transmission /etc/rc2.d/K99transmission
ln -s /etc/init.d/transmission /etc/rc3.d/K99transmission
ln -s /etc/init.d/transmission /etc/rc4.d/K99transmission
ln -s /etc/init.d/transmission /etc/rc5.d/K99transmission
ln -s /etc/init.d/transmission /etc/rc6.d/K99transmission
ln -s /etc/init.d/transmission /etc/rc3.d/S99transmission
Restart eTrayz.
You can also start and stop transmission daemon with:
/etc/init.d/transmission start
/etc/init.d/transmission stop
/etc/init.d/transmission restart
/etc/init.d/transmission status
*******************************
o Making eTrayz NFS work with XT fw 1.0.3.1
*******************************
In ET WebGui under Settings->Services->NFS make sure NFS is enabled.
Also manualy add the XT IP under Export IP (if you have two or more XTs at home)
In XT WebGUI add this as nfs path:
IP:/Home/Public
also possible:
IP:/Home/Public/Subfolder/Subfolder/...
*******************************
o Checking the log file
*******************************
Apache:
less /var/log/apache2/access_log
System messages:
less /var/log/messages
Use PGUP, PGDOWN, HOME, END keys to navigate, q to quit.
*******************************
o Installing NANO editor from ipkg
*******************************
/opt/bin/ipkg install nano
access to it with:
/opt/bin/nano
*******************************
o Checking actual upload/download speed
*******************************
ifstat
*******************************
o Playing with buzzer
*******************************
echo 50 > /sys/gpio/devices/buzzer
Or any other number which means how long it will buzz.
*******************************
o Getting rid of "hackers"
*******************************
I had a lot of SSH password hacking attempts on my port 22 (SSH) looking like this:
Dec 28 19:50:59 etrayz sshd[5816]: Invalid user gdm from 221.157.125.181
Dec 28 19:51:03 etrayz sshd[5825]: Invalid user gdm from 221.157.125.181
Dec 28 19:51:07 etrayz sshd[5834]: Invalid user gdm from 221.157.125.181
To see the log file:
less /var/log/messages
And to check for Ivalid user logins inside the log file:
cat /var/log/messages | grep "Invalid user" | less
Solution is called Denyhosts.
To install it use ipkg:
/opt/bin/ipkg install denyhosts
It will automaticly start so we need to kill it:
killall python
Then copy the default setting to actual settings file we will use:
cp /opt/share/denyhosts/denyhosts.cfg-dist /etc/denyhosts.cfg
And edit it with editor:
vim /etc/denyhosts.cfg
Change folowing lines:
SECURE_LOG = /var/log/messages
DENY_THRESHOLD_ROOT = 2
WORK_DIR = /opt/share/denyhosts/data
PURGE_DENY = 31d
also check other options in the file like ADMIN_EMAIL if you wish.
Create blank hosts.deny file:
> /etc/hosts.deny
Now lets run it for first time. First we need to copy startup script:
cp /opt/share/denyhosts/daemon-control-dist /etc/init.d/denyhosts
and correct the paths:
vim /etc/init.d/denyhosts
DENYHOSTS_BIN = "/opt/share/denyhosts/denyhosts.py"
DENYHOSTS_LOCK = "/var/lock/subsys/denyhosts"
DENYHOSTS_CFG = "/etc/denyhosts.cfg"
!! To play it safe from mistakenly ban yourself out edit the allowed-host file:
vim /opt/share/denyhosts/data/allowed-hosts
Add the local network address. If you eTrayz IP is 192.168.0.10 then add:
192.168.0.*
Add each another IP/host you wish to allow in its own line.
Now we finaly start it via the script:
/etc/init.d/denyhosts start
It
should analyse the previous log and fill in the hosts.deny file with IP
and hosts of those who attempted to login to your SSH univited.
To make it autorun with eTrayz startup issue this commands:
ln -s /etc/init.d/denyhosts /etc/rc0.d/K99denyhosts
ln -s /etc/init.d/denyhosts /etc/rc1.d/K99denyhosts
ln -s /etc/init.d/denyhosts /etc/rc2.d/K99denyhosts
ln -s /etc/init.d/denyhosts /etc/rc3.d/K99denyhosts
ln -s /etc/init.d/denyhosts /etc/rc4.d/K99denyhosts
ln -s /etc/init.d/denyhosts /etc/rc5.d/K99denyhosts
ln -s /etc/init.d/denyhosts /etc/rc6.d/K99denyhosts
ln -s /etc/init.d/denyhosts /etc/rc3.d/S99denyhosts
For further info check the FAQ:
http://denyhosts.sourceforge.net/faq.html
*******************************
o Deleting default folders
*******************************
rm -R /home/Public/eDownloader
Commands to recreate the folders manualy:
mkdir /home/Public/eDownloader
chown sysadmin:etrayz /home/Public/eDownloader
chmod 777 /home/Public/eDownloader
*******************************
o xmail pop3/smtp server
*******************************
Install it over ipkg:
/opt/bin/ipkg install xmail
Copy startup script:
cp /opt/var/MailRoot/xmail /etc/init.d/
Encode new password that you will use for remote config:
/opt/bin/XMCrypt typeyourpasswordhere
Copy it to clipboard.
Now lets add a new user who will be able to config the server:
vim /opt/var/MailRoot/ctrlaccounts.tab
Add this line:
"desiredusername"[TAB][TAB]"pasteencryptedpasswordhere"
Then start the server:
/etc/init.d/xmail start
Now install this windows administration program:
http://www.webifi.com/xmail/
or PHP web administration script (RECOMMENDED):
http://phpxmail.sourceforge.net/
Use username and password (unexcrypted) that you added into ctrlaccounts.tab file to connect.
Add new domain and users. To test in intranet you can you your eTrayz IP as your domain name.
Now we need to edit main config file:
vim /opt/var/MailRoot/server.tab
Replace domains in all lines from xmailserver.test to your newly created domain. Also uncomment this line:
"EnableAuthSMTP-POP3" "1"
To enable logging:
vim /etc/init.d/xmail
change this line
XMAIL_CMD_LINE="-SX 5 -Qn 1 -Yt 1 -Ln 1 -PX 1 -CX 1 -Pl -Sl -Cl -Ll -Mr 24"
Restart server:
/etc/init.d/xmail restart
And finaly test connect to it. POP3 address is your eTrayz IP. If using eTrayz IP then your email is username@etrayzIP
To autostart it type:
ln -s /etc/init.d/xmail /etc/rc0.d/K99xmail
ln -s /etc/init.d/xmail /etc/rc1.d/K99xmail
ln -s /etc/init.d/xmail /etc/rc2.d/K99xmail
ln -s /etc/init.d/xmail /etc/rc3.d/K99xmail
ln -s /etc/init.d/xmail /etc/rc4.d/K99xmail
ln -s /etc/init.d/xmail /etc/rc5.d/K99xmail
ln -s /etc/init.d/xmail /etc/rc6.d/K99xmail
ln -s /etc/init.d/xmail /etc/rc3.d/S99xmail
If you need to forward your port 25 due to ISP block (instructions by spaceshuttle):
o make account by rollernet.us it's free
o go to control center of rollernet and make your domain where you wanna receive your mail
o
go to mail service and make a smtp redirection(direct delivery) fill in
your ip or even better your ddns and give the port you wanna receive by
example 2025
o go to valid user table from your domain you need to
change the table from 2 users(abuse and postmaster) to deny any
non-matching recipient.
o go to your domain isp and change your mx records like this:
yourdomain mx 10 mail.rollernet.us
your domain mx 15 your ddns or ip
now check your route of all ports are correct.
Be careful with mx records you do it on own risk and wenn it is not full right you don't get any mail anymore
*******************************
o clamav antivirus (still in testing)
*******************************
Install via IPKG:
/opt/bin/ipkg install clamav
Copy settings file:
cp /opt/etc/clamd.conf /etc/
Edit it:
vim /etc/clamd.conf
Update database:
/opt/bin/freshclam --user=root --datadir=/opt/share/clamav
Run it:
/opt/sbin/clamd --config-file=/etc/clamd.conf
Doing a full system scan of Public folder (CAN TAKE A LOT OF TIME!!!):
/opt/bin/clamdscan /home/Public/ --config-file=/etc/clamd.conf
Database location:
/opt/sbin/clamd
*******************************
o Installing asterisk - voip server
*******************************
Install asterisk:
/opt/bin/ipkg update
/opt/bin/ipkg install asterisk16
/opt/bin/ipkg install asterisk16-addons
Download SIP client:
http://www.counterpath.com/x-lite.html
Add at least two users in asterisk:
vim /opt/etc/asterisk/sip.conf
add these lines:
[user1]
type=friend
username=user1
secret=password
host=dynamic
context=etrayz
[user2]
type=friend
username=user2
secret=password
host=dynamic
context=etrayz
Next we need to bind numbers for this two users:
vim /opt/etc/asterisk/extensions.conf
add these lines:
[etrayz]
exten => 1234,1,Dial(SIP/user1)
exten => 4321,1,Dial(SIP/user2)
Start asterisk:
/opt/sbin/asterisk
Install windows SIP program X-Lite:
http://www.counterpath.com/x-lite.html
Add new SIP accounts with following settings:
Display name: User 1
User name: user1
Password: password
Authorization user name: user1
Domain: etrayzIP
Register with domain and receive incoming calls: CHECKED
Send outbund via: proxy
Address: etrayzIP
Do the same only for user2 on second PC.
You can all user1 from user2 by dialing 1234 and vice versa by dialing 4321.
To enable web managment of Asterisk server:
chmod 777 -R /opt/etc/asterisk
vim vim /opt/etc/asterisk/manager.conf
change:
[general]
enabled = yes
webenabled = yes
port = 5038
and add:
[admin]
secret=password
permit=0.0.0.0/0.0.0.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
Download Asterisk Management System:
http://www.ampex.ru/
Unpack to:
/home/sysadmin/WWW/ams
Point your browser to:
http://etrayz:8000/ams
Change settings like so:
Database Settings:
Database Host: localhost
Database Name: ams
Database User: root
Database Password: yourmysqlrootpassword
Create database: CHECKED
Directories:
Config Directory: /opt/etc/asterisk
Temp Directory: /tmp
HTML Root Directory: as is, can't be changed
Asterisk Manager Interface Settings:
IP Address: 127.0.0.1
Port: 5038
User: admin
Password: password
*******************************
o Filemanager - great web file manager + shell
*******************************
Download and unpack:
cd /home/sysadmin/WWW
wget http://82.193.148.146/fm-1.0.1.tar.gz
tar xvfz fm-1.0.1.tar.gz
rm fm-1.0.1.tar.gz
chmod 777 -R /home/sysadmin/WWW/fm
Point your browser to:
http://etrayz:8000/fm
Warning! You can see whole file system!
And so can anyone else who gets URL to you etrayz.
Either rename the folder to something difficult to
guess or protect the folder with .htacccess file.thehijacker
Related Articles
No related articles were found.
Attachments
No attachments were found.
Visitor Comments