Recent Posts

Pages: 1 ... 8 9 [10]
91
===step after dashboard done => https://docs.securityonion.net/en/2.3/logstash.html
ถ้าเจอว่า master node ไม่สามารถค้นหาได้ และเกิด error
"Error: Could not locate that index-pattern-field (id: @timestamp)"

# ls -la /opt/so/conf/logstash/pipelines/manager
total 20
drwxr-xr-x 2 logstash socore 4096 May 22 23:57 .
drwxr-xr-x 4 logstash socore 4096 May 29 23:42 ..
-rw-r--r-- 1 logstash socore   69 May 22 23:57 0009_input_beats.conf
-rw-r--r-- 1 logstash socore 1065 May 22 23:57 0010_input_hhbeats.conf
-rw-r--r-- 1 logstash socore  206 May 22 23:57 9999_output_redis.conf

# ls -la /opt/so/conf/logstash/pipelines/search
total 44
drwxr-xr-x 2 logstash socore 4096 May 29 23:42 .
drwxr-xr-x 4 logstash socore 4096 May 29 23:42 ..
-rw-r--r-- 1 logstash socore  180 May 29 23:42 0900_input_redis.conf
-rw-r--r-- 1 logstash socore  372 May 29 23:42 9000_output_zeek.conf
-rw-r--r-- 1 logstash socore  351 May 29 23:42 9002_output_import.conf
-rw-r--r-- 1 logstash socore  342 May 29 23:42 9034_output_syslog.conf
-rw-r--r-- 1 logstash socore  392 May 29 23:42 9100_output_osquery.conf
-rw-r--r-- 1 logstash socore  341 May 29 23:42 9400_output_suricata.conf
-rw-r--r-- 1 logstash socore  370 May 29 23:42 9500_output_beats.conf
-rw-r--r-- 1 logstash socore  338 May 29 23:42 9600_output_ossec.conf
-rw-r--r-- 1 logstash socore  359 May 29 23:42 9700_output_strelka.conf

2. ใส่ค่าเพิ่มใน /opt/so/saltstack/local/pillar/global.sls
logstash:
  pipelines:
    manager:
      config:
        - so/0009_input_beats.conf
        - so/0010_input_hhbeats.conf
        - so/9999_output_redis.conf.jinja
    search:
      config:
        - so/0900_input_redis.conf.jinja
        - so/9000_output_zeek.conf.jinja
        - so/9002_output_import.conf.jinja
        - so/9034_output_syslog.conf.jinja
        - so/9100_output_osquery.conf.jinja
        - so/9400_output_suricata.conf.jinja
        - so/9500_output_beats.conf.jinja
        - so/9600_output_ossec.conf.jinja
        - so/9700_output_strelka.conf.jinja

3. restart logstash
# so-logstash-restart

4. restart elasticsearch
# so-elasticsearch-restart

====located for salt pipeline config
/opt/so/saltstack/default/salt/logstash/pipelines/config/so

===>after configure pipeline into global.sls then docker will start on choose pipeline and keep configure on path below.
 /opt/so/conf/logstash/pipelines/search

===docker command check inspect 
docker inspect so-logstash

เท่านี้พวก log ใน dashboard kibana ก็จะแสดงขึ้นมาครับผม
92
Package on mac / Re: mac check battery and life cycle via command line console howto
« Last post by golfreeze on พฤษภาคม 26, 2021, 08:30:09 PM »
==วันนี้ได้ทำการเปลี่ยน Battery MacBookPro ที่สั่งซื้อมาใหม่เสร็จครับ
แล้วรันเชค MaxCapa กับ Cycle ดูจะขึ้นเป็น MaxCapa = 6880 , CurrentCapa = 6868
และ Cycle Count = 1  เยี่ยมไปเลย ลองดูกันว่าจะใช้ได้กี่ปี  : )

#ioreg -l -w0 |grep Capacity
    | |           "AppleRawCurrentCapacity" = 6868
    | |           "AppleRawMaxCapacity" = 6880
    | |           "MaxCapacity" = 6880
    | |           "CurrentCapacity" = 6868
    | |           "LegacyBatteryInfo" = {"Amperage"=18446744073709551318,"Flags"=4,"Capacity"=6880,"Current"=6868,"Voltage"=12274,"Cycle Count"=1}
    | |           "DesignCapacity" = 6559
    | |           "BatteryData" = {"StateOfCharge"=25600,"Voltage"=12594,"QmaxCell1"=46882,"QmaxCell2"=33570,"DesignCapacity"=6559,"QmaxCell0"=38946,"CycleCount"=1}
