|
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
16
« on: กรกฎาคม 16, 2023, 12:32:41 am »
ในส่วนของเว็บ shodan.io จะเป็นรวมข้อมูลเกี่ยวกับข้อมูล ip , server ที่มีการใช้งาน application หรือ os ในเวอร์ชั่นต่างๆ ซึ่งเราสามารถเขียน syntax ในการค้นหาข้อมูลได้ประมาณนี้ ถ้าอยากค้นเกี่ยวกับ certificate CN มีชื่อโดเมน weloveunix.com
===shodan.io command ====
#ถ้าอยากค้นเกี่ยวกับ certificate CN มีชื่อโดเมน weloveunix.com ssl.cert.subject.CN:"weloveunix.com" #ถ้าอยากค้นเกี่ยวกับ certificate CN มีชื่อโดเมน weloveunix.com และให้ระบุ web server ที่มีการใช้งานเป็น IIS ด้วย ssl.cert.subject.CN:"weloveunix.com" http.title:"IIS Windows Server" #ถ้าอยากค้นเกี่ยวกับ certificate CN มีชื่อโดเมน weloveunix.com และไม่ให้ระบุ web server ที่มีเป็น Invalid URL ก็ใส่เครื่อง - ไปข้างหน้า ssl.cert.subject.CN:"weloveunix.com" -http.title:"Invalid URL" http.title:BIG-IP®:-Redirect& country:"TH" os:"ubuntu 18.04" "Microsoft-IIS/6.0" "Microsoft-IIS/6.0" os:"Windows XP" os:"Windows XP" country:"TH" os: "Linux 2.6" =finding glassfish vulnerable "Glassfish Server 3.1.1"
17
« on: เมษายน 13, 2023, 04:48:57 pm »
เราสามารถทำ clear พวกไฟล์ขยะใน mac os เพื่อเอาพื้นที่ใช้งานกลับคืนมาได้ ผ่าน command mac-cleanup นะครับ แต่ถ้ายังไม่มี ก็ brew มาได้เลย $brew tap fwartner/tap $brew tap fwartner/tap/mac-cleanup $mac-cleanup
18
« on: มีนาคม 12, 2023, 10:11:29 pm »
Proxmox เจอปัญหา Connection error 401: permission denied - invalid PVE ticket แก้ไขโดย #systemctl restart pvedaemon pveproxy
และทำการ เข้าไปที่ /etc/pve แล้วทำการ #mv authkey.pub authkey_20230312.pub หลังจากนั้นทำการ login เข้า ui ใหม่อีกรอบ
19
« on: มีนาคม 11, 2023, 03:36:25 pm »
mongodb dump and restore only specific collection or table database : test123 collection-name : ProductManager
===mongodump only collection /usr/bin/mongodump -h localhost -d test123 --collection=ProductManager -o /home/test/backup_mongo/
===mongorestore only collection mongorestore --db=test123 --collection=ProductManager /home/test/backup_mongo/test123/ProductManager.bson
20
« on: กุมภาพันธ์ 20, 2023, 07:10:54 pm »
==expect command /app/pklscript/sftp.sh set DATE.[timestamp -format {%Y-%m-%d}] $DATE
21
« on: กุมภาพันธ์ 12, 2023, 03:03:03 pm »
**** ถ้าเจอกรณี login เข้า root ผ่านหน้า ui ไม่ได้ แสดงว่าอาจจะ โดน brute force จากหน้า ui ต้องเข้าผ่าน account admin อีกตัว แล้วเข้าไปเปิด ssh แล้วทำการ un-locked user “root” *** ผ่าน command : pam_tally2 --user root --reset แล้วทำการ login ผ่านหน้าเวบ ui อีกที ถ้า login ได้ก็ปิด ssh service ด้วยนะครับ
22
« on: กุมภาพันธ์ 07, 2023, 12:42:48 pm »
=== export memcache data from old-web /usr/share/memcached/scripts/memcached-tool 127.0.0.1:11211 dump > memcache7feb.dumpall
### import memcache data into new-memcache node # nc 127.0.0.1 11211 < oldweb_memcached7feb.dumpall
23
« on: มกราคม 28, 2023, 11:56:11 am »
ถ้าต้องการเพิ่ม php-fpm pool เพื่อใช้งานใน nginx เพิ่มเติม เพื่อรองรับ web connection เพิ่มเติม สามารถทำได้ดังนี้
PKLLAB.com have php-fpm5.6 running 4 pool If need to add pool add configure on #cp /etc/php/5.6/fpm/pool.d/www4.conf /etc/php/5.6/fpm/pool.d/www5.conf And change configure pool-name on www5.conf From www4->www5
And add configure on /etc/nginx/sites-available/pkllab.com upstream php56_pkllab { server "unix:/run/php/php5.6-fpm-www1.sock" max_fails=0; server "unix:/run/php/php5.6-fpm-www2.sock" max_fails=0; server "unix:/run/php/php5.6-fpm-www3.sock" max_fails=0; server "unix:/run/php/php5.6-fpm-www4.sock" max_fails=0; server "unix:/run/php/php5.6-fpm-www5.sock" max_fails=0;
Then restart 2 service /etc/init.d/php5.6-fpm restart Systemctl restart nginx
24
« on: ธันวาคม 29, 2022, 07:31:30 am »
===สคิป find folder then chmod folder 755 and file 644 in wordpress find /home/wordpress/htdocs \ \( -type f -exec chmod ug+rw,o+r {} \; \) , \ \( -type d -exec chmod ug+rwxs,o+rx {} \; \)
25
« on: กันยายน 04, 2022, 06:16:03 pm »
==show line number if found exact word "day" not "today" in file test.txt grep -n -w "day" test.txt
26
« on: กันยายน 04, 2022, 10:24:46 am »
##show second column contain word "account" awk '$2 ~ account {print} ' filenamel
##show first column start with "e" in file check.sh awk '$1 ~ /^e/ {print } ' check.sh
##show first column start with not contain "e" in file check.sh awk '$1 !~ /^e/ {print } ' check.sh
##search and grep "account" from file awk '/account/ {print } ' check.sh awk '/^account/ {print }' check.sh
##if > < >= <= && || finding $5 more than 2000 and less than 2500 then print awk '$5 > 2000 && $5 <2500 {print $0}' check.sh
##if > < >= <= && || finding $5 more than 2000 or $5 not contain "sal" in line then print awk '$5 > 2000 || $5 !~ /sal/ {print $0}' check.sh
##if need change first line with specific "Start processing" and grep "account" awk 'BEGIN {print "Start processing"} {print $0}' check.sh awk 'BEGIN {print "Start processing"} /account/ {print $0}' check.sh
###if need add BEGIN and END of awk and grep "account" awk 'BEGIN {print "Start processing"} /account/ {print $0} END {print "End processed"}' check.sh
##if need count NR=Number record , NF=Number of field awk '{print NR,$0,NF} END {print "End processed"}' check.sh
##if need print LAST Field $NF awk '{print NR,$0,$NF,FILENAME} ' check.sh
##if need only line4 until line8 in file to show awk 'NR==4,NR==8 {print $0}' check.sh awk 'NR==4,NR==8 {print $0}' check.sh | awk '$3 ~ /username/'
##if substitute space with some character use OFS=output field substitute => if see space " " then replace with "@@" awk 'NR==4,NR==8 {print $0}' check.sh | awk 'BEGIN{OFS="@@"} {print $2,$3}' awk 'BEGIN {print "Start processing"} {print $0}' text3 | awk 'BEGIN{OFS="@"} {print $1,$2".com"}'
##if substitute space with some character use FS=field substitute => if see ":" then replace with space " " awk 'BEGIN{FS=":"} {print $2,$3}' text4
##if substitute space with some character use FS=field substitute => if see ":" then replace with "@@" awk 'BEGIN{FS=":";OFS="@@"} {print $2,$3}' text4
##if substitute last character in file use ORS=":" with : awk 'BEGIN {print "Start processing"} {print $0}' text3 | awk 'BEGIN{OFS="@";ORS=":"} {print $1,$2".com"}' output=> Start@processing.com:store@manager.com:Woodridge,Australia@Jon.com:Lethbridge,Canada@Mike.com:Bridge, Canada@Mike.com:Sisaket,Thailand@Liamthong.com:Pathumthani,Thailand@White.com:Saimai,Bangkok@Packetlove.com:
###if need awk run if condition or run condition on script file awk '{if ($3 > 2000) print $0 }' text3 output=> store manager total_sales Woodridge,Australia Jon Stephens 33726.77 Lethbridge,Canada Mike Hillyer 33679.79 Bridge,Canada Mike Hillyer 43679.89 Saimai,Bangkok Packetlove 8229.4
awk '{if ($3 > 2000) print $0; else print "Low" }' text3 output=> store manager total_sales Woodridge,Australia Jon Stephens 33726.77 Lethbridge,Canada Mike Hillyer 33679.79 Bridge,Canada Mike Hillyer 43679.89 Low Low Saimai,Bangkok Packetlove 8229.4
###if need awk run if condition or run condition on script file awk -f script text4
###toupper=change small character to BIG capital leeter on first column , length=count length of character on $3 awk '{print toupper($1),length($3)} {print $0}' text3
27
« on: สิงหาคม 20, 2022, 03:01:02 am »
===== DB Task ===== run import script in sql testdb=> \copy (select * from param_change_request where id in (161, 162)) TO '/home/testdb/backhour.csv' CSV HEADER;
แล้วสามารถไปดูที่ไฟล์ backhour.csv ได้ครับ
28
« on: สิงหาคม 20, 2022, 02:56:45 am »
ถ้าเรามีการเตรียม สคิปในไฟล์ check_query_alter_update.sql เพื่อทำรายการใน db=testdb เราสามารถรันผ่าน command psql ได้ดังนี้
postgres=> \c testdb testdb=> \i 19aug2022_operation/Script/check_query_alter_update.sql ALTER TABLE
เท่านี้ครับผม
30
« on: เมษายน 12, 2022, 07:42:44 am »
csf lfd stop alert email for nrpe on debian os directadmin กรณีมีอีเมลส่งมาแจ้ง เยอะ alert สามารถแก้ไขเพื่อไม่ให้ส่ง email จาก service csf ที่เป้นหัวข้อ lfd ได้โดย If debian enable “csf” need allow on csf.conf “TCP_in” and “TCP_out” and Disable lfd for resource usage Subject: lfd on packetlove.com: Excessive resource usage: nagios (494190 (Parent PID:494190)) From: < root@packetlove.com> Message-Id: < E1ne3x7-002N0R-7t@packetlove.com> Date: Tue, 12 Apr 2022 07:00:13 +0700 Time: Tue Apr 12 07:00:13 2022 +0700 Account: nagios Resource: Process Time Exceeded: 75567 > 1800 (seconds) Executable: /usr/local/nagios/bin/nrpe Command Line: /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f PID: 494190 (Parent PID:494190) Killed: No --1649721613-eximdsn-849789542-- ==แก้ไขเพื่อไม่ให้ส่ง email ได้โดย vi /etc/csf/csf.pignore user:nagios exe:/usr/local/nagios/bin/nrpe cmd:/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f ==reload csf rule 1 รอบ csf -r
|
|
|