Sunday, February 16, 2020

Current Audible Reading List


Title
You Never Forget Your First: A Biography of George Washington
A Self-Made Man: The Political Life of Abraham Lincoln, 1809-1849
The Right Kind of Crazy: Navy SEAL, Covert Operative, and Boy Scout from Hell
Overthinking: How to Declutter and Unfu*k Your Mind, Build Mental Toughness, Discover Fast Success Habits, Thinking & Meditation, Mindfulness for Creativity, Slow Down the Brain and Be Yourself
Stop Doing That Sh*t: End Self-Sabotage and Demand Your Life Back
We Are Anonymous: Inside the Hacker World of LulzSec, Anonymous, and the Global Cyber Insurgency
The Dichotomy of Leadership: Balancing the Challenges of Extreme Ownership to Lead and Win
The Cyber Risk Handbook: Creating and Measuring Effective Cybersecurity Capabilities
151 Quick Ideas for Delegating and Decision Making: 151 Quick Ideas Series
Tools and Weapons: The Promise and the Peril of the Digital Age
Breaking and Entering: The Extraordinary Story of a Hacker Called "Alien"
Cult of the Dead Cow: How the Original Hacking Supergroup Might Just Save the World
12 Rules for Life: An Antidote to Chaos
Permanent Record
Unfu*k Yourself: Get Out of Your Head and into Your Life
Call Sign Chaos: Learning to Lead
The Home Front: Life in America During World War II
Click Here to Kill Everybody: Security and Survival in a Hyper-connected World
Dawn of the Code War: America's Battle Against Russia, China, and the Rising Global Cyber Threat
AI Superpowers: China, Silicon Valley, and the New World Order
Snow Crash
Saving Bravo: The Greatest Rescue Mission in Navy SEAL History
Spearhead: An American Tank Gunner, His Enemy, and a Collision of Lives in World War II
Cybersecurity Program Development for Business: The Essential Planning Guide
The Making of a Manager: What to Do When Everyone Looks to You
Elizabeth II: Life of a Monarch: An Audible Original
The Dispatcher
Essential CISSP Exam Guide: Updated for the 2018 CISSP Body of Knowledge
Junk
A Mind of Her Own
Drug Warrior: Inside the Hunt for El Chapo and the Rise of America's Opioid Crisis
Turing's Cathedral: The Origins of the Digital Universe
The Physics of Star Trek
Exploding the Phone: The Untold Story of the Teenagers and Outlaws Who Hacked Ma Bell
NLP: The Essential Guide to Neuro-Linguistic Programming
The Way of Men
The Art of War
Rise of the Machines: A Cybernetic History
Conversation Casanova: How to Effortlessly Start Conversations and Flirt Like a Pro
Hackers: Heroes of the Computer Revolution: 25th Anniversary Edition
The Alpha Male's Guide to Mastering the Art of Body Language
The 40 Laws of the Alpha Male: How to Dominate Life, Attract Women, and Achieve Massive Success
48 Laws of Power
Putting Stories to Work: Mastering Business Storytelling
The X-Files: Cold Cases
The Coming Storm
Beyond the Phoenix Project: The Origins and Evolution of DevOps
The Phoenix Project: A Novel about IT, DevOps, and Helping Your Business Win 5th Anniversary Edition
How to Measure Anything in Cybersecurity Risk
Spam Nation: The Inside Story of Organized Cybercrime - from Global Epidemic to Your Front Door
The Art of Deception: Controlling the Human Element of Security
Atomic Accidents: A History of Nuclear Meltdowns and Disasters; From the Ozark Mountains to Fukushima
Social Engineering: The Art of Human Hacking
Cybersecurity and Cyberwar: What Everyone Needs to Know
Red Team: How to Succeed by Thinking Like the Enemy
Tor and the Dark Art of Anonymity: How to Be Invisible from NSA Spying
A Generation of Sociopaths: How the Baby Boomers Betrayed America
Tor and the Dark Net: Remain Anonymous and Evade NSA Spying
The Art of Invisibility: The World's Most Famous Hacker Teaches You How to Be Safe in the Age of Big Brother and Big Data
One Second After
Star Raider
Economics in One Lesson
Go the F--k to Sleep
Your First Listen

Sunday, June 23, 2019

autossh systemd startup

/etc/systemd/system/autossh.service

################################################################################
#
#
#
################################################################################
[Unit]

Description=AutoSSH tunnel service for AWX C2
After=network-online.target

[Service]
Type=simple
User=<username>
Environment="AUTOSSH_GATETIME=0"
Environment="AUTOSSH_LOGLEVEL=7"
ExecStart=/usr/bin/autossh -M 0 -N -T -q -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" awslnx001

[Install]
WantedBy=multi-user.target


config:

Host rlgway
    Hostname x.x.x.x
    User <username?
    Port 22
    IdentityFile ~/.ssh/<file>
    GSSAPIAuthentication no
    GSSAPIDelegateCredentials no
    RemoteForward 2223 localhost:22

Saturday, April 27, 2019

Ansible to Windows via Kerberos

#####
##### krb5.keytab w. spn stored securely
#####
root@ldaptest:/home/YHL.LOC/ansible/playbooks# klist -k /etc/krb5.keytab
Keytab name: FILE:/etc/krb5.keytab
KVNO Principal
---- --------------------------------------------------------------------------
   1 ansible@YHL.LOC

#####
##### krb5 klist after logged in
#####
ansible@ldaptest:~/playbooks$ klist
Ticket cache: FILE:/tmp/krb5cc_657801107_o9jMRd
Default principal: ansible@YHL.LOC

Valid starting       Expires              Service principal
04/27/2019 22:50:06  04/28/2019 08:50:06  krbtgt/YHL.LOC@YHL.LOC
renew until 05/04/2019 22:50:05

#####
##### ansible hosts
#####
[all]
dnsdc01.yhl.loc
dnsdc02.yhl.loc

[all:vars]
ansible_user = ansible@YHL.LOC
ansible_connection = winrm
ansible_port = 5985
ansible_winrm_transport = kerberos
#ansible_winrm_cert_validation = ignore
ansible_become = false


###
### ansible-playbook run
###
ansible@ldaptest:~/playbooks$ ansible-playbook -i hosts ipconfig.yml

PLAY [ipconfig module] *********************************************************

TASK [setup] *******************************************************************
ok: [dnsdc01.yhl.loc]
ok: [dnsdc02.yhl.loc]

TASK [run ipconfig command] ****************************************************
changed: [dnsdc01.yhl.loc]
changed: [dnsdc02.yhl.loc]

PLAY RECAP *********************************************************************
dnsdc01.yhl.loc            : ok=3    changed=1    unreachable=0    failed=0
dnsdc02.yhl.loc            : ok=3    changed=1    unreachable=0    failed=0

#####
##### klist post ansible run
#####
ansible@ldaptest:~/playbooks$ klist
Ticket cache: FILE:/tmp/krb5cc_657801107
Default principal: ansible@YHL.LOC

Valid starting       Expires              Service principal
04/27/2019 22:40:12  04/28/2019 08:40:12  krbtgt/YHL.LOC@YHL.LOC
renew until 05/04/2019 22:40:08
04/27/2019 23:02:46  04/28/2019 08:40:12  HTTP/dnsdc01.yhl.loc@YHL.LOC
renew until 05/04/2019 22:40:08
04/27/2019 23:02:46  04/28/2019 08:40:12  HTTP/dnsdc02.yhl.loc@YHL.LOC
renew until 05/04/2019 22:40:08

Tuesday, March 12, 2019

Quiet Cisco backups

Stop prompting for crap so it can be automated:

file prompt quiet

Cisco 3750 switch ssh client config

Host sw-3-1
    Hostname <foo>
    User <username>
    Port 22
    IdentityFile ~/.ssh/pubkeyfile
    KexAlgorithms +diffie-hellman-group1-sha1
    Ciphers +aes128-cbc

Friday, March 1, 2019

Mac OS Show Hidden Files

There are thousands of files and folders hidden away on your Mac so that you can't meddle with them. Sometimes, however, you need to to be able to see the hidden files on your Mac.
Perhaps you want to tweak something following a tip you've seen on Macworld. Maybe you're troubleshooting a problem with a program and you've been asked to delete a preference file or find a log file that will help you fix the problem. Some Mac users may want to remove some of these hidden files as they take up valuable disk space.
In this article we explain how to locate these hidden files and folders in the Finder, including the most searched-for folder: the mysterious ~/Library folder.
(If you're trying to find a Word file that's vanished, by the way, you may like to consult How to get back deleted Word files instead. You may also be able to recover lost files if you have a Time Machine backup.)

What files are hidden on a Mac?

In UNIX, hidden files are preceded by a . and won't show up in a normal file list. They could be a .htaccess file, a .bash_profile, or a .svn directory, for example. Folders like /usr, /bin, and /etc are also hidden away.
The hidden folder that users are most likely to want to access is the Library folder (~/Library). It's where your personal application-support files and, in some cases, data is stored.

Why are some files and folders hidden?

Some of these folders and files are considered too confusing or even dangerous for most users so they are hidden away. You might feel confident that you know what you're doing on your Mac, but there are plenty of Mac users who could cause damage or data loss if they were able to mess with files in the Library, for example.

Where is my Mac's Library folder?

Prior to Mac OS X Lion's release back in 2011, if you wanted to access the Library folder you could just open your Home folder and view the Library folder there. That folder is still located in Home, but it's now hidden.
You may have just looked in your Macintosh HD folder and thought you saw the Library folder, but that's not the Library folder in question. There are actually three Library folders on the Mac.
The Library folder you can see contains files that are accessible to all users but only changeable by administrators. Then there is the ~/Library folder that's located in the Home folder. The third Library folder is located in System and contains all the files that MacOS needs to run.
Spot the difference - compare these three Library folders:
How to show hidden files on a Mac: Library folder

How to view a Mac's ~/Library folder

There are three ways to easily view your hidden ~/Library/ folder.
In macOS Sierra Apple added a Finder keyboard shortcut that makes it possible to quickly show all the hidden files and folders. You just need to do the following:
  1. Open the Finder
  2. Go to your Macintosh HD folder (access this from Devices in the left column)
  3. Hold down Cmd + Shift + . (dot)
  4. All the hidden files will become visible
  5. Hold down Cmd + Shift + . (dot) a second time to hide the files again
The easiest way to find your hidden ~/Library/ folder is to do the following:
  1. Open Finder
  2. Hold down Alt (Option) and choose Go from the dropdown menu bar at the top of the screen
  3. You will see the ~/Library folder listed below the Home folder
How to show hidden files on a Mac: Library folder
Alternatively, you could do the following:
  1. Open the Finder
  2. Choose Go from the menu bar
  3. Choose Go to Folder (or Shift + Cmd + G)
  4. Type ~/Library into the text box and click Go
You can now see and access the contents of the ~/Library which were previously hidden from sight.
How to show hidden files on a Mac: Library folder

How to keep the hidden ~/Library folder visible

If you follow the second and third methods above the ~/Library will remain visible until you shut that Finder window. Next time you look it will have vanished again. If you follow the first method in Sierra the hidden files and folders will remain in view until you press Cmd + Shift + . (dot) a second time.
If you're using a pre-Sierra version of macOS, there are ways to keep the hidden ~/Library folder visible. The easiest way is to drag the hidden Library icon from the Finder window to the Finder sidebar. This will make it accessible even after you've closed the Finder.
How to show hidden files on a Mac: Library folder
Alternatively, make an alias to the library folder that you can access from your desktop. To make an alias of your Library folder, do the following:
  1. Opened the ~/Library folder in the Finder
  2. Hold down Cmd + Alt and drag the Library folder icon from the Finder window to your desktop

How to view hidden folders using Terminal

Another way to make hidden files and folders visible requires you to use Terminal.
  1. Open Terminal
  2. Run the following script: 
    $ defaults write com.apple.Finder AppleShowAllFiles true
    $ killall Finder

If you want to switch it back, simply change the true to false.

Saturday, February 9, 2019

Mount Raspbian file systems

I needed to "inject" a first-boot script into the Raspbian image so I needed to "crack open" the .img file in order to add something to /etc/init/rc.local. I came across this article on how to do it: https://raspberrypi.stackexchange.com/questions/13137/how-can-i-mount-a-raspberry-pi-linux-distro-image

Here are the offsets and commands to mount up the Raspbian 2018-11-13 image:


fdisk -l 2018-11-13-raspbian-stretch.img

Disk 2018-11-13-raspbian-stretch.img: 3405 MB, 3405774848 bytes, 6651904 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x025ce4e3

                          Device Boot      Start         End      Blocks   Id  System
2018-11-13-raspbian-stretch.img1            8192       98045       44927    c  W95 FAT32 (LBA)
2018-11-13-raspbian-stretch.img2           98304     6651903     3276800   83  Linux


512 * 8192 = 4194304
512 * 98304 = 50331648

mkdir /mnt/img
mkdir /mnt/img/one
mkdir /mnt/img/two

mount -v -o offset=4194304 -t vfat 2018-11-13-raspbian-stretch.img /mnt/img/one
mount -v -o offset=50331648 -t ext4 2018-11-13-raspbian-stretch.img /mnt/img/two

Current Audible Reading List

Title You Never Forget Your First: A Biography of George Washington A Self-Made Man: The Politica...