Skip to content

Instantly share code, notes, and snippets.

View parsibox's full-sized avatar

Mohsen Davari parsibox

View GitHub Profile
@parsibox
parsibox / check_for_hack_directadmin_shell
Last active January 5, 2024 13:57
check for shell script in directadmin vps ( hack , find , directadmin )
grep -lr --include=*.php "eval(base64_decode" /home
find /home -type f -name '*.php' | xargs grep -l "eval *(" --color
find /home -type f -name '*.php' | xargs grep -l "base64_decode *(" --color
find /home -type f -name '*.php' | xargs grep -l "gzinflate *(" --color
find /home -type f -name '*.php' | xargs grep -l "outdo" --color
find /home -type f -name '*.php' | xargs grep -l "eval*_POST" --color
find /home -type f -name '*.php' | xargs grep -l "$ptzrw" --color
find /home/*/domains/*/public_html/wp-content/uploads -type f -name '*.php'
find /home/ -type d -perm 777 -exec find {} -name "*.php" \;
@parsibox
parsibox / ubuntu
Last active December 14, 2023 07:11
sudo su
Suppress lengthy login messages:
touch .hushlogin
Get the existing package metadata up to date, and upgrade all existing packages:
apt -y update
apt -y upgrade
apt -y install mlocate
@parsibox
parsibox / download_from_ssh.sh
Created April 10, 2020 10:36
download a file from ssh
scp -P 22 root@185.xx.xx.xx:/var/www/html/backups.zip /var/www/html/davari
@parsibox
parsibox / ssl.sh
Created May 5, 2022 06:24
Installing the Certbot Let’s Encrypt ssl
sudo yum install -y epel-release
sudo yum install -y certbot-nginx
sudo firewall-cmd --add-service=http
sudo firewall-cmd --add-service=https
sudo firewall-cmd --runtime-to-permanent
sudo certbot --nginx -d example.com -d www.example.com
rateLimit := time.Second / 100 // 100 messages per second
throttle := time.NewTicker(rateLimit)
for msg := range msgs {
<-throttle.C // Wait for the next tick
go handle(msg) // Process the message
}
@parsibox
parsibox / kannel
Last active November 10, 2023 04:50
install kannel on centos 7
yum install -y openssl-devel libxml2-devel texlive-* m4 gcc-c++ make
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql57-community
yum install -y mysql-devel
@parsibox
parsibox / Screenshot.go
Created November 10, 2023 04:48
golang Screenshot
package main
import (
"context"
"io/ioutil"
"log"
"time"
"github.com/chromedp/chromedp"
)
sudo systemctl enable mongodb
show dbs
use admin
db.dropUser("yyyy")
db.createUser({user:"zzzz", pwd:"xxxx", roles:[{role:"root", db:"admin"}]})
mongo -u admin -p admin123 --authenticationDatabase admin
enabled within the security section of your mongod.conf file (like below).
security:
ulimit
update os
install wget , zip , unzip , tcpdump
os limit
allow soduer
allow no password
swap 16 G
@parsibox
parsibox / bot.js
Last active September 21, 2023 10:18
cloudflare worker call url bot.js
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Respond with hello worker text
* @param {Request} request
*/
async function handleRequest(request) {
if (request.method !== 'POST') {
return new Response('Method Not Allowed', { status: 405 })