แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - golfreeze

Pages: 1 2 [3] 4 5 ... 73
31
เจอ error #1264 Out of range value adjusted for column 'ID' at row 1 ID บน board smf
แก้ไขโดย
alter table smf_ads change HITS HITS BIGINT NOT NULL default '0';

32
===== send syslog to sensor node.  [normally syslog send to master node only]
https://docs.securityonion.net/en/2.3/firewall.html?highlight=syslog#allow-hosts-to-send-syslog-to-a-sensor-node

==step1 run on master
so-firewall addhostgroup syslogtosensor1

==step2 run on master
so-firewall includehost syslogtosensor1 ipของsyslog-ngที่จะส่งไปsensor

==step3 run on master “sensor_heavynode.sls” => /opt/so/saltstack/local/pillar/minions/<HOSTNAME>_<ROLE>.sls
/opt/so/saltstack/local/pillar/minions/sensor_heavynode.sls
firewall:
  assigned_hostgroups:
    chain:
      DOCKER-USER:
        hostgroups:
          syslogtosensor1:
            portgroups:
              - portgroups.syslog

==step4 run on master salt <HOSTNAME>_<ROLE> state.apply firewall
salt sensor_heavynode state.apply firewall

==step5 : run on sensor node
==check and view see connection establish for source_log send to sensor_ip
netstat -na | grep 514

33
all application on unix knowledges by golfreeze / pacemaker crm manual command
« on: สิงหาคม 16, 2021, 11:39:50 AM »
=====CRM manual  Putting cluster in maintenance mode for a maintenance activity on the SAP servers.
Many times there will be a need to do some kind of maintenance of a SAP server like OS patching, kernel upgrade, SID stacking etc.

In cases like these you might need to restart the servers but if the servers/nodes are in the cluster then the pacemaker will start migrating the services which can create a setback for the administrators. To avoid such scenarios we can simply put the cluster or a particular node in maintenance mode to avoid unwanted resource migrations.

There are three ways to achieve this depending on the situation.

Put the cluster in maintenance mode
crm configure property maintenance-mode="true"
Put the node in maintenance mode
crm node maintenance <node>
Put the node in standby mode
crm node standby <node>

==Once the activity is completed move the cluster or node out of maintenance using below commands.

Move the cluster out of maintenance
crm configure property maintenance-mode="false"
Move the node out of maintenance
crm node ready <node>
Move the node out of standby
crm node online <node>

====Most Important Commands for managing a pacemaker cluster

CRM monitoring commands-

-> crm status : Check the status of the cluster and its services.
-> crm_mon    : Live nonitoring of the cluster

CRM Node Commands

-> crm node show                : list the nodes in the cluster.
-> crm node standby <node name> : put a node on standby
-> crm node fence <node name>   : fence a particular node. (Restart)
-> crm node online <node name>  : bring a node online after standby.
-> crm node clearstate <node>   : clear a nodes state. (if in error)
-> crm node maintenance <node>  : put the node in maintenance mode. Will not affect the cluster services or resources
-> crm node ready <node>        : put the node out of maintenance

CRM Cluster Commands

-> crm cluster health           : Check the health of the cluster.
-> crm cluster start            : Start cluster services on the node.
-> crm cluster stop             : Stop cluster services on the node.
-> crm cluster restart          : Restart cluster services on the node.
-> crm cluster status           : Show cluster services on this node.

CRM Resource Commands

-> crm resource status <name>   : Check status of the resource
-> crm resource start <name>    : Start the resource.
-> crm resource stop  <name>    : Stop the resource.
-> crm resource cleanup <name>  : Cleanup the resource.(if in error)
-> crm resource migrate <name> <node> : Migrate the resource from this node to another.

==special thank you
https://www.linkedin.com/pulse/everything-you-need-know-sap-pacemaker-cluster-testing-robin-singh/

34
=== postgres force drop database
If found error :
 database "boss_v2" is being accessed by other users
 DETAIL:  There are 2 other sessions using the database.

