Search This Blog

Wednesday, September 15, 2010

How to Hide Username/Passwords in shell scripts

Please refer to this article for more details on this.

I have lot of shell scripts where I have to store my username and passwords for accessing the data. This is a big security rish as my passwords are exposed.

I need some executable which can convert my shell script to exe so that it will be difficult for the people to get my password.

Download the sources from http://www.datsi.fi.upm.es/%7Efrosal/sources/shc-3.8.6.tgz

Extract the tar file

tar xvfz shc-3.8.6.tgz

Make the executable

cd shc-3.8.6
make

cp shc to /usr/bin directory

I have a shell script which fetches some password protected pages , here
there is no other option for me other then embedding the password as the wget does
not support encrypted passwords

for example ,

cat getcookie.sh

#!/bin/ksh
/usr/bin/wget --keep-session-cookies --save-cookies=/home/ias/cookie.txt  -O /home/ias/dd.txt   --input-file=/home/ias/urls.txt --http-user=xx.xxx@test.com --http-password=xxxxxxx > /dev/null
cat /home/ias/cookie.txt  | grep test  | cut --fields=7 > /home/ias/cookie.txt

with the shc script I can convert the shell script as executable so that the passwords are hidden
from the people who has access to my unix system.

Run the shc command

shc -f getcookie.sh

This creates the getcookie.sh.c and getcookie.sh.x where .c is the c source file and .x is the executable.

Now run the getcookie.sh.x executable and change the password from the original getcookie.sh script.

Please refer to the http://blogs.koolwal.net/2009/01/20/howto-encrypting-a-shell-script-on-a-linux-or-unix-based-system/
for more details on this.

Saturday, September 11, 2010

How to Upgrade samsung galaxy firmware

Actually many firmware are available for each area (Europe, Asia and America). Last firmware version are:


Europe: I5800XWJH2
Asia: I5801DDJG6
America: I5800LVIJG8

You can download the ODIN Multi Downloader from

http://download968.mediafire.com/skeyfniqhphg/gnzzbkix0nd/Odin4_03-Spica_ops.zip

Flashing with ODIN it's very simple (sorry for picture):

screenshot.32

Before running this utility you need to set the samsung phone in the download firmware mode , for this press

Home+VolDown+Power and hold this for about 30 seconds to 1 minute

In the ODIN screen ,

1) Select "One Package"
2) Select OPS file for I5801 (apollo.ops)

Create apollo.ops file with the following contents ,

0,boot
1,Sbl
2,logo
3,efs
4,zImage
5,factoryfs
6,datafs
7,cache
8,
9,modem


3) In one package select the firmware that you want to flash. (I5801DDJG6.tar) Download the firmware from http://uploading.com/files/1314471a/I5801DDJG6.rar/


4) Start


In about five minutes your mobile will be upgrades.

Tuesday, September 07, 2010

Setup XMail Server on Windows

Please refer to the link http://www.halfdone.com/Articles/XMailInstall/ for more details on this.

Here are the simplified steps to configure the XMail Server’s on Windows Machine

1. Download the XMail Server from http://www.xmailserver.org     

2. Extract this to a directory say C:\xmail-1.27

3. Copy the exe’s and dll’s to C:\xmail-1.27\MailRoot\bin directory

4. Create the HKEY_LOCAL_MACHINE\SOFTWARE\GNU\XMAIL. Create the Sting (REG_SZ) values called MAIL_ROOT and MAIL_CMD_LINE. For the value of MAIL_ROOT put in the "MailRoot folder" location like C:\xmail-1.27\MailRoot. For MAIL_CMD_LINE you can leave it blank or put in "-Pl -Sl -Ql -Fl -Cl -Ll"

screenshot.28

5. Here we are using the default domain , that is xmailserver.test , so no need to modify the configuration files.

6. Run xmcrypt.exe to create an encoded password. It's used in the format of XMCRYPT.EXE <password>.

xmcrypt.exe welcome1

1100161115041616120a1701

7. Open the file C:\xmail-1.27\MailRoot\ctrlaccounts.tab and enter the following values "admin" <tab>   "120009060a080054"

8.  User and alias creation

Check the domain

ctrlclnt -s localhost -u admin -p welcome1 domainlist "xmailserver.test"

Create two domain users

ctrlclnt -s localhost -u admin -p welcome1 useradd "xmailserver.test" test1 welcome1 U
ctrlclnt -s localhost -u admin -p welcome1 useradd "xmailserver.test" test2 welcome1 U

Check the users

ctrlclnt -s localhost -u admin -p welcome1 userlist "xmailserver.test"

Create aliases for these two users

ctrlclnt -s localhost -u admin -p welcome1  aliasadd  "xmailserver.test" test1 ravi1
ctrlclnt -s localhost -u admin -p welcome1  aliasadd  "xmailserver.test" test2 ravi2

Check the aliases for these users

ctrlclnt -s localhost -u admin -p welcome1 aliaslist

9. Set up the POP3 email server and SMTP Outgoing server from Thunderbird. For the POP3 accounts set the SMTP Server as the localhost:25

screenshot.30