วิธีการ คือ ให้เรากำหนด ระบบ iptables เพิ่มเต็มให้มัน ในส่วนของกรณี
ให้มัน ACCEPT IP dns ที่เราต้องการจะให้มันผ่าน ส่วนของ Squid ไปเลยครับ
โดย อาจจะเพิ่มเต็มว่า
กรณี เดิมคือ
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
เราจะต้องรู้เป้าหมายเว็บของเราก่อนว่า มี ip เป็นอะไรนะครับ จากนั้น จัดการตรวจสอบว่า
nslookup hostname เช่น
nslookup www.sanook.com มันจะออกมาเป็น ip ให้ทราบครับผม
เช่น ตัวอย่าง
nslookup www.sanook.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: www.sanook.com
Address: 203.107.165.221
เรารู้แล้วว่ามี ip 203.107.165.221
เราก็จัดการนำไปใส่ เอาไว้ ว่า
iptables -t nat -I PREROUTING -d 203.107.165.221 -j ACCEPT
ระบบนี้มันจะ บอกว่า สำหรับเว้บ www.sanook.com ไม่ต้องให้มีการเก็บ Cache ครับ
สามารถ นำไป ขยาย ความเป็น Script แบบง่าย ๆได้ดังนี้
พิมพ์ ว่า
nano /root/bypass_squid.sh
แล้ว พิมพ์ เข้าไปดังด้านล่างนี้ ว่า
#!/bin/bash
# Genarate PF-internet
ip_bypass=nslookup $1 | grep Addre | grep -v "#53" | cut -d " " -f 2
iptables -t nat -I PREROUTING -d $ip_bypass -j ACCEPT
จากนั้น ทำการ Save ครับ แล้วจัดการ
chmod 755 /root/bypass_squid.sh
แล้ว ทดสอบ ก็ พิมพ์ว่า
/root/bypass_squid.sh www.teenee.com
ดูครับมันจะจัดการใส่ เข้าไปให้ เอง แต่ในกรณีมีหลาย ๆ ip ละทำงั้ยเช่น
nslookup www.google.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
www.google.com canonical name = www.l.google.com.
Name: www.l.google.com
Address: 64.233.181.147
Name: www.l.google.com
Address: 64.233.181.106
Name: www.l.google.com
Address: 64.233.181.105
Name: www.l.google.com
Address: 64.233.181.104
Name: www.l.google.com
Address: 64.233.181.103
Name: www.l.google.com
Address: 64.233.181.99
มีตั้ง 6 ตัว ทำงั้ยดีทีนี้
อาจจกทำดังต่อไปนี้ครับ
nslookup www.google.com | grep Add | grep -v "#53" > /root/C_bypass
ลอง
cat /root/C_bypass
Address: 64.233.181.99
Address: 64.233.181.147
Address: 64.233.181.106
Address: 64.233.181.105
Address: 64.233.181.104
Address: 64.233.181.103
จะมีข้อมูลดังนี้ จัดการต่อว่า
จัดการต่อว่า
Count=wc -l /root/C_bypass | awk '{print$1}'
for ((zz=1; zz<=$Count; zz++)); do
Count=`cat /root/C_bypass | cut -d " " -f 2 | head -n 1`
iptables -t nat -I PREROUTING -d $Count -j ACCEPT
sed -i '/'$Count'/d' /root/C_bypass
done
ก็จะสามารถใช้งานแบบง่ายๆ ได้ครบทุกตัวแล้วครับ แล้วครับ
จัดการสร้างไฟล์ว่า
nano /root/gen_bypass.sh
ใส่ ข้อมูลไปว่า
#!/bin/bash
# Genarate By PF-internet
nslookup $1 | grep Add | grep -v "#53" > /root/C_bypass
Count=wc -l /root/C_bypass | awk '{print$1}'
for ((zz=1; zz<=$Count; zz++)); do
Count=`cat /root/C_bypass | cut -d " " -f 2 | head -n 1`
iptables -t nat -I PREROUTING -d $Count -j ACCEPT
sed -i '/'$Count'/d' /root/C_bypass
done
ทำการ Save และ ออก
จากนั้น
chmod 755 /root/gen_bypass.sh
ทดสอบ
/root/gen_bypass.sh www.google.com
ครับผม น่าจะช่วยให้ท่านทำได้ บ้างนะครับ
Credit : webddgame http://www.3poe.com
เรื่องราวและ ทัศนะต่างๆ กับสิ่งต่างๆที่ไปประสบพบเจอมา โดยนำมาวิเคราะห์ตามแนวความคิดและวิถีทางแล้วบันทึกไว้
23 ต.ค. 2559
Linux Compatible
Microsoft office=Libreoffice
Microsift Edge= Firefox, Google Chrome
Windows media player, MPC-HC = VLC, SMPlayer
Winamp = Audacious, Clementine Rhythmbox, Banshee, amaroK
CCleaner = Bleachbit
AVG, Avast, Avira, Bitdefender, Kaspersky, Norton =
uTorrent, Bittorrent = Deluge, Transmission, qBittorent
Microsoft Paint = Pinta, Mypaint
Window Movie Maker = Openshot
Bandicam, Fraps = Open Broadcasting Software, Simple Screen Recorder
Notepad ++ = Sublime Tex, Atom, Vim, gedit
Winrar = 7zip
Snipping Tool = Shutter
Evernote = Nixnote
DAEMON tools = AcetoneISO
PowerISO, Nero Burning ROM = Brasero, K3b
ACDSee = Shotwell, gThumb, Gwenview, digiKam
Bitlocker = Gnome Disk Utility, Cryptkeeper
Adobe Acrobat = Okula, Evince
Adobe Photoshop = Gimp, Krita
Adobe Lightroom = Darktable, Rawtherapee
Adobe Illustrator = Inkscape
Adobe Premiere Pro, Sony Vegas Pro = Cinelerra, Kdenlive
Adobe Audition, Ableton Live = Ardour, LMMS, Audacity, Ocenaudio
Adobe After Effect, Nuke = Natron
Adobe Flash = Gnash
Autodesk 3D Max, Maya (Linux compatible) = Blender
Autodesk Autocad = FreeCAD, LibreCAD
Vmware = VirtualBox
Ghost = Clonezilla
Norton Partition Magic = GParted
DX11, DX12 = OpenGL, Vulkan
Microsift Edge= Firefox, Google Chrome
Windows media player, MPC-HC = VLC, SMPlayer
Winamp = Audacious, Clementine Rhythmbox, Banshee, amaroK
CCleaner = Bleachbit
AVG, Avast, Avira, Bitdefender, Kaspersky, Norton =
uTorrent, Bittorrent = Deluge, Transmission, qBittorent
Microsoft Paint = Pinta, Mypaint
Window Movie Maker = Openshot
Bandicam, Fraps = Open Broadcasting Software, Simple Screen Recorder
Notepad ++ = Sublime Tex, Atom, Vim, gedit
Winrar = 7zip
Snipping Tool = Shutter
Evernote = Nixnote
DAEMON tools = AcetoneISO
PowerISO, Nero Burning ROM = Brasero, K3b
ACDSee = Shotwell, gThumb, Gwenview, digiKam
Bitlocker = Gnome Disk Utility, Cryptkeeper
Adobe Acrobat = Okula, Evince
Adobe Photoshop = Gimp, Krita
Adobe Lightroom = Darktable, Rawtherapee
Adobe Illustrator = Inkscape
Adobe Premiere Pro, Sony Vegas Pro = Cinelerra, Kdenlive
Adobe Audition, Ableton Live = Ardour, LMMS, Audacity, Ocenaudio
Adobe After Effect, Nuke = Natron
Adobe Flash = Gnash
Autodesk 3D Max, Maya (Linux compatible) = Blender
Autodesk Autocad = FreeCAD, LibreCAD
Vmware = VirtualBox
Ghost = Clonezilla
Norton Partition Magic = GParted
DX11, DX12 = OpenGL, Vulkan
14 ต.ค. 2559
How to Turn On or Off Windows Defender in Windows 10
- Option One: To Turn On or Off Windows Defender using Group Policy
- Run gpedit.msc --> Computer Configuration/Administrative Templates/Windows Components/Windows Defender
- In the right pane of Windows Defender in Local Group Policy Editor, double click/tap on the Turn off Windows Defender policy to edit it. Not Configured is the default setting.
- Option Two: To Turn On or Off Windows Defender using a REG file
- Run regedit -->HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender
- DisableAntiSpyware DWORD
- (delete) = On
1 = Off
สมัครสมาชิก:
ความคิดเห็น (Atom)