==fixed by force drop
REVOKE CONNECT ON DATABASE boss_v2 FROM public;
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'bot’;
==and drop again
drop database boss_v2;

===when create found problem try to template0
CREATE DATABASE dbname TEMPLATE template1;
=If template1 is not available or corrupted, you can use template0 as last resort:
CREATE DATABASE dbname TEMPLATE template0;

ลองกันดูนะครับผม  8)

35
การมีระบบ SIEM ทำให้เราวิเคราะห์การโจมตีได้ก่อน บางทีจะมี log ที่เป็นลางบอกเหตุมาก่อน เมื่อเห็นทันและทำการยกระดับการป้องกันได้ทัน ปัญหาที่จะส่งผลกระทบขนาดใหญ่ และสามารถมีแนวทางการป้องกันที่ชัดเจน ก็ทำให้ความรุนแรงและผลกระทบทุเลาลงไปได้ครับ

=== Snort rule และระบบ Blueliv Threat Context สามารถจับพฤติกรรม ของ ransomware Avaddon ได้ก่อนจาก กลุ่ม ip ของ campaign นี้
ET TROJAN Win32/Avaddon Ransomware Style External IP Address Check

36
====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/

 ;)

37

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

38
วิธีขาย Firo 1000XZC เลิก Burn ทำยังไงบ้าง

ไปที่ wallet ของท่านเอง
Settings -> Options -> Wallet -> Enable coin control features Enable it, then go to Send
-> Inputs
Find your 1000 xzc transaction.
Right-click on it and choose Unlock unspent
 ;)

39
===== firo No funds at specified address (code -32603) how to fixed =====
No funds at specified address (code -32603)
เนื่องจาก wallet มีการย้ายตำแหน่งเมื่อทำการ โอน firo ออกจาก wallet ทำให้เหรียญตำแหน่งเคลื่อน ทำการเชคใหม่ เป็น
 
===generate new
listaddressbalances 0.01
and get line3 value to input as "feeSourceAddress”

protx update_service proTxHash ipAndPort operatorKey (operatorPayoutAddress feeSourceAddress)

40
==== pacemaker alert notification email to
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/configuring_the_red_hat_high_availability_add-on_with_pacemaker/s1-eventnotification-haar

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/high_availability_add-on_reference/ch-alertscripts-haar

Pacemaker provides several sample alert agents, which are installed in /usr/share/pacemaker/alerts by default. These sample scripts may be copied and used as is, or they may be used as templates to be edited to suit your purposes. Refer to the source code of the sample agents for the full set of attributes they support. See Section 13.1.1, “Using the Sample Alert Agents” for an example of a basic procedure for configuring an alert that uses a sample alert agent.
General information on configuring and administering alert agents is provided in Section 13.1.2, “Alert Creation”, Section 13.1.3, “Displaying, Modifying, and Removing Alerts”, Section 13.1.4, “Alert Recipients”, Section 13.1.5, “Alert Meta Options”, and Section 13.1.6, “Alert Configuration Command Examples”.
You can write your own alert agents for a Pacemaker alert to call. For information on writing alert agents, see Section 13.1.7, “Writing an Alert Agent”.

==== Run on server only 1 node is ok [ if ha on 2 nodes] 
# install --mode=0755 /usr/share/pacemaker/alerts/alert_smtp.sh.sample /var/lib/pacemaker/alert_smtp.sh
# pcs alert create id=smtp_alert path=/var/lib/pacemaker/alert_smtp.sh options email_sender=donotreply@packetlove.com
# pcs alert recipient add smtp_alert value=alert@packetlove.com
# pcs alert
Alerts:
 Alert: smtp_alert (path=/var/lib/pacemaker/alert_smtp.sh)
  Options: email_sender=donotreply@example.com
  Recipients:
   Recipient: smtp_alert-recipient (value=admin@example.com)

41
==== setup snmpd for Centos 8 , Centos7
https://kifarunix.com/install-and-configure-snmp-ubuntu-18-04-and-centos-7/

===Let request point snmpd server to 103.131.22.33
Community name: packetlovehaha

