Pages

Tuesday, December 14, 2010

Execute script at certain time

Cronjob used for automating script in certain continues period. For execute once at certain time we can use "at" command.

user@sabily:/etc/cron.weekly$ at -m 10:00 < /home/user/ftp.sh
warning: commands will be executed using /bin/sh
job 1 at Tue Dec 14 10:00:00 2010

Automating sftp with shell script

1. Create public key on local machine

ssh-keygen -t rsa

(just choose the default options. let the passphrase blank, or else you have to enter the passphrase everytime you login. this should generate /home/localuser/.ssh/id_rsa.pub)

2. Login to remote machine 
3. Create file /home/remoteuser/.ssh/authorized_keys (if .ssh folder doesn't exists then create it, and if authorized_keys file is exists then use it)
4. Copy the contents of id_rsa.pub on local machine to authorized_keys file on remote machine
    scp .ssh/id_rea.pub remotehost:.ssh/authorized_keys
5. Run ssh-add on local machine, then you can run: "sftp remoteuser@remotehost" without password

Monday, December 13, 2010

Avoid "Page Has Expired" Warnings

This problem occurs in my office's ticketing web application (using php). When switching back to previous page using back button of the browser, it displays a warning that page has expired. To obtain it, we have to press F5 in IE. In firefox always shows cofirmation box to resend the page.

Googling for the solutions, i found two references that useful:
http://support.microsoft.com/kb/183763
http://shiflett.org/articles/how-to-avoid-page-has-expired-warnings

I then change the php.ini configuration from:


session.cache_limiter = nocache

to:

session.cache_limiter = private

note:

lately known that this "private" option causes new problem, when clicking home the applications always prompt login form. well this is annoying.

I then set:

session.cache_limiter =

refs:
http://php.net/manual/en/function.session-cache-limiter.php
php.ini comments

Friday, November 26, 2010

These are the Hackers Most Popular All Time

Some do the hacking for the satisfaction only.


VIVAnews - In addition to regular Internet users, the virtual world is also filled by those who are referred to as hackers, called crackers or black hat hackers. Their penchant is to exploit a computer system and do what is referred to as cybercrime.
Some of them do it for pleasure and sense of curiosity alone, while others do it for personal profit. Here are some "black hack 'most popular hacker community.


Jonathan James

James suddenly popular name because he was the first person thrown into the courts because of hacking. While incarcerated, he was only 16 years old.
In an interview with private TV stations in the United States, he says, "I just play and see," said James, as quoted from ITSecurity, 16 November 2010. "The interesting challenge for me is what I can get if you succeed," he said.
James who became the target is top class organization. For example, he installed a backdoor on the server Defense Threat Reduction Agency (DTRA). The organization is one unit in the U.S. Defense Department in charge of reducing the threat against the United States and its allies from conventional weapons, special weapons, biological, chemical, up to nuclear.
Backdoor created by James enable view sensitive emails and retrieve data employee username and password.
James also managed to get into NASA computers and stole software worth a total of U.S. $ 1.7 million or about Rp15 billion.
According to the Justice Department, software that is stolen is a free physical environment supporting the International Space Station that controls temperature and humidity in the residence of the astronauts in space.
As a result, NASA was forced to shut down their computer systems and a loss of up to U.S. $ 41 thousand or Rp366 million. According to James, he downloads the software code to support them in learning the C programming language"The code itself is ugly, indecent, valued at U.S. $ 1.7 million as claimed to NASA," said James.
Looking at the crimes committed, if only James or known by the name c0mrade in cyberspace that has grown old, he would be punished at least 10 years in prison.Because underage, he only sentenced prohibited from using computers and be under house arrest for six months with the experiment. However, since he violated the punishment, he was jailed for 6 months.
Currently, James admitted that he had converted, will not commit similar crimes and plans to establish a security company.


Adrian Lamo


Lamo popular because he managed to infiltrate the New York Times and Microsoft.Dubbed the "homeless hacker" because he used computers in public places like coffee shops and libraries to launch attacks.
Infiltration by Lamo is generally a penetration experiment through a security hole that he found, exploit it, then spread around the company that he infiltrated the existing gap. He also had time to infiltrate into Yahoo, Bank of America, Citigroup, and Cingular.
If a white hacker company hired to perform penetration testing, it is legal. However, do not Lamo. When he entered the New York Times intranet, he saw the personal information of contributors, including Social Security number. Lamo also go into the newspaper's LexisNexis account and steal confidential information.
As a result, he was fined U.S. $ 65 thousand, under house arrest for 6 months to two years probation. After his sentence ended, he worked as a journalist and speaker at various events.


Kevin Mitnick

Mitnick was known when he was sought after by the authorities. Its practices heavily publicized in the media even though the crime which he did in fact not very significant.
Even so, the Justice Department declared that Mitnick is: "The most wanted computer criminal in United States history." Even the exploitation was doing made into two films namely Freedom Downtime and Takedwon.
Mitnick had a number of hacking experience before committing crimes that made him popular. He begins by breaking into the network card of mass transportation in Los Angeles to get a free bus ride.
After that, he cheated telephone billing. Although other crimes, Mitnick was ultimately arrested for through the Digital Equipment Corporation's computer network and stealing software.
Mitnick's behavior is getting worse after he was hacking from around the country for two half years. In an article titled 'legendary computer hacker who got out of jail' on CNN, said that Mitnick is often entered into the computer network, steal company secrets, disrupt the phone network and into the early warning system state.
Now Mitnick had abandoned his past as a black hat hacker and become active members in the community. Had imprisoned for 5 years, 8 months with them locked up in isolation cells, Mitnick is now working as a computer security consultant, author and speaker.


Source: http://teknologi.vivanews.com/news/read/189141-black-hat-hacker-terpopuler-sepanjang-masa

Enable remote access to mysql

There are three steps to do:
First, edit my.cnf:

[mysqld] 
Make sure line skip-networking is commented (or remove line) and add following line
bind-address=YOUR-SERVER-IP
For example, if your MySQL server IP is 65.55.55.2 then entire block should be look like as follows:
[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/English
bind-address    = 65.55.55.2
# skip-networking
....
..
....
Where,
  • bind-address : IP address to bind to.
  • skip-networking : Don’t listen for TCP/IP connections at all. All interaction with mysqld must be made via Unix sockets. This option is highly recommended for systems where only local requests are allowed. Since you need to allow remote connection this line should be removed from my.cnf or put it in comment state.

Second, grant access right to remote user

If you want to add a new database called foo for user bar and remote IP 202.54.10.20 then you need to type the following commands at mysql> prompt:mysql> CREATE DATABASE foo;
mysql> GRANT ALL ON foo.* TO bar@'202.54.10.20' IDENTIFIED BY 'PASSWORD';

How Do I Grant Access To An Existing Database?

Let us assume that you are always making connection from remote IP called 202.54.10.20 for database called webdb for user webadmin, To grant access to this IP address type the following command At mysql> prompt for existing database, enter:
mysql> update db set Host='202.54.10.20' where Db='webdb';
mysql> update user set Host='202.54.10.20' where user='webadmin';
Third, open firewall ports (go to firewall note)


source: http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html