try to use | instead of /
example
sed -i ‘s|var/www/test|tmp|g’ /tmp/test.sh
» linux の記事
# wget -qO- http://freegeoip.net/json/
{“ip”:”8.8.8.8″,”country_code”:”HK”,”country_name”:”Hong Kong”,”region_code”:””,”region_name”:””,”city”:”San Po Kong”,”zip_code”:””,”time_zone”:”Asia/Hong_Kong”,”latitude”:11.11,”longitude”:11.11,”metro_code”:0}
# wget -qO- http://freegeoip.net/json/ | grep -Po ‘(?<=”ip”:”)[^”]*’
8.8.8.8
Win7
C:\Windows\System32\drivers\etc
linux
/etc/hosts
必需東西
- Root機(笑,未root 可以再見了
- Android Terminal Emulator , 即putty
- Hacker's Keyboard , 感覺好小小既keyboard skin,最小你會講小左好多粗口:)
- Complete Linux Installer , linux container
- Astro File , android file system
安裝晒以上東東後,開啟 Complete Linux Installer
去install guides 到choose 你要安裝既OS 到,尼到會用ubuntu 12.04 尼做example
Page 1 主要係叫你開USB debugging mode , 同夠位donwload ubuntu OS images
之後Page2 donwload image
之後有3個size可以 download , 睇餸食飯。
sourceforge 係幾好,用4G download 都好快完成, (小妹係唔係就係另mobile network 塞車的兇手,喂
download 完成後就解壓,內有2個file , 一個係img , 一個係md5
用Astro File check 一下md5 有無問題,按實>properties>MD5 checksum
之後將img放到你想放既位置。
完成後回到Complete Linux Installer , 去launch
SETTINGS>Edit 變更images link
save> Start Linux
開了後會自動跳到Android Terminal Emulator,問你開唔開ssh, vnc, y晒佢你就有好日子過
之後save ,一切都變回你懂的東西,update 一野
apt-get upgrade && update
install LAMP
apt-get install apache2 mysql-server php5
完成
linux command 搵folder 入面 jpg,png,gif 以外的files
假設要找尋的folder 為 /var/www 的所有file
find . ! -name '*.jpg' ! -name '*.png' ! -name '*.gif'
先安裝RootKit Hunter
cd /tmp wget http://ncu.dl.sourceforge.net/project/rkhunter/rkhunter/1.4.0/rkhunter-1.4.0.tar.gz
tar -xvf rkhunter-1.4.0.tar.gz cd rkhunter-1.4.0 ./installer.sh --layout default --install
cd /usr/local/bin mv rkhunter /usr/bin/
之後update db
rkhunter --update rkhunter --propupd
之後要修改/etc/rkhunter.conf
nano /etc/rkhunter.conf
加入hidden file whitelist
SCRIPTDIR=/usr/local/lib/rkhunter/scripts ALLOWHIDDENDIR="/etc/.java" ALLOWHIDDENDIR="/dev/.udev" ALLOWHIDDENFILE="/dev/.initramfs" SCRIPTWHITELIST=/usr/bin/unhide.rb
Scan Machine 方法
rkhunter --checkall
完成
rm -r rkhunter-1.4.0 rm -r rkhunter-1.4.0.tar.gz
To show users who are logged in to the system
who
To show the list of users who have logged in last
last
To show the list of all reboots
last reboot
To print the content of the last login log from /var/log/lastlog
lastlog
To List out the login history for certain acc
last [username]
~ VI 常用 command ~
有時有d server 無nano , 唯有用VI
Shift + g | 頁尾 |
:wq | save |
i | Insert mode |
ESC | 出返insert mode |
:q! | quit without save |
Recent Comments