==Client
103.119.22.10:199 tcp
103.119.22.11:199 tcp
103.119.22.12:199 tcp

##Install by
yum install net-snmp net-snmp-utils
systemctl enable snmpd
systemctl restart snmpd

vi /etc/snmp/snmpd.conf
rocommunity packetlovehaha 103.131.22.33
systemctl restart snmpd

===configure listen interface all for snmpd tcp 199
cd /lib/systemd/system
cp /lib/systemd/system/snmpd.service /lib/systemd/system/snmpd.service.bak
==change with vi snmpd.service
ExecStart=/usr/sbin/snmpd $OPTIONS -f tcp:127.0.0.1:199 tcp:103.119.22.10.199

===reload and restart snmpd
systemctl daemon-reload
systemctl restart snmpd

==Check Will show listen 199 on
netstat -tnlp
127.0.0.1:199
103.119.22.10.199

42
=== Fixed sending slow problem on dovecot and exim on directadmin
issue: delay around 20second when sending email via webmail roundcube

===== /etc/dovecot/conf/lmtp.conf
# LMTP socket for local delivery from exim
service lmtp {
  executable = lmtp -L
  process_min_avail = 32
  unix_listener lmtp-client {
    user = mail
    group = mail
    mode = 0660
  }
}


===== /etc/dovecot/dovecot.conf
service imap-login {
  process_min_avail = 32
  user = dovecot
}
service pop3-login {
  process_min_avail = 32
  user = dovecot
}

==Increase process_min_avail from 16 -> 32 on both configure file then restart service
systemctl restart dovecot
test send email and use 1 sec for sending process
: )

43
All Security via cyber space relate golfreeze task. / shodan.io
« on: มีนาคม 22, 2021, 08:25:06 PM »
http.title:BIG-IP&reg:-Redirect& country:"TH" city:"Bangkok"

44
เกี่ยวกับ zcoin cryptocurrency / The amount exceeds your balance on firo transfer
« on: กุมภาพันธ์ 18, 2021, 11:51:59 AM »
==The new wallet defaults to Sending your private balance that were anonymised with the Lelantus protocol.
This can cause the "The amount exceeds your balance" error to appear if you try to send your non-anonymised balance.

Click on the 'Use Transparent Balance' on the bottom right of the Send tab to switch to your non-private balance. You should now be able to send them out.


https://firo.org/guide/firo-migration-guide.html
 8)
Thank you Lelantus for secured : )

45
all application on unix knowledges by golfreeze / upgrade centos 6 to centos7 during year 2021
« on: กุมภาพันธ์ 15, 2021, 05:39:21 PM »
upgrade centos 6 to centos7 during year 2021
ผมเชื่อว่ายังมีคนที่ อัฟเกรด kernel สำหรับ centos 6 ไป centos 7 ไม่ทันช่วงที่ Centos 6 ประกาศ EOF เมื่อเดือน Nov2020 ที่ผ่านมา
ซึ่งทำให้ คนที่ใช้ centos 6 (kernel 2.6.x) อยู่ จะไม่สามารถอัฟเดท package ผ่าน yum ได้ อาจจะต้อง compile source เอา และหาพวก package dependency มาติดตั้งก่อน

ซึ่งในวันนี้ทางทีมงาน Packetlove.com เองอยากมาแนะนำ วิธีการครับ อันดับแรก ต้องทำการ backup system เอาไว้ก่อนทำการอัฟเกรด นะครับ
ถ้า backup system เสร็จแล้วก็ ลุยกันเลย

==clear CentOS-base.repo
cd /etc/yum.repo
mv CentOS-base.repo CentOS-base.repo.ori

==vi /etc/yum.repo/CentOS-upgrade.repo
[centos-upgrade]
name=centos-upgrade
baseurl=https://buildlogs.centos.org/centos/6/upg/x86_64/
enabled=1
gpgcheck=0


======== if found error please complete install before
No package libxml2-devel available.
No package libxslt-devel available.
No package openscap, available.
No package pcre-devel available.
No package mod_wsgi available.