93
all application on unix knowledges by golfreeze / Re: install redis on centos7 directadmin
« Last post by golfreeze on พฤษภาคม 26, 2021, 10:54:26 AM »
##tunning kernel support high connection for redis
echo never > /sys/kernel/mm/transparent_hugepage/enabled
sysctl -w net.core.somaxconn=65535
94
==== add new disk (sdb) to vg LVM
fdisk /dev/sdb
n
p
1

=change type to LVM as 8e and write save config
t
8e
w

==create pv
pvcreate /dev/sdb1
y
vgextend ubuntu-vg /dev/sdb1
lvextend -L +32G /dev/mapper/ubuntu--vg-ubuntu--lv
xfs_growfs /dev/mapper/ubuntu--vg-ubuntu--lv

95
== How to Extend disk in LVM

==df -h for extend disk "ubuntu--vg-ubuntu--lv "
/dev/mapper/ubuntu--vg-ubuntu--lv   66G  5.9G   30G  10% /

==check vg display
vgdisplay ubuntu-vg
  Alloc PE / Size       8832 / 34.50 GiB
  Free  PE / Size       8831 / <34.50 GiB

==extend +32G disk space
lvextend -L +32G /dev/mapper/ubuntu--vg-ubuntu--lv

==resize
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

==check disk again after extend successful
/dev/mapper/ubuntu--vg-ubuntu--lv   66G  5.9G   57G  10% /
96
==== found error mysql could not start ==== tail -f /var/log/mysql/mysqld.log
2021-05-23T15:26:05.167047Z 0 [System] [MY-010910] [Server] /usr/libexec/mysqld: Shutdown complete (mysqld 8.0.21)  Source distribution.
2021-05-23T15:27:10.587795Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 10000 (requested 25980)
2021-05-23T15:27:10.587801Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 2397 (requested 4000)
2021-05-23T15:27:10.821955Z 0 [System] [MY-010116] [Server] /usr/libexec/mysqld (mysqld 8.0.21) starting as process 5593
2021-05-23T15:27:10.829416Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-05-23T15:27:10.847916Z 1 [ERROR] [MY-012263] [InnoDB] The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages (rounded down to MB) than specified in the .cnf file: initial 32000 pages, max 0 (relevant if non-zero) pages!
2021-05-23T15:27:10.848094Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2021-05-23T15:27:11.348117Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2021-05-23T15:27:11.348381Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.

===>ทำการแก้ไขโดย
vi /etc/my.cnf.d/mysql-server.cnf
[mysqld]
innodb_data_file_path = ibdata1:20M:autoextend

cd /var/lib/
mv mysql mysql.ori
systemctl restart mysqld

mysql -p
create database newdb;

mysql_secure_installation
ตั้งรหัส root ใหม่

import db:
mysql -uroot -p newdb < newdb.sql
97
การมีระบบ SIEM ทำให้เราวิเคราะห์การโจมตีได้ก่อน บางทีจะมี log ที่เป็นลางบอกเหตุมาก่อน เมื่อเห็นทันและทำการยกระดับการป้องกันได้ทัน ปัญหาที่จะส่งผลกระทบขนาดใหญ่ และสามารถมีแนวทางการป้องกันที่ชัดเจน ก็ทำให้ความรุนแรงและผลกระทบทุเลาลงไปได้ครับ

=== Snort rule และระบบ Blueliv Threat Context สามารถจับพฤติกรรม ของ ransomware Avaddon ได้ก่อนจาก กลุ่ม ip ของ campaign นี้
ET TROJAN Win32/Avaddon Ransomware Style External IP Address Check
98
เกี่ยวกับ zcoin cryptocurrency / How to Firo earn with locked staking on Binance
« Last post by golfreeze on พฤษภาคม 14, 2021, 10:15:14 AM »
====Firo-> Earn-> Lock Staking
เมื่อเรามีเหรียญ Firo 100 เหรียญ
เราสามารถทำการฝากกับ Binance โดยเข้าที่เมนู Earn
แล้วทำการ Locked Staking ได้ครับ
โดย เรตของดอกเบี้ย ณ วันที่ 12May2021 จะเป็น 5.78% ต่อปี ย้ำว่าต่อปีนะครับ แต่ข้อดีก็คือ ทาง Binance จะคิดเรตดอกเบี้ยเป็นรายวันได้ ครับ

