標籤

BAT (38) shell (34) Virtual Machine (33) Xubuntu (29) acfs (25) PHP (24) CentOS (21) Virtul Box (20) 編輯器 (17) 資料庫 (15) lubuntu (13) windows (13) CPP (12) ubuntu (12) chrome (11) laravel (10) Docker (9) Python (9) 5A88 (7) VMware (6) 資料結構 (6) Javascript (5) Node (5) Proxmox VE (5) 公告系統 (5) 程式積木 (5) Android Studio (4) ANN (3) OB2D2016x64 (3) Xoops (3) clonezilla (3) samba (3) 公文 (3) 其他 (3) 硬體 (3) API (2) Android (2) AppInvent2 (2) Html (2) Hyper-V (2) Nas (2) botnet (2) mbot (2) swift (2) wordpress (2) 樣板 (2) 防火牆 (2) AD的應用 (1) Ansible (1) Arduino (1) CSS (1) GitLab (1) HA Proxy (1) LegoEV3 (1) PowerShell (1) Scratch (1) VM (1) XenServer (1) kotlin (1) linuxmint (1) lxc (1)

2020年6月8日 星期一

只要會用滑鼠點兩下,電腦教室學生機強制安全搜尋


使用方法:
1.下載檔案下載
2.解壓縮,解壓密碼demo1234
3.對資料夾內的ForceSafeSearch.exe (以系統管理員身分執行)點兩下,完成。


以下是思考過程:
        根據資料來源2.How to: Enforcing Google SafeSearch, YouTube, and Bing
我們得知幾件事
1.要在單機主機內C:\Windows\System32\drivers\etc\hosts,新增幾行。其意義如下:
(1)強制google安全搜尋 -> 216.239.38.120
(2)強制bing安全搜尋 ->會有個IP
(3)強制youtube安全搜尋 ->會有個IP
     包含:www.youtube.com、m.youtube.com、youtubei.googleapis.com
                 youtube.googleapis.com、www.youtube-nocookie.com
以下是資料來源2的截圖:


       所以,我們就去ping來得知這些網站的IP
1)強制google安全搜尋 -> 216.239.38.120
(2)強制bing安全搜尋 ->204.79.197.220
(3)強制youtube安全搜尋 ->216.239.38.120


         所以我想用用滑鼠點兩下,電腦教室學生機強制安全搜尋
檔案名稱:ForceSafeSearch.cpp
內容:
#include <fstream>
using namespace std;
int main() {
  ofstream outfile;
  outfile.open("C:\\Windows\\System32\\drivers\\etc\\hosts", std::ios_base::app);
  outfile << "204.79.197.220" <<" "<<"www.bing.com"<<endl; 
  outfile << "216.239.38.120" <<" "<<"www.google.com"<<endl;
  outfile << "216.239.38.120" <<" "<<"www.google.com"<<endl;
  outfile << "216.239.38.120" <<" "<<"www.youtube.com"<<endl;
  outfile << "216.239.38.120" <<" "<<"m.youtube.com"<<endl;
  outfile << "216.239.38.120" <<" "<<"youtubei.googleapis.com"<<endl;
  outfile << "216.239.38.120" <<" "<<"youtube.googleapis.com"<<endl;
  outfile << "216.239.38.120" <<" "<<"www.youtube-nocookie.com"<<endl;
 outfile << "[2001:4860:4802:32::78]" <<" "<<"www.google.com"<<endl;
  outfile << "[2001:4860:4802:32::78]" <<" "<<"www.google.com.tw"<<endl;
  return 0;
}
結果:
1.打開 C:\Windows\System32\drivers\etc\hosts。可看到:


資料來源:
1.How to append text to a text file in C++?
2.How to: Enforcing Google SafeSearch, YouTube, and Bing

沒有留言:

張貼留言

在 Windows 10 x64 1909版,使用BAT快速安裝公文系統與人事服務網(自然人憑證)版

相關內容移往 https://skjhcreator.blogspot.com/2021/02/windows-10-x64-1909bat.html