==ผมรวบรวมไฟล์ที่จำเป็นในการอัฟเกรดมาให้นะครับ ทำการ download และรัน Fixed ตามด้านล่างได้เลยครับ
wget https://golfreeze.packetlove.com/download/package_upgrade_need.tar.gz
rpm -ivh libgpg-error-devel-1.7-4.el6.x86_64.rpm
rpm -ivh libgcrypt-devel-1.4.5-12.el6_8.x86_64.rpm                                                                                               
rpm -ivh libxml2-devel-2.7.6-21.el6_8.1.x86_64.rpm
rpm -ivh libxml2-2.7.6-21.el6_8.1.src.rpm
rpm -ivh libxslt-devel-1.1.26-2.el6_3.1.x86_64.rpm
rpm -ivh pcre-devel-7.8-7.el6.x86_64.rpm
rpm -ivh mod_wsgi-3.4-1.el6.rfx.x86_64.rpm

===need to use openscap on version 1.0.8
yum install openscap
yum -y install redhat-upgrade-tool preupgrade-assistant-*
yum -y install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant
rpm --import http://mirror.centos.org/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7


mkdir -pv /var/tmp/system-upgrade/base/ /var/tmp/system-upgrade/extras/ /var/tmp/system-upgrade/updates/
echo http://mirror.centos.org/centos/7/os/x86_64/ >> /var/tmp/system-upgrade/base/mirrorlist.txt
echo http://mirror.centos.org/centos/7/extras/x86_64/ >>   /var/tmp/system-upgrade/base/mirrorlist.txt
echo http://mirror.centos.org/centos/7/updates/x86_64/ >>  /var/tmp/system-upgrade/base/mirrorlist.txt

===start
yes | preupg -v

==new version
centos-upgrade-tool-cli --network=7 --instrepo=http://vault.centos.org/7.2.1511/os/x86_64/
centos-upgrade-tool-cli --force --network=7 --instrepo=https://vault.centos.org/7.2.1511/os/x86_64/ --cleanup-post


==old version
centos-upgrade-tool-cli --network=7 --instrepo=http://vault.centos.org/7.0.1406/os/x86_64/
centos-upgrade-tool-cli --force --network=7 --instrepo=https://vault.centos.org/7.0.1406/os/x86_64/ --cleanup-post


==reboot and waiting 5-10minute please monitoring on console
===ตรงจุดนี้หลังการ ก่อนการรัน reboot เราสามารถเขียน shell script แล้วรันบน crontab ได้นะครับผม
===เพื่อให้ libsasl2 ที่ใช้งานร่วมกับ openssh version บน centos6 สามารถเรียกใช้งานบน centos7 ได้ครับผม


=== script ===
vi ln_shell.sh

#!/bin/bash

export PATH=/usr/sbin:/sbin:/usr/bin:/bin
ln -s /lib64/libpcre.so.1 /lib64/libpcre.so.0
ln -s /usr/lib64/libsasl2.so.3 /usr/lib64/libsasl2.so.2
systemctl restart sshd

แล้วตั้งใน crontab เป็น
@reboot  /root/ln_shell.sh > /dev/null 2>&1

เท่านี้เราก็พร้อมทำการ reboot ละครับ
reboot

ถ้าใครไม่รัน crontab ก็ต้องรันหน้าเครื่อง console ตามนี้นะครับ
ln -s /lib64/libpcre.so.1 /lib64/libpcre.so.0
ln -s /usr/lib64/libsasl2.so.3 /usr/lib64/libsasl2.so.2
systemctl restart sshd

ก็จะสามารถ login ผ่าน ssh ได้ครับผม  8)
welcome to Centos7.x kub

หลังจากอัฟเกรดเสร็จแล้วอาจจะต้องแก้ไขปัญหาพวก service ที่ยังรันไม่ได้ให้ทำงานได้นะครับ
ซึ่งในส่วนนี้จะต้องไล่เชค log error แล้วตามแก้ไขเอา ขอให้ทุกท่านผ่านไปได้ด้วยดีนะครับ
: )

Pages: 1 2 [3] 4 5 ... 73