helloworld

目前分類:系統管理 (416)

瀏覽方式: 標題列表 簡短摘要

https://go.dev/dl/ 找到適合的golang 版本
目前最新版本為 go1.22.1.linux-amd64.tar.gz

# wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
# tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
# export PATH=$PATH:/usr/local/go/bin

加入 /etc/bash.bashrc ,下次登入後,自動載入

如果出現以下錯誤
go: cannot find GOROOT directory: 

# export GOROOT=/usr/local/go 並加入 /etc/bash.bashrc

測試
# go version
go version go1.22.1 linux/amd64 <= 出現以下資訊,表示安裝成功

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

Gophish 是一套免費的 Open-Source Phishing Framework 開源網路釣魚框架
https://getgophish.com/

安裝好的作業系統,並更新套件
apt -y update
apt -y upgrade

安裝 unzip
apt -y install unzip

下載程式,目前最新版還是 2022 年的 v0.12.1
wget https://github.com/gophish/gophish/releases/download/v0.12.1/gophish-v0.12.1-linux-64bit.zip

解壓縮
mkdir gophish
unzip gophish-v0.12.1-linux-64bit.zip -d ./gophish

修改設定檔,管理介面預設只listen localhost
cd gophish
找到
"admin_server": {
"listen_url": "127.0.0.1:3333",
改成
"admin_server": {
"listen_url": "0.0.0.0:3333",
存檔離開

啟動gophish
chmod u+x gophish
./gophish

可以在執行的log中找到預設的admin 密碼

time="2024-01-30T21:09:45-05:00" level=info msg="Please login with the username admin and the password xxxxxxxx"

測試瀏覽器登入
debian 11 安裝 gophish 開源釣魚框架

登入成功後,會要求變更密碼,變更完成後即可進入管理介面
debian 11 安裝 gophish 開源釣魚框架

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

power shell 可以列出exchange online 某個通訊群組包含哪些成員
但無法直接從個人帳號反推屬於哪些通訊群組
需透過迴圈來實現


Connect-ExchangeOnline

$userMailbox = "個人信箱"

Get-DistributionGroup | ForEach-Object {
    $group = $_
    $groupMembers = Get-DistributionGroupMember -Identity $group.Identity -ResultSize Unlimited
    $userInGroup = $groupMembers | Where-Object { $_.PrimarySmtpAddress -eq $userMailbox }

    if ($userInGroup) {
        Write-Host "$userMailbox -> $($group.DisplayName) ($($group.PrimarySmtpAddress))"
    }
}

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

主機 > 管理 > 系統 > 進階選項 > Security.PasswordQualityControl > 動作 > 編輯選項

預設值為 retry=3 min=disabled,disabled,disabled,7,7

如果要改成簡單一點的密碼,可以先把上述值顯改成 retry=3 min=1,1,1,1,1
修改完密碼後再改回預設值

修改esxi 預設的密碼複雜性原則

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

phpmailer 指定收件者為 user1@example.com 設定如下
$mail->AddAddress("user1@example.com");

如果要加第二筆收件者,僅需重複 $mail->AddAddress(); 即可
如:
$mail->AddAddress("user1@example.com");
$mail->AddAddress("user2@example.com");

同時還可以加入副本收件者
$mail->AddCC("user3@example.com");
$mail->AddCC("user4@example.com");

加入密件副本收件者
$mail->AddBCC("user5@example.com");
$mail->AddBCC("user6@example.com");
 

helloworld 發表在 痞客邦 留言(0) 人氣()


安裝完的 truenas scale 網路預設使用 dhcp 連線
如果要改成固定ip
除了先知道 dhcp ip 後,再透過 web ui 連線修改

也可以透過 console 調整
1) Configure network interfaces
2) Configure network settings
3) Configure static routes
4) Change local administrator password
5) Reset configuration to defaults
6) Open TrueNAS CLI Shell
7) Open Linux Shell
8) Reboot
9) Shutdown

選擇: 1) Configure network interfaces

選擇網卡 > 停用 ipv4_dhcp 
找了好久,找不到 static ip 的關鍵字在哪邊,原來是新增 aliases
新增 aliases: 輸入 192.168.0.100/24

存檔之後按
a (apply) > p (presist) > q (quit)

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

$ vi test.sh

#!/bin/sh

cat > pipe.out

執行
$ echo "Hello World" | ./test.sh

$ cat pipe.out
Hello World

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

使用stat 指定列出檔案的 ctime , mtime , atime

root@lab-101:/workdir# stat this-is-a-file
  File: this-is-a-file
  Size: 505987          Blocks: 992        IO Block: 4096   regular file
Device: 801h/2049d      Inode: 1048579     Links: 1
Access: (0646/-rw-r--rw-)  Uid: (  106/    tftp)   Gid: (  113/    tftp)
Access: 2023-11-20 14:39:11.722228112 +0800
Modify: 2023-11-20 14:38:52.570334312 +0800
Change: 2023-11-20 14:38:52.570334312 +0800
 Birth: 2023-11-20 14:30:57.628959474 +0800

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

安裝 tftp server
apt install tftpd-hpa

安裝 tftp client
apt install tftp

編輯設定檔
vi /etc/default/tftpd-hpa

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"

調整tftp 資料匣權限
chown -R tftp:tftp /srv/tftp

測試下載
tftp 192.1681.1.1 
tftp> get 234.txt
Received 5 bytes in 0.0 seconds

測試上傳
tftp> put 123.txt
Error code 1: File not found

解決方式:
touch /srv/tftp/123.txt ; chown tftp:tftp /srv/tftp/123.txt

再次測試上傳
tftp> put 123.txt
Error code 2: File must have global write permissions

解決方式:
chmod o+w /srv/tftp/123.txt

再次測試上傳
tftp> put 123.txt
Sent 9 bytes in 0.0 seconds

成功,但納悶 123.txt 的owner 和 tftp 的身分都一樣,為什麼沒權限上傳,沒時間研究,先醬

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

redmine top-menu 預設字型很小很小,如果要調整上方字型的大小
cd ./redmine/public/stylesheets
vi application.css

#top-menu {background: #3E5B76; color: #fff; height:1.8em; font-size: 0.8em; padding: 2px 10px 0px 12px;}
將紅字部分改成 1.2 我覺得就很合適了

調整 redmine 最上方列表文字大小

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

測試環境: docker + apache base

root@hellowordl:/home/nextcloud# docker exec --user www-data <CONTAINER ID> php occ config:system:set twofactor_enforced false
System config value twofactor_enforced => false set to empty string
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

下載位址:
https://community.arubainstanton.com/blogs/jamie-easly1/2021/11/01/instanton1960switchsoftwareportal?CommunityKey=26af222f-d9da-43cb-a665-cba6c273756c

若出現以下訊息
Operation Type
Update
File Type
Backup Image
Status
Operation Failed
Error
Copy: Version too old, downgrade prevented.

請將下載下來的zip 解壓縮,僅上傳 *.wsi 即可

升級 aruba 1960 10g switch 韌體

helloworld 發表在 痞客邦 留言(0) 人氣()

測試環境
docker: Base version - apache + mariadb

root@helloworld:~# docker ps
CONTAINER ID   IMAGE          COMMAND                  CREATED      STATUS      PORTS                  NAMES
846abceb2e61   nextcloud      "/entrypoint.sh apac…"   2 days ago   Up 2 days   0.0.0.0:8080->80/tcp   nextcloud-app-1
ab2fb11739b8   mariadb:10.6   "docker-entrypoint.s…"   2 days ago   Up 2 days   3306/tcp               nextcloud-db-1

root@helloworld:~# docker exec -it nextcloud-app-1 bash

root@846abceb2e61:/var/www/html# runuser -u www-data php /var/www/html/occ user:resetpassword admin
Enter a new password:
Confirm the new password:
Successfully reset password for admin
root@846abceb2e61:/var/www/html#
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

用AD帳號 登入windows 時,如果出現以下錯誤訊息
此工作站和主要網域間的信任關係失敗

解決方式:
使用本機帳號登入
確認系統時間與AD DC 之間是否有時間差
時間調整一致,登出再用AD 帳號登入測試是否成功
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

手動更新時間,出現以下錯誤訊息
root@lab:~# timedatectl set-time 11:55:12
Failed to set time: Automatic time synchronization is enabled

關閉 ntp 自動校時
root@lab:~# timedatectl set-ntp no

重新手動更新
root@lab:~# timedatectl set-time '2023-09-19 11:58:30'

root@lab:~# date
Tue 19 Sep 2023 11:58:31 AM CST
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

找到 httpd-ssl.conf 
每個版本路徑可能不大一樣,要自行找一下

找到以下關鍵字
SSLProtocol all -SSLv3
調整成
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1

存檔,重啟 apache 

可用 nmap 工具測試
nmap --script ssl-enum-ciphers -p 443 example-server
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

報告內容

Summary
The remote SSH server is configured to allow / support weak host
key algorithm(s).
Detection Result
The remote SSH server supports the following weak host key algorithm(s):

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

如果你習慣的預設瀏覽器是 google chrome 
但每次透過outlook 開啟連結時,系統卻預設幫你用 microsoft edge 開啟

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

(建立新的檔案系統)
zfs create testpool/data1

文章標籤

helloworld 發表在 痞客邦 留言(1) 人氣()

大約就在今年8/10 左右
更新 adobe pdf reader 之後
透過填寫和簽署新增輸入文字並存檔後
再次打開文件,文字就變成框框+叉叉

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

Close

您尚未登入,將以訪客身份留言。亦可以上方服務帳號登入留言

請輸入暱稱 ( 最多顯示 6 個中文字元 )

請輸入標題 ( 最多顯示 9 個中文字元 )

請輸入內容 ( 最多 140 個中文字元 )

reload

請輸入左方認證碼:

看不懂,換張圖

請輸入驗證碼