Langsung ke konten utama

Remote Port Forwarding

$ ssh -nNT -R 4000:localhost:3000 user@server.com
The above command sets up an ssh tunnel between your machine and the server, and forwards all traffic from localhost:3000 (on your machine) to localhost:4000 (in the context of the server). So now you can connect to the locally running service on port 3000 on the server on port 4000.
This trick is very useful because it allows you to be able to expose a locally running service through your server to others on the internet without having to deploy it / setup on the server.

Komentar

Postingan populer dari blog ini

Tutorial Install SQLmap Ubuntu

sqlmap merupakan tools/alat opensource yang mendeteksi dan melakukan exploit pada Bug SQLinjection. dengan melakukan serangan SQL injection, peretas dapat mengambil alih hingga dapat memanipulasi sebuah database di dalam sebuah server. Sebelumnya, apa itu SQL Injection? SQL injection merupakan teknik hacking di mana peretas dapat menyisipkan perintah-perintah SQL melalu URL untuk di eksekusi oleh database. bug atau vulnerability ini terjadi karena kelalian seorang programer atau webmaster dalam melakukan pemograman web seperti tidak difilternya variabel dalam web tersebut. Cara installnya? $ sudo apt-get install git $ git clone https://github.com/sqlmapproject/sqlmap.git Untuk Menjalankannya, $ cd /patch/to/sqlmap/ jalankan dengan perintah dasar $ python sqlmap.py -h << untuk melihat basic options $ python sqlmap.py -u 'http://alamat.com'  contoh lain: $ python sqlmap.py --url=”http://192.168.152.129/dvwa/vulnerabilities/sqli/? id=1&Submit=S

PHP Apps in a Subdirectory in Nginx

 location /pilkades {     alias /var/www/html/pilkades;     try_files $uri $uri/ @nested;     location ~ \.php$ {         include snippets/fastcgi-php.conf;         fastcgi_param SCRIPT_FILENAME $request_filename;         fastcgi_pass unix:/run/php/php7.4-fpm.sock;     } } location @pilkades {     rewrite /pilkades/(.*)$ /pilkades/index.php?/$1 last; } atau: location /alias {     alias  /var/www/htmlalias;     location ~ /([^/]+\.php)$ {       try_files /$1 =404;       fastcgi_pass unix:/var/run/php5-fpm.sock;       fastcgi_index index.php;       include fastcgi_params;       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;     }   }

Backup Mysql ALL Database with Specific Methods ( #! /bin/bash)

#! /bin/bash # backup-mysql.sh # # Craig Sanders <cas@taz.net.au> # this script is in the public domain.  do whatever you want with it. MYUSER="root" MYPWD="PASSWD" ARGS="--single-transaction --flush-logs --complete-insert" DATABASES=$( mysql -D mysql --skip-column-names -B -e 'show databases;' | egrep -v 'information_schema' ); BACKUPDIR=/var/backups/mysql YEAR=$(date +"%Y") MONTH=$(date +"%m") DAY=$(date +"%d") DATE="$YEAR-$MONTH/$YEAR-$MONTH-$DAY" mkdir -p $BACKUPDIR/$DATE cd $BACKUPDIR/$DATE for i in $DATABASES ; do   echo -n "backing up $i: schema..."   mysqldump $ARGS --no-data -u$MYUSER -p$MYPWD $i > $i.schema.sql   echo -n "data..."   mysqldump $ARGS --skip-opt --no-create-db --no-create-info -u$MYUSER -p$MYPWD $i > $i.data.sql   echo -n "backup full databases"   mysqldump $ARGS -u$MYUSER -p$MYPWD $i > $i.full.sql   echo -n "Backup views"