22 ธ.ค. 2557

How to BackUP / Restore the MikroTik configuration


 Backup Configuration
1. Access Terminal
2.  Command >> system backup save name=filename
3. Go to the File> File list.
4. The name of the recorded file. Dragged them outside it.

Restore Configuration

21 ธ.ค. 2557

How to Rate Limit Windows Servers (Qos)

1. To begin, from the Start menu, choose Run.

2. In the dialog, type 'GPEDIT.MSC'

3. Expand the 'Computer Configuration' and then 'Windows Settings' parts of the tree. Right click the 'Policy-based QoS' item and choose 'Create new policy' from the context menu.

4. On the first page of the guided dialog, enter a name for your policy, unselect the 'Specify DSCP Value' checkbox, and select the 'Specify Outbound Throttle Rate' checkbox.

5. In the input field for the throttle rate, enter the maximum throughput to which you would like to limit the interface and choose the associated unit of measurement.

6. In the second page of the guided dialog, assuming you would like to make the maximum throughput limit apply to all applications, leave the default radio selection of 'All applications' selected.

17 ธ.ค. 2557

how to repair imei number in android

1) See IMEI back and then write it down.
 
2) open dialer and type *#*#3646633#*#* this code will take you to engineering mode

3) now select "CDS information" then select radio information

4) select phone 1 option and type the code EGMR=1,7,""

5) Enter IMEI "" then click send AT COMMAND BUTTON




6) select phone 2 option and type the code EGMR=1,10,""

7) Enter IMEI "" then click send AT COMMAND BUTTON

then reboot your phone.....

4 พ.ย. 2557

Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it? 
 
If you have an aborted upgrade you get a lock too, for removing that lock execute following commands
 
sudo rm /var/lib/dpkg/lock
sudo rm /var/cache/apt/archives/lock 

27 ต.ค. 2557

How to remove Vinaora Visitors Counter 2.5 link

seacrch หา

PGRpdiBzdHlsZT0ibWFyZ2luLXRvcD
o1cHg7Ij48YSBocmVmPSJodHRwOi8vdmluYW9y
YS5jb20vIiB0aXRsZT0iVmluYW9yYSBWaXNpdG9ycyBDb3VudGVyIiB0YXJnZXQ9Il9ib
GFuayI+VmlzaXRvcnMgQ291bnRlcjwvYT48L2Rpdj48L2Rpdj4NCjwhLS0gVmluYW9yY
SBWaXNpdG9ycyBDb3VudGVyID4+IGh0dHA6Ly92aW5hb3JhLmNvbS8gLS0+
 
แล้วทำการลบทิ้งไปซะ

13 ต.ค. 2557

how to remove Vinaora Visitors Counter Link of joomla 1.5


open file :
/htdocs/modules/mod_vvisit_counter/tmpl/default.php

comment line 162 -165

save

How to remove JPAGE_CURRENT_OF_TOTAL after 1.5.15 upgrade

The problem is the lack of appropriate language pack for the installed version of Joomla. JPAGE_CURRENT_OF_TOTAL is in fact a "code representation" of the sentense "Page x of z." and the reason you seeing it this ways is because your current language pack doesn't have this sentence in it. This string actualy belong to the Joomla pagination plugin.
Solve it in 2 ways:
  1. Download a matching language pack for the version of Joomla you're working with.
  2. If the language pack is just not available yet, fix it manually:

    • Locate the main localization file - so if you have Finish installation it would be: <Joomla folder>\language\fi-FI\fi-FI.ini
    • Manually add the following line in to it:
      JPAGE_CURRENT_OF_TOTAL=Page %s of %s
      You probably will want to translate it to your own language before.

1 ต.ค. 2557

ป้องกัน ShellShock(CVE-2014-6271)

#apt-get update && apt-get upgrade -y
#curl https://shellshocker.net/fixbash | sh
#env x='() { :;}; echo HACK' bash -c " echo Linux "
ถ้ามีคำว่า HAck โผล่มาก็แสดงว่าแพทไม่ผ่าน


ป้องกัน packet ที่มีข ้อความเป็น “() {”

iptables -A INPUT -m string --algo bm --hex-string '|28 29 20 7B|' -j DROP
iptables -A FORWARD -m string --algo bm --hex-string '|28 29 20 7B|' -j DROP

29 ก.ย. 2557

ทำ DHCP Server บน Ubuntu 12.04

sudo nano /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 10.20.30.77
    netmask 255.255.255.0
    gateway 10.20.30.1
    network 10.20.30.0
    broadcast 10.20.30.255
    dns-nameservers 10.20.30.15 10.20.30.16
    dns-search codeghar.com

จัดการ Hdd บน Linux ด้วย fdisk

 หลังจากเพิ่ม hard disk แล้วรันคำสั่ง fdisk -l เพื่อดูว่ามี hard disk ที่เราเพิ่มเข้ามาแล้วหรือยัง
    [root@Lab ~]# fdisk -l Disk
/dev/hda: 64 heads, 63 sectors, 621 cylinders Units = cylinders of 4032 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 184 370912+ 83 Linux /dev/hda2 185 368 370944 83 Linux /dev/hda3 369 552 370944 83 Linux /dev/hda4 553 621 139104 82 Linux swap Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders Units = cylinders of 4032 * 512 bytes Device Boot Start End Blocks Id System      
    [root@Lab ~]# fdisk -l
    Disk /dev/hda: 64 heads, 63 sectors, 621 cylinders
    Units = cylinders of 4032 * 512 bytes

30 ก.ค. 2557

MikroTik RB450G Load Balance เน็ต 2 สาย

:global wanAddress1 192.168.10.2/24
:global wanNetwork1 192.168.10.0
:global wanNetwork1Subnet 192.168.10.1/24
:global wanBroadcast1 192.168.10.255
:global wanGateway1 192.168.10.1

8 ก.ค. 2557

ขั้นตอนในการเคลียร์ซับหมึกของ Printer Brother

1. กดปุ่ม Menu ค้างไว้ 
2.เสียบปลั้กไฟเครื่องปริ้นท์ โดยปุ่ม Menu ยัง ค้างอยู่
3. ปล่อยปุ่ม Menu ก็จะเข้าสู่ Maintenance Mode 
4.กดเครื่องหมาย + ,- ขึ้นไปจนเจอเลข Maintenance Mode 8  กด OK 
5.แล้วกด+,- ขึ้นไปเจอเลข 0 กด OK  (maintainance 80)
6.จากนั้นกดปุ่ม  Mono Start ไปเรื่อย จนเจอคำว่า Purge:XXXX
   ให้กด + -  ขึ้นจนเจอ 2 กด OK 
   กดขึ้นจนเจอ 7 กด OK 
   กดขึ้นจนเจอ 8 กด OK 
   กดขึ้นจนเจอ 3 กด OK   (2783)
   จำนวน Purge ก็จะเป็น 0000 
7.จากนั้นกดปุ่ม Stop/Exit ออกไป เจอ Machine Error 46  
8.แล้วออกจาก Mode Maintenance โดยกดขึ้นไปเจอ เลข 9 กด OK
และกดขึ้น เจอเลข 9 กด OK แค่นี้ก็จะหายแล้ว  เครื่องก้อจะทำงานต่อไป

การ bypass squid3 ด้วย iptables

กำหนด iptables ให้ ACCEPT IP dns ที่ต้องการจะให้ผ่านส่วนของ Squid ไปเลย
จะต้องรู้เป้าหมายเว็บก่อนว่า มี ip เป็นอะไร จากนั้น จัดการตรวจสอบโดยใช้

nslookup hostname 

เสร็จแล้วนำไอพีไปใส่

30 มิ.ย. 2557

Making vsftpd with chrooted users work again on Ubuntu 12.04

sudo add-apt-repository ppa:thefrontiergroup/vsftpd
sudo apt-get update
sudo apt-get install vsftpd
Sudo /etc/vsftpd.conf
แก้ตามตัวอย่าง
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
เพิ่มบรรทัดนี้

เปิด mod_rewrite Apache2 Ubuntu 12.04

#sudo a2enmod rewrite
#sudo nano /etc/apache2/sites-available/default
แก้ให้เป็น
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
#sudo service apache2 restart

หาคนเล่น bit ด้วย wireshark

เปิด wireshark ขึ้นมา
- ตรง Filter: ใส่ !ip.addr==เบอร์ IP ของเครื่องเรา , เช่น IP 192.168.1.102 ก็ใส่เป็น !ip.addr==192.168.1.102
- กด Capture -> Interface , ดูว่า Interface ไหนที่มี traffic วิ่งอยู่บน start ที่ interface นั้น
การแปลผลลัพธ์
จะเจอคำว่า token, get_peers, find_node, BT-SEARCH หรือว่า infohash เป็น packet ของ bit แน่นอน

เก็บ Log IPtable ให้ Ubuntu server

#nano /etc/rsyslog.d/50-default.conf
add the following lines: :msg, contains, “iptables”      -/var/log/iptables.log
& ~

เพิ่ม Code นี้ต่อท้ายในไฟล์ iptables.firewall
# cleanup rule to send all other traffic to the logdrop chain
-A INPUT -j logdrop

สร้างiptableให้ubuntu

สร้างไฟล์
nano /iptables.firewall
ใส่ Code
#Generated by iptables-save v1.3.5 on Mon Feb 19 21:47:01 2007
*filter
:INPUT ACCEPT [1665:126682]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [911:121420]
:logaccept – [0:0]
:logdrop – [0:0]

ติดตั้ง utorrent บน linux

โหลดโปรแกรมาจากhttp://www.utorrent.com/downloads/linux
1.ดาวน์โหลดมาแล้ว แตกไฟล์
2.รันไฟล์ utserver  แต่จะไม่มีอะไรขึ้นมาให้เห็น
3.เปิดบราวเซอร์ใส่  http://localhost:8080/gui/
4.จะมีหน้าต่างเด้งขึ้นมาให้ใส่ user กับ password ใส่ admin ตรงช่อง user ส่วน password ไม่ต้องใส่
เสร็จพิธีการ

Install aircrack for ubuntu 12.04

Install requirement
sudo apt-get install build-essential libssl-dev
Grab the source and start building

wget http://download.aircrack-ng.org/aircrack-ng-1.1.tar.gz
tar -xzvf aircrack-ng-1.1.tar.gz
cd aircrack-ng-1.1
nano common.mak
Then find
CFLAGS          ?= -g -W -Wall -Werror -O3
And remove -Werror like this
CFLAGS          ?= -g -W -Wall -O3
Then start the install process
make
sudo make install
sudo airodump-ng-oui-update

วิชานี้ต้องเรียนด้วย “ความรู้ คู่คุณธรรม”

ติดตั้ง Reaver บน Ubuntu Desktop 12.04 LTS

ขั้นตอนที่ 1 ติดตั้ง
sudo apt-get install subversion build-essential libpcap0.8-dev libpcap-dev
sudo -sH
cd /opt
svn checkout http://reaver-wps.googlecode.com/svn/trunk/ reaver
cd /opt/reaver/src
./configure
make
make install

ขั้นตอนที่  2 ตรวจสอบ
wash -h
reaver -h

ปล.”วิชานี้ต้องเรียนด้วยความรู้คู่คุณธรรม”

วิธี ปลอม mac address ใน linux

# ifconfig wlan0 down
# ifconfig wlan0 hw ether 00:00:57:00:43:84
# ifconfig wlan0 up
# ifconfig wlan0 | grep HWaddr
#wlan0     Link encap:Ethernet  HWaddr 00:00:57:00:43:84

เสริมความปลอดภัย apache บน ubuntu12.04

1.ยกเลิกการแสดงไฟล์ในไดเร็กทอรีที่ไม่มีอินเด็กซ์ไฟล์
#nano /etc/apache2/sites-available/default
ลบคำว่า Indexes ออกจาก Options Indexes FollowSymLinks
#/etc/init.d/apache2 restart
2. ซ่อนการแสดงเวอร์ชั่นของ Apache และ OS จากหน้า Error
#nano /etc/apache2/conf.d/security
แก้ตามนี้
ServerSignature Off
ServerTokens Prod
#/etc/init.d/apache2 restart

ทำ UDP Bandwidth Lemiter

#!/bin/bash
#
# udplimiter This script limit the bandwidth for udp traffic
#
# chkconfig: - 13 87

### BEGIN INIT INFO
# Provides: $udplimiter
# Required-Start: $network
# Required-Stop: $network
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start|stop|status|restart Bandwidth Limiter
# Description: This script limit the bandwidth for udp traffic
### END INIT INFO

ขั้นตอนการติดตามหาผู้กระทำผิดทาง Internet

สำหรับด่าคนอื่นทางเน็ต ช่อโกงทรัพย์ผู้อื่น ลงรูปตัดต่อ หรือกระทำผิดใด ๆ ผ่านทาง Internet โดยชะล่าใจว่า ไม่มีใครจะตามเอาเรื่องได้ คุณได้คิดผิดแล้ว

สมมุติว่า
A = เป็นไปด่า B อย่าเจ็บแสบสะท้านทรวงผ่านทางอินเตอร์เน็ต
B = ผู้เสียหายที่ถูก A ด่าอย่างเจ็บแสบสะท้านทรวง

เนื้อเรื่อง
A ตั้งกระทู้ โพสด่า B อย่างเสีย ๆ หาย ๆ ให้ร้ายว่าความ พร้อมลงรูปของ B เป็นการประจานซ้ำ

ขั้นตอนการติดตามหาตัวทำได้ดังนี้
1.B ไปแจ้งความที่ สน.ใกล้บ้าน เพื่อขอ เสาเนาใบบันทึกแจ้งความ
2.B นำเสาเนาใบบันทึกแจ้งความไปแจ้งความจำนงต่อเวปไซท์นั้นเพื่อขอ log file หมายเลข IP ในเวลานั้น
3.B นำ logfile และหมายเลข IP นั้น ไป แจ้งที่ กระทรวงเทคโนโลยีและสารสนเทศ
4.ทางเจ้าหน้าที่ ที่เกี่ยวข้องจะประสานงานกับ ISP เพื่อสืบค้นว่า หมายเลข IP นี้ ใช้งานเวลานี้ มาจากที่ใดในประเทศไทย
5.ทางเจ้าหน้าที่ประสานกับตำรวจท้องที่ ไปตรวจยังบ้านเลขที่ดังกล่าว
5.1.หากเป็นร้านเกมส์อินเตอร์เน็ต ทางตำรวจจะขอดู Log file เพื่อตรวจสอบว่าใครเป็นคนใช้
6.ทราบชื่อ ผู้กระทำผิดแล้ว ดำเนินการออกหมายเรียกเพื่อมารับทราบข้อกล่าวหา
7.A หน้าซีดมือสั่น เพราะตำรวจ ถือหมายเรียก ยืนอยู่หน้าบ้าน

หากเป็นคดีเล็ก ๆ หมิ่นประมาทประชาชนธรรมดา A จะมีเวลา นอนตีพุงสบายใจ 2-3 เดือน
หากเป็นคดีใหญ่ ๆ หมิ่นเบื้องสูง  A จะมีเวลาร่ำลาญาติ ไม่เกิน 3 อาทิตย์

พิมพ์ก่อนคิด ชีวิตจะไม่วุ่นวาย

ตรวจสอบว่าเครื่องโดนยิง ip หรือไม่

การตรวจสอบว่าเราถูกยิงหรือไม่ผ่านคำสั่ง netstat
โดยการใช้คำสั่้ง netstat แบบประยุค
— การใช้ netstat ตรวจสอบการถูกยิงด้วย syn
คำสั่ง netstat -ntu | grep SYN_RECV | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -nr อันนี้จะบอกว่า ณ ขณะเวลานั้นๆ มีคนส่ง syn เข้ามาเพื่อขอเชื่อมกับ server ของเรา โดยปกติไม่ควรเกิน 10 ครั้งต่อ 1 IP หากเกินกว่านั้นท่าน Block ได้เลย
– การใช้ netstat นับจำนวน connetion ของแต่ละ IP
คำสั่ง netstat -ntu | grep ESTABLISHED | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -nr อันนี้จะบอกว่า ณ ขณะเวลานั้นๆ แต่ละ IP มีการเชื่อมต่อกับเรากี่ connetion  โดยปกติไม่ควรเกิน 10-20 ครั้งต่อ 1 IP หากเกินกว่านั้นท่าน Block ได้เลย

ตัวอย่าง การ Block ด้วย iptables
iptables -A INPUT -s xxx.xxx.xxx.xxx -j DROP ความหมาย -A = เพิ่ม (add), -s = IP ต้นทาง, -j DROP = Block IP

Block เป็น class
iptables -A INPUT -s xxx.xxx.xxx.xxx/xx -j DROP

Block เป็น Protocal
iptables -A INPUT -p udp –dport 80 -j DROP ความหมาย -p = เลือก Protocal ที่ต้องการ (udp,tcp) , –dpoprt = Port ปลายทาง, –spoprt = Port ต้นทางทาง

การตั้งค่า Samba

# nano /etc/samba/smb.conf
# บรรทัดที่ 34 เพิ่ม
unix charset = UTF-8

#บรรทัด 38 เอาเครื่องหมาย ; ออก
   workgroup = WORKGROUP

#บรรทัดที่ 64 เอา ; ออก และก็ตั้งค่าไอพีแอดเดรสที่ต้องการอนุญาตให้เข้าใช้งาน
 interfaces = 127.0.0.0/8 eth0

# บรรทัดที่ 71 เอา ; ออก
  bind interfaces only = yes

# บรรทัดที่ 103 แก้เป็น แชร์ แบบไม่ต้องใส่รหัสผ่าน
security = share

#เพิ่มที่ด้านล่างสุด
[My Picture Share]
   path = /home/picture
   guest ok = yes
   guest only = yes
[My GHO ADI Share]
   path = /home/myghoadi
   guest ok = yes
   guest only = yes

ตัวอย่าง IPTables

PTABLES เป็น Firewall พื้นฐานของ Linux เกือบทุก Distro และให้ประสิทธิภาพที่สูงมากในการ Filtering Traffic และ การป้องกันการ Attack ต่างๆ โดยที่จะมีตัวอย่างพอสังเขป ดังนี้


เปิดการใช้งาน IP Forward ป้องกัน Syn Flood และ อนุญาติให้มีการใช้งานแบบ Dynamic IP (ต่อเนต DSL ทั่วไป)

ติดตั้ง mrtg บน Ubuntu 12.04

ติดตั้ง snmpd
# apt-get install snmp snmpd
# apt-get install snmp-mibs-downloader
เก็บไฟล์ config ของแท้ไว้
# cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.ori
# nano /etc/snmp/snmpd.conf
ใส่ # ไว้หน้า agentAddress  udp:127.0.0.1:161
ลบ # หน้า agentAddress udp:161,udp6:[::1]:161 ออก
ใส่ # ไว้หน้า rocommunity public  default    -V systemonly
เพิ่ม rocommunity public ลงไป