Thursday, February 18, 2016

Page source fetch from WebView or UIWebView

On both Android and iOS, it is possible for an application to obtain page source from a browser view.

For Android,
http://lexandera.com/2009/01/extracting-html-from-a-webview/


For iOS,
http://stackoverflow.com/questions/5167254/getting-the-html-source-code-of-a-loaded-uiwebview

    NSString *yourHTMLSourceCodeString = [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.outerHTML"];       

Question:  How to with WKWebView?

Monday, February 15, 2016

VMware Player add brigde

Typically, VMware uses VMnet0 as bridge device.  After installing the latest VMware player, there is no VMnet0 showing up.

Here is a procedure to create a VMware bridge on a physical device.

Right click on a network device and select property
Click Install
Select Service and Add...
Select VMware and install VMware Bridge Protocol.


Virtualbox guest Yosemite

VBoxManage.exe modifyvm Yosemite --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
VBoxManage setextradata Yosemite "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
VBoxManage setextradata Yosemite "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata Yosemite "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata Yosemite "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata Yosemite "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

Thursday, February 11, 2016

ebtables and iptables

These two commands are basic firewall configuration commands.

Show command help information
iptables -h
ebtables -h

Samples
1) block ip output traffic on port 4002
iptables -A OUTPUT -p ip --dport 4002 -j DROP

2) block ipv4 (udp) forwarding traffic on port 4002 and on mac ID 00:20:c0:01:7c:21
ebtables -A FORWARD -p IPv4 --src 00:20:c0:01:7c:21 --ip-protocol udp --ip-source-port 4002 -j DROP

More information
http://ebtables.netfilter.org/misc/ebtables-man.html
http://ebtables.netfilter.org/examples/basic.html
https://en.wikipedia.org/wiki/Iptables
https://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg


Saturday, January 30, 2016

Windows 10 MBR recovery

Well, after dual boot with GRUB, if the corresponding Linux partition is deleted, the windows MBR must be recovered in order to boot up.


1. get Microsoft media creation tool
2. create a installation USB
3. boot from USB UEFI
4. choose recovery / advanced option
5. In the cmd, type "bootsect /nt60 <drive_letter>: /mbr
6. exit cmd
7. reboot


Tuesday, January 26, 2016

Secure Ubuntu Server

There are some basic stuff mentioned in the following URLs.
https://www.thefanclub.co.za/how-to/how-secure-ubuntu-1204-lts-server-part-1-basics
https://www.thefanclub.co.za/how-to/how-secure-ubuntu-1204-lts-server-part-2-gui-installer-script

There are some more.
1) Disable USB boot.
If USB boot is enabled, outsider can simply boot machine with their USB bootable image.  Then, everything will be exposed.

2)