==check เรต earn
https://www.binance.com/en/pos

====Firo -> Redeem
จะได้ดอกเบี้ยเป็นรายวัน
แต่ถ้าต้องการ redeem Firo ดอกเบี้ยและเอาเหรียญที่ฝากไว้ ออกจาก earn process
จะต้องกดที่ “Redeem” แล้วใช้เวลารอประมาณ 24-48 ชม เพื่อให้ได้ดอกเบี้ยที่ earn ไว้ เข้ากระเป๋าของคุณ
แล้วจำนวน Firo ที่ลงไว้ 100Firo จะกลับเข้า Spot Wallet ใช้เวลาประมาณ 24-48 ชม เช่นกันครับ

====ยังไงถ้าเพื่อนๆคนไหนสนใจ ก็ลองหาข้อมูลเพิ่มเติมดูนะครับ
https://www.binance.com/en/pos
https://firo.org/community/

 ;)
99
Mail issue , problem , configuration / Re: การทำ relay mail ใน directadmin exim da
« Last post by golfreeze on พฤษภาคม 13, 2021, 06:44:49 PM »
มีอีกวิธีในการทำ relay เฉพาะบางโดเมนเพื่อให้ส่งไปยัง relay mail server
เช่นมีโจทย์ว่า sender ต้องการส่งเมลของ gmail.com แล้วให้ relay ไปออกที่เครื่อง 103.8.9.9
เพื่อให้เครื่อง 103.8.9.9 ส่งเมลออกต่อไปให้ยัง gmail.com
 
vi /etc/exim.conf
ไปที่บันทัด
begin routers
แล้วทำการเพิ่ม configure 5 บันทัด หลังจาก begin routers

static_route:
  driver = manualroute
  transport = remote_smtp
  domains = lsearch;/etc/virtual/staticroutes
  route_data = $domain_data

ทำการ save ออกมา
ไปที่ไฟล์
/etc/virtual/staticroutes
เพิ่ม
gmail.com : 103.8.9.9
ทำการ save ออกมา
ทำการ restart service

systemctl restart exim
1 รอบ
แล้วทำการเทสครับ จะเจอว่ามีการ relay ไปยัง server 103.8.9.9
แต่ที่บน 103.8.9.9 ต้อง allow ip ของเครื่องต้นทางไว้ด้วยครับ   ;)

==reference site
https://forum.directadmin.com/threads/send-specific-sender-domains-through-external-smtp.55206/
https://forum.directadmin.com/threads/relay-certain-domain-email-through-external-emal.54019/

==download configure
wget -O /etc/exim.routers.pre.conf http://files.directadmin.com/services/SpamBlocker/smart_route/exim.routers.pre.conf
wget -O /etc/exim.transports.pre.conf http://files.directadmin.com/services/SpamBlocker/smart_route/exim.transports.pre.conf
wget -O /etc/exim.authenticators.post.conf http://files.directadmin.com/services/SpamBlocker/smart_route/exim.authenticators.post.conf
100

1.Renew cert on by generate csr file submit to Trust CA

===2.for exim & dovecot
/etc/exim.cert
/etc/exim.key
systemctl restart exim
systemctl restart dovecot

===3.for roundcube cert
===/usr/local/directadmin/conf/directadmin.conf
apachecert=/etc/httpd/conf/ssl.crt/server.crt
apachekey=/etc/httpd/conf/ssl.key/server.key

==restart httpd service
systemctl restart httpd

===4. for :2222 directadmin login 
===/usr/local/directadmin/conf/directadmin.conf
cacert=/usr/local/directadmin/conf/cacert.pem
cakey=/usr/local/directadmin/conf/cakey.pem

==restart directadmin service
systemctl restart directadmin
Pages: 1 ... 8 9 [10]