Categories
Android

Monitor Android network traffic with Burp

We can sniff all traffic that is happening on our Android phone. The idea is by connecting our phone to a proxy that acts as MITM or Middleman. Same as Pi-hole able to showing all log DNS queries, Burp can be acting as proxy software to capture all traffic that comes to it.

Here is how it works from a high-level. Our phone connects to the internet as usual via the router. To monitor the traffic, we shall route our request to a single place, called a proxy server. This proxy will capture and have the ability to intercept the traffic and sending it to the internet. The response from the request is also going into the same channel flow.

Android Phone (Use Proxy’s Cert) —> Proxy —> Internet

How to ensure this solution works for HTTPS, which encrypted with certification? To make this works, we need to inject our certification into the device and make it trusted (There will be step for that). If our own certification acknowledged by the device, then we can decrypt the traffic from the server that issued the certification.

Categories
Networking

Install Samba Ubuntu 20.04 and Windows 10 Sharing

Here is a step guideline to install Samba in Ubuntu 20.04, Focal Fossa, to enable sharing with Windows 10 as the client. I write this article to help people solving problem around:

1. Windows 10 not connecting properly with Samba 4.7.6 on Ubuntu 18.04
2. Ubuntu 16 Samba server with Windows 10 client – Tutorial/Howto
3. I can’t get Win10 PC to Access Ubuntu 18.10 Samba Shares
4. Cannot access smb share from Windows 10
5. Fixing broken Samba File Share access for Linux hosts after installing the latest version of Windows 10

In this case, I didn’t change Windows features for Samba v1 or change regedit configuration. This is works on pure Windows 10 and Ubuntu 20.04 without additional changes

Here are the steps on “How to install Samba on Ubuntu 20.04 and Fix Sharing with Windows 10”

Categories
Networking

Install Pi-hole on Ubuntu 20.04 Laptop via Wifi

After reading about Pihole + Raspberry Pi to filter traffics from DNS level without installing any client-side software, that inspires me to try the same. Several questions that pop-up in my mind in the meantime I’m browsing Raspberry Pi B. I researched all those questions in my mind and found several answers.

Update: https://pi-hole.net/2020/05/10/pi-hole-v5-0-is-here/#page-content

  1. Can we use Pi-hole without Raspberry?
    Yes, we can use Pi-hole without buying raspberry. You can save your money here. Don’t buy Raspberry yet if you have an unused old laptop or old macbook pro / macbook air (with Ubuntu or Linux installed of course)
  2. Can we use Ubuntu Laptop as our Pi-Hole router?
    Definitely, we can. Pi-Hole is software that is acting as DNS provider. Either you installed in Raspberry Pi or Laptop, it’s the same.
  3. Can we use wifi / wireless instead ethernet LAN cable connected to the router?
    Yes. Although on the internet there is several arguments about ethernet cable vs. wireless, I found it there no significant difference. In the beginning, I thought I going to need a laptop with LAN port to install Pi-HOLE.
  4. Do I need to change my router configuration?
    This guide will help you to install PI-Hole without need to change your router configuration. This is my problem earlier because I found that my router being locked and no option to change the DHCP.
  5. Is USB installation required here?
    No need, unless you want to install Raspbian OS rather ubuntu.
Categories
Mandarin

Fix “UTF8” encoding “WIN1252” CPutf8 PostgreSQL Windows 10

Today I found very weird errors when importing database from Ubuntu to Windows 10 (Chinese language / locale). It’s showing multiple errors start from

locale "English_United States.utf8": codeset is "CPutf8"
Character with encoding UTF8 has no equivalent in WIN1252
ERROR: character with byte sequence 0xe9 0x94 0x99 in encoding "UTF8" has no equivalent in encoding "WIN1252"
character with byte sequence 0xe9 0x94 0x99 in encoding "UTF8" has no equivalent in encoding "WIN1252"

This errors occur because the collate and ctype on current OS have different type than from another database (which is UTF8).

Categories
Elixir

Install Elixir Phoenix Framework in Ubuntu 20.04 Focal Fossa

Here is a quick steps of Phoenix Framework installation in Ubuntu 20.04 – Focal Fossa ready for website development. In summary, the steps will install the Erlang, Elixir, Phoenix Framework and PostgreSQL.

1. Erlang and Elixir Installation
First, lets install Erlang. When the pop-up of codename appear, please input Ubuntu 20.04 Codename which is “Focal”:

sudo dpkg -i erlang-solutions_1.0_all.deb 
sudo apt-get update
sudo apt-get install erlang
sudo apt-get install elixir
sudo apt-get install git vim
Categories
Mandarin

Windows 10 Software Term Mandarin Chinese English – Part 1

I have changed all my Windows 10 language to Mandarin as part of practicing “普通话”. It’s very hard for me to find databases that show the software or desktop translation from Chinese to English. This is including common software like Words, Excel, Teams Chat, Outlook, and Calendar.

Here is part one in which you can learn :

New file新建Xīnjiàn
Open打开dǎ kāi
File文件wén jiàn
Download下载xià zǎi
Document文档wén dàng
Images图像tú xiàng
Photos照片zhào piàn
Categories
Rust

Convert slices into String in Rust

I found it hard to find a single article to explain how to convert or merge slices to string in Rust. Here is an example of how to do it:

let row_content = &row.iter().map(|highscore| highscore.to_string()).collect::>().join(",");

I hope this helps someone who wants to concatenate slices/list in Rust into delimiter comma-separated string or only space.

Categories
Rust

Install Rust Diesel in Windows 10 and Fix Issue

Installing Diesel CLI in Windows 10 can be troublesome sometimes. When I did execute this command “cargo install diesel_cli –no-default-features –features postgres” and receive error message:

note: Non-UTF-8 output: LINK : fatal error LNK1181:error: linking with `link.exe` failed: exit code: 1181

I have tried to debug it with the various approach by:

So, I did reset my Windows 10 language and downloaded the gigantic Microsoft Visual Studio 2019 with “VC++ 2015.3 v14.00 (v140) toolset for desktop”. I did re-install rust with the hope it will solve the issue.

None of the above is works until I found someone wrote an article on how to install Diesel in Windows 10 and enable it’s CLI with the help of setup the local variable PATH.

Categories
Elixir

Simple upload file local Phoenix Elixir

There is a lack of information on how to do simple upload form in Phoenix Framework and store file into local storage. Although people recommend using Plug or external libraries, sometimes is useful to understand how essential thing work like upload image or PDF can be done using few Elixir scripts.

In this tutorial, I’m using an example of Hello project from Phoenix’s installation guideline. If you don’t have the project yet, please set-up by yourself since this tutorial does not cover it.

In the beginning, let write a path to access the upload page in the router, “lib/hello_web/router.ex”. Let use “upload” as the access path

  scope "/", HelloWeb do
    pipe_through :browser

    get "/", PageController, :index
    resources "/upload", UploadController, only: [:index, :create]
  end
Categories
Elixir

Phoenix Elixir Installation in Windows 10

Here is the full guide on how to set up and install the latest Phoenix Web Framework and Elixir in Windows 10. In this case, I’m using Windows 10 as my day to day software development environment. Please follow the steps below:

In summary, to build a new Phoenix application, we will need to install a few software :

  • the Erlang VM and the Elixir programming language
  • PostgreSQL as default preferable database
  • Node.JS for assets – which can be opt-out, especially if you are building APIs
  • Phoenix Framework
  • Cmder (my favorite terminal in Windows)