Visual Portfolio, Posts & Image Gallery for WordPress
Working from home has been working well for me for the past year, with a thankfully stable and decently fast Internet connection. However, a recent service issue has led me to try some alternatives and finally set up a backup connection using a Teltonika RUT240 router with a 4G failover. I also cover having a look at the business packages provided by the ISP.
Date 4 years ago
Views 239 Views
Reading Time < 1 Min Read
During some recent work, I’ve had the need to automate a large number of Google searches for further analysis. Lamprey is the result of that effort and it is shared here in the hope it might be useful for someone else.
Date 5 years ago
Views 162 Views
Reading Time 2 Mins Read
Player guide for Artificing, a new system which I have developed for the Dark Age Ultima Online shard. This expands the previously existing crafting and magic systems to allow players the ability to customise their gear further, as well as providing long-term incentives in the PvE realm.
Date 5 years ago
Views 168 Views
Reading Time 4 Mins Read
Motivation With my laptop being more of a coffee table which can be moved rather than a portable device (with a comparable battery life), I was wondering if it was possible to get a Linux distribution running on my Android phone, a Huawei P10 with Oreo 8.0.0. This article tries to unify all the various sources I’ve had to use to get this to work and hopefully it will be of use to someone else, either as-is on a Huawei P10 or as a base for a similar device. Backup the device The process we’ll be undergoing will cause the contents of the phone to be wiped, so ensure that you backup your phone. The Huawei backup is more thorough than Google’s, so grab Huawei’s HiSuite, connect your phone to the computer via a USB cable and perform a backup. We’re about to flash the phone and this is not without risk. Don’t proceed if you’re uncomfortable with this and potentially with voiding your warranty. Setting up the Android Debug Bridge (ADB) On the Huawei P10 Go to the Settings application. From there, go to the System submenu and then to About. Tap the Build number option 7 times to enable the Developer Mode. You’ll get asked for your PIN after the 7th tap. Back in the System submenu, at the bottom, you’ll have a new Developer Options. Ensure these options are on: Enable OEM unlock and USB debugging. When asked, allow USB debugging from the PC you’re connected to. On the PC We will need to download the Android Debug Bridge, which you can get from Google’s repository. Once you extract the ZIP file, open a command line and navigate to the extracted folder. You should see your Huawei P10 listed if you run the following command: adb devices Unlocking the bootloader Before we can root the phone, we need to unlock the bootloader. This used to be fairly straighforward: Huawei provided a webpage where you could request the unlock code. However, the company has changed tack and decided to stop providing these codes (“to provide better user experience and avoid issues caused by ROM flashing”), which makes the whole process considerably more awkward: we’ll have to hit the grey market. Begin by downloading DC-unlocker, which we’ll use to extract the bootloader code. This is unfortunately not free, you will need to buy 4 credits (USD$ 4.00) to be able to do this. You can create your account and purchase the necessary credits from this page. In DC-unlocker, login with your credentials in the Server tab and set Select manufacturer to Huawei phones. Follow the instructions at the bottom of the program to enable the Manufacture mode before performing the automatic model detection. Once the exact phone model has been detected, go to the Unlocking tab and select Read bootloader code. You should see something like: =================================================================== Reading bootloader code… Bootloader code : 8297165235###### =================================================================== Now that you have the bootloader code, it is time to make use of the Android Debug Bridge we’ve set up earlier. From the command line, run the following command and wait for your phone to reboot: adb reboot bootloader Once you’re in the bootloader, you can finally perform the unlock operation: fastboot oem unlock code_you_got_from_dc_unlocker Rooting the device Normally we’d look at getting something like TWRP as a custom bootloader as a step to root our phone, but the Huawei P10 isn’t a supported device. After some trial and error with various experimental bootloaders, I’ve found one which successfully rooted it rather than leaving the phone on a reboot loop. Boot the phone into the bootloader once more via adb reboot bootloader Download FHMate10Tool (made by FunkyHuawei and meant for the Huawei Mate 10, but works just as well with the P10). Extract and launch FHMate10Tool.exe. Choose option 1, Root your Mate 10. This will reboot your phone twice, after which it will be rooted. Your phone’s drive will be wiped in the process. Restore from backup At this point you can restore your previously created backup, getting your Android environment up and running once more. You will also have to disable system updates by going to Settings, then System update and from the top right menu, Update settings. Turn off Auto-download over Wi-fi. Otherwise you will be asked to apply an update which will actually reset your device and strip the root rights, forcing you to go through the rooting (and wiping!) process once more. Installing Kali Start by downloading Linux Deploy from Google Play into your phone. When you launch it, you should see something like this: When you press the bottom right icon (Properties), set the following parameters: Distribution: Kali Linux Installation path: /storage/emulated/0/linux.img Image size (MB): 8gb (can be changed later) User name User password SSH: Enable Then press the top-right icon and select Install. The process should take between 10 and 15 minutes, assuming a good connection. Bringing it all together Now that we have Kali up and running, we can connect to it via SSH, either from a different device or from the mobile phone itself. I’m currently using ConnectBot to connect to Kali. I’ve also purchased a Limxems folding keyboard, which connects to the phone via Bluetooth. Of particular note is that it has an in-built shelf on which the phone can sit, effectively creating a mini-laptop with an excellent battery life. Install tmux and you’re good to go. With the base Kali installed, I recommend against installing any of Kali’s metapackages as these are all sizeable and the Huawei P10’s storage space is limited. Additionally, the metapackages will bring quite a few packages which require a graphical user interface and although it is possible to VNC into Kali, you’ll definitely run into storage issues. Some packages also do not exist for AMRv7, e.g. burpsuite or hashcat. For wireless tools such as aircrack-ng, you’ll need an external wireless device, as the wireless chip in the P10 does not support monitor mode. I’ve only been using this setup for a few days, but I’m using it to tackle some of the boxes in hackthebox.eu and it has been working quite well.
Date 6 years ago
Views 179 Views
Reading Time 4 Mins Read
This is hardly news: people like to connect stuff to the Internet. The ones I’ve always found the most interesting are IP cameras, which people knowingly or unknowingly have left publicly accessible. For more than 10 years many of these could be found via well-targeted Google queries and nowadays Shodan will do some of the heavy lifting. However, I’ve always wanted to write a program which would automate this search and present the results in an usable way: present a map of Earth, lay down all the cameras and then be able to click on them and begin streaming. There were three important considerations when deciding on how this program would be made: It must run locally rather than being an online service. Needs to run on both Windows and Linux. Must not require elevated privileges to run. Underlying technology C++17 This is being written in C++, more specifically the C++17 variant. This lets me write code which can be (mostly) shared between Windows and Linux, without requiring too many platform-specific implementations. SDL Using SDL provides the basic window creation, OpenGL backed rendering and input handling, without having to deal with the OS implementations. SDL_image A support library for SDL, SDL_image is capable of loading image files. Since I wanted to have a map of Earth, having to store everything as BMPs (supported by the base SDL) would mean a pretty large download. SDL_image allows me to load other image formats, such as PNG or JPG, with a minimum amount of extra code. sqlite3 Given that Watcher needs to scan the internet to find accessible cameras, this information has to go somewhere. To keep the required set up needed in order to be able to run the program, I’ve settled on sqlite3 as a database backend as it just stores the database as a regular file. Getting sqlite3 to perform properly has required some care, as it is easy to rack up write requests when there are large amounts of threads doing work. I’ll go into further detail about this in a future post. curl The ever-dependent curl is used to download pages from HTTP servers we find and certain types of camera streams. nlohmann::json Niels Lohmann’s JSON library handles reading and writing of JSON streams, which are used in various configuration files and as result of geolocation queries. imgui The user interface is handled by Omar Cornut’s imgui library. Although meant for debug tooling, it is straightforward to use and for the purposes of this application, it provides more than enough functionality. Basic architecture One of the ideas of Watcher is that it retrieve data from several sources, as well as be able to stream video feeds when an open camera is detected. It uses a plugin system with each plugin (in the form of a DLL or SO) providing additional functionality without having to recompile the main program. The normal flow is currently like this: A scan is requested. Watcher keeps track of which address blocks haven’t been scanned yet and picks one at random. Either zmap or my own basic scanner handle the actual probing, looking for HTTP servers at selected ports (currently 80, 81, 8080). Any detected HTTP servers get stored in the database for processing. Multiple threads initiate a download of the index page of these servers. These pages are parsed against a ruleset which identifies cameras. The vast majority of the relevant pages have title tags which can be used as identifiers. Results are stored in the database for geolocation. An online service is used to geolocate IP addresses so they can be presented in the world map. Next steps Having a functional atlas so we can scroll and zoom in. Being able to pick individual cameras from the map. Streaming open cameras and present the stream within the program. Open Source? The plan is to release the code under the GPL once the code is somewhat more sane. There’s been a great deal of prototyping going on so the conceptually pure architecture and the reality are still somewhat at odds.
Date 6 years ago
Views 216 Views
Reading Time 3 Mins Read
Work in progress
To top