Categories
Software

Active Directory re-design in production

The topic hook here, is redesigning the Active Directory Object Units of an existing network. Really, OUs are like Subfolders of a Windows User and Computer tree / list. I am working with a live domain structure, so more important before making any changes, is knowing and documenting how it was / currently is. This being in case you move something and it breaks.
Especially 3rd party applications linked into Active Directory, and the OU path is like a network or folder path, if the lookup is where it assigns user permissions via the AD / LDAP (Lightweight Directory Access Protocol) / Windows Challenge/Response (NTLM) mechanisms. Point here being, if you assign permissions to a user as below, moving them to a new OU and not updating that lookup in an app can break it, unless it verifies the current path of that user account in its NTLM-esc lookup.

DomainTree.localOU_NameObject_UserAccount

Point being, if I move the Object_UserAccount into a different OU or a deeper subfolder / OU on that domain, that lookup may very well be broken for the 3rd party app, using AD for it’s lookup.

That is kind of long in the teeth, but in Windows land, especially when changing domain structure around, you can get some nasty snags. Documenting is as it was, lets you see if the old path is defined in whatever 3rd party app or device you are working with.  Also applicable, are Group Policies and where they apply.  Group Policy Editor on a domain controller will let you see what ones are applied and what OU they are nested under.  Group Policies are a step of this, but I am not focusing on these for this thread.  Knowing the old policies they apply to, will be helpful on your rollout, as in my case, some departments have printers autoinstall, based on their location.  I note this to troubleshoot or recreate that behavior on the new side of domain OUs.

Tools:
csvde.exe: This C(ommand L(ine) I(nterface) tool will let you connect to your domain.local, while picking a root OU, to then export all those details to a CSV file.  Along with some screenshots of the tree structure, this is a great method to know what OU path a user was in, before you redesigned the trees and moved users around.  This in especially the case, of someone’s windows or other app, stopping to work, upon you moving their account or machine around in the domain tree.

Excel or Libre based office spreadsheet program:  I use these especially in migrating a live domain to a new server.  You have to clean the AD export up to 8 relevant columns, as the rest of the data is made by the new domain controller, thus importing the old stuff will just fail.  Rambling point here, is that when you import a new domain controller to an existing domain, it will inherit the security level of the prior domain.  Server 2012 running on a Windows 2003 Domain Forrest level?  No thank you, please don’t even.
You can and likely will use the spreadsheet program for reference in the future, either to make sure you moved the user from old to new, correct path, or to debug why an app may have stopped working, and trend a fix for anyone else who may have the same issue.

Great.  We have a dump of users with their original path (in my case, over 100 sub-OUs for maybe 20 different business units.).  Sometimes, people over-design systems.  It can be intentionally confusing to dissuade others from making changes, or simply be over-designed for some fantasy scope projection of future growth, instead of something that works with their current, yet is still scaleable for later add-ons.  In my opinion, empty folders are a BAD design call, especially in OUs.  Sometimes the path is limited to a certain amount of characters, so 50 of them characters being empty sub-folder paths, is just a shitty design call.

Categories
Hardware Software

Tor browsing via Raspberry Pi

I recently explored setting up an OnionPi to be a dedicated device for browsing .onion sites and obfuscating the source IP address. Just to say it, you don’t have to be doing ‘criminal’ stuff to be using tor. I just wanted to get that out there and encourage more people to explore the ‘darknet’ / ‘deepweb’ / etc. I followed an Adafruit guide on setting up my OnionPi. I will describe more about the device, how it functions and some extra feedback, relating to the guide on installation.

Presuming you have a Raspberry Pi and supported Wireless adapter, you will be plugging in a wired internet cable to your Pi, that will share the onion-routed internet connection over wireless. Once you complete the configuration and install steps, your Pi will be ready to route your wireless traffic over TOR.
If you are more curious about tor and what it is about, checkout https://torproject.org/.

The guide I worked from is this link on AdaFruit. The kicker here, is that you really need your Wireless setup for the Tor install process to work and for the Tor service to work properly. So really, You want to start with installing WiFi and DHCP support.
Before you start, be sure to set a custom password for root and pi accounts on your Raspbian (or whatever you choose) OS.

I did not run the installation script, since I figured it would be easier to troubleshoot if I manually ran each step / configuration command. Besides I got to learn in the process of manually following along, so win bonus.

Once you setup your WiFi Access Point, go for the Tor install and configuration. Once done, fire up the service and check your internet-facing IP (WhatisMyIP or any similar site will do). You will also know you are on Tor, because CAPTCHA prompts will be more common in your browsing.
A fun little fact I noticed, is to browse .onion pages, you still want to have the Tor Browser installed. Any other browser will still benefit from an obfuscated IP Address, but you will get an error trying to browse to .onion sites.

One of the main benefits of setting up a hardware-based Tor device, is you can connect whatever wireless enabled device you wish to it. There have been many write-ups and conversations about the Tor Browser alone, being vulnerable to leaking data… especially if your connection is not fully-routed through an onion router. Not to say using an onion router is 100% untraceable, but every little bit helps.

Extra notes, that really apply to any web browsing, is to install add-blocking plugins. Advertising has been a known attack vector for years now and it only becomes more common. Visitors to this site may be aware of my lack of love for online advertising. Different strokes for different folks and all of that.

To conclude this post, I also want to mention Tails. This is a USB based operating system that is very handy in browsing tor, especially on the go. If you want to use your own OS and applications on the tor network, that is where the extra work of setting up an OnionPi (Raspberry Pi Device with Tor installed) is helpful to you.

Categories
Hardware Software

Encrypt stuff guide

This thread will be a collection of resources on how to use encryption, tool use suggestions and where possible, usage explanations.

I’m fine with reading technical documents, however I also value time and the ability to convey a point, without a huge time investment. The easier and more clearly encryption can be used, the better everyone will be.
Be it an individual or some sort of state agency / boogeyperson, more layers and protections are a good thing. Having protections does not make one a criminal, either.

CryptSetup LUKS guide. There are command syntax examples and console response dialogs.

Cryptsetup is nice, as it also handles mounting of drives and partitions. If you are unable to mount a drive, you will likely need to install cryptsetup. This should also work to mount any TAILS persistent volumes you have setup.
For more info on DM-Crypt (cryptsetup), the Arch wiki is a great resource.

Samples of flow (1st link)
01 step: install cryptsetup (dm-crypt)
02 step: confirm your drive target and valid partition (gparted or parted to get your /dev/(drive))
03 step: initialize your drive

# cryptsetup -y -v luksFormat /dev/xvdc

(This is setting up your passcode to access drive)
04 step:

# cryptsetup luksOpen /dev/xvdc backup2

(Mounts newly configured drive)
05 step: format the LUKS partiton (needless to say, you really want to have the correct drive or you have lost data on the drive you are using)

# dd if=/dev/zero of=/dev/mapper/backup2

(This will take quite some time. Let the cursor do it’s work, check your hdd led to confirm activity)

Categories
Hardware Software

UEFI Windows Installing

Howdy. My latest adventure is setting up a HP ProLiant ML150 Server with Windows Server 2012. I keep forgetting how I get workable USB install media, so I am making a guide to that effect.

Starting off, there used to be a MS ISO to USB Making Tool, however it fails to make the USB stick from the .iso with an nondescript message. So to make a working, UEFI compliant boot USB stick, we are going to format is as FAT32. This is very similar to setting up a Raspberry Pi SD card as well. However using a Windows Install CD and Win32DiskImager does not work, so to get it working:

  • Open Command Prompt in elevated mode (Run as Administrator)
  • Type diskpart and press Enter
  • Type list disk and press Enter. Note the list of existing disks.
  • Insert the USB Disk.
  • Type list disk and press enter again. Note the new disk showed up which is our USB disk. I assume the new disk is 2 for example purpose.
  • Type select disk X where X is your USB disk. E.g., select disk 2. Press Enter.
  • Type clean and press enter.
  • Type create partition primary and press enter to create primary partition 1.
  • Type select partition 1 and press enter.
  • Type active and press enter to make the partition 1 active
  • Type format fs=fat32 quick (Or use the Right-Click step to quick format).
  • Exit diskpart.
  • (or instead of format in diskpart) Right-Click the drive in (My) Computer and do a Quick Format to FAT32.(Otherwise it will not UEFI Boot, only legacy boot)
  • Extract the contents of the .iso and copy them to the root of the USB stick (Use 7zip or Winrar like archiver tools)

Re-written steps thanks to the following guide. I use quick format, as a full format on multiple GB drives, takes quite a long time for no real good reason.

Without over-complicating why you want UEFI for more recent device boot options, you will have a worse time trying to legacy boot an install on a UEFI BIOS enabled system. Thus installing from UEFI media works the best to avoid issues. Luckily Kali and Ubuntu work out the gate with UEFI, so long as you boot the CD Drive / USB as a UEFI target. This allowed me to remove Windows 8.1 from a 2 in 1 tablet and make a Kali / Ubuntu multi-boot instead.

Categories
Software

Powershell Windows Support

Real quick and dirty, I wanted to note this Chart of Windows Powershell supported operating systems. If you run into some Server 2008 instances, you will want to enable Powershell in Programs | Add Features of your control panel.

Server 2008 R2 ships with Powershell, but Non-R2 versions look to need having it enabled for support. Be warned, some installers just presume powershell is installed, and will error out when that package is running. Happy Admining. :)

Categories
Software

Mozilla Profiles

So I did a reinstall and forgot to run MozBackup on my old OS before I wiped it. I did however get a drive backup and copy of my C:Users folder.

Turns out with Mozilla (browsers and email clients) you can copy the contents of the profile folder, into the new one. The folder name should remain the same on the new PC, so copy the contents of the old profile into the new one.

C:Users$Username$AppDataRoamingMoonchild ProductionsPale MoonProfiles$string$.default

This will restore all your history, logged in sessions and likely saved password, if you do the saved password thing.

I found it amusing that a new machine with the folder contents copied over, registered as the same machine. Interesting vector if you are an exploiter or hand lots of system deployments with data migration.

Remember, what is nefarious for one person, can be used to help someone else out.

Replace the Pale Moon path with a relevant Firefox install directory. It will also live in the Roaming portion of your profile AppData folders. Pale Moon is a forked browser based off Firefox.

Categories
Software

Botnet infection sample and removal

Botnet Removal Overview

This thread is an overview on how to detect, identify and remove a botnet infection. This is merely one example of such an infection. Honestly the main reason I was able to detect it (before it was added to malware definition databases), is because of it’s aggressive processor use. Bitcoin miners are extremely intense processes, to 98% CPU usage stood out like a sore thumb.

This will be a 5-step & thread process on how I went about checking around and figuring out how this bitcoin miner was operating. There are various ways to go about the same methods, but I am sharing mine, in hopes it helps someone remove similar trash in the future. I will make a post in this thread for each process, to help describe the methods used, and hopefully do so in a clear manner.

Steps used:

As for any infection, you have to be formidably sure you completely removed the infection, otherwise you are waiting for more damage down the road. Do you wish to reinstall the OS, or do you feel confident the exploit has been removed? This question is especially relevant in the business environment. Luckily I saw this on my personal machine, so I could afford more time to debug what was happening and log it.

The attached picture should make more sense as you read each progressive step.

Attached Thumbnails

  • Anon-Pic0o-BingoInfection.png

Categories
Software

Say you want to recover a saved password from Windows

Quick info as I forgot my Windows password and was going to fetch it from a saved Remote Desktop Protocol connection file (RDP). I have done this in the past to grab saved credentials from Windows Services using Run As User credentials. Theoretically, you could find the same for stored network shares too. I presume this still works for Windows 7 to 11 but now a days, this NirSoft recovery tool from 2014 flags as “malware”.

You can grab Remote Desktop PassView from NirSoft but you will likely need to disable defender to make it run. I made this thread as it followed my mental rule for making a note of something handy I used in the past.
In my recent Windows 11 case this week, I forgot my main user password but logged in from another PC with saved RDP credentials, changed the password on a second local admin ( You can change another user’s password without their old one, but while logged in locally as the same user, you need the current ( forgotten temporarily ) to change the current pass.
Logging in as second admin, I could then reset local admin password to something new, without the existing pass being needed.

I just made a crabby twitter comment ( as opposed to any other kind on there? ) about many No-CD fixes getting spirited away from Windows 7 onward and Defender’s choice for ‘bad files’. Typically removed with no notification or direct logging either. If you like it and want to archive it, store it on a Non-Windows based file server.

Bonus random note of old: If you are logging into another device without a domain, you can set your username and password to the same on local and your network share or what have you. Most all the time, you will be able to connect without being prompted for a password, since they are already the same.

Fun WiFi migration? Set your Access Point ( AP Network Name ) and password to be the same as a Wifi network you have already connected to. Your devices will be on the new access point without issue, most of the time. There are extra settings that could handle this change but the likelihood of them being a factor are very low. Save time migrating off access points and testing things or pretending to be an existing network,

Auto-connect being a client default makes this extra handy based on whatever you may be working on or with.

Categories
Software

CarrierIQ Malware

I dropped some FB links on this software, but since the vendor attempted to shut down the researchers info, I feel it necessary to share more info about this malware, and it’s auditing functions.  Let’s not mash words here, this is certainly some nasty rootkit action on android devices (and who knows what else).

Video of Rootkit in action.

Original info list with debug list of features can be found here.

For anyone who thinks of their phone as more secure than a regular PC, please think again.