Saturday, August 29, 2015

Geeky week

It's been a while since my last post. Been traveling for work and it has been difficult to make time to write. Today though I picked up a new Raspberry Pi II B and have decided that I want to make it into the ultimate emulator box. I'm sure my wife is tired of all my old gaming systems sitting out. I'm going to set them all up on my Raspberry Pi.
The biggest things I feel I need are the following
1. Portable - When I travel I would like to be able to take it with minimal weight added to my luggage.
2. Wireless control - After this is setup I will need to make sure I can control it through wireless, it is too much trouble to have wires strewn around my hotel room.
3. Basic games - I really only care about having Zelda, Mario, Final Fantasy, and arcade games. I own most of these so I need to look at how I can license those I do not own. I have every Final Fantasy and Zelda game, need to pick up super Mario world as that is the best super Mario game. Also Super Mario RPG as well.
4. I need to figure out N64 controls. The N64 controller is out of the question as it is the time Nintendo forgot that children do not have 3 arms. On a plus note during the apocalypse the N64 will be ideal after the fallout.
5. Battery Powered - This is less important, I think I have battery packs from my pineapple that should work fine for this.
6. Wireless - Taken care of have my wireless cards I use for kali linux that I carry with me anyway. This gives me access to my high DB antenna.
7. Optional - Would be nice to have a small display, at least 5" preferred. Touch not needed on this.
8. Light case - Need something ultra light that will keep all of this protected. Maybe design and print this one would be the best option.

Thursday, August 13, 2015

Keyloggers, password hash cracking, and more python fun

Worked through the keylogger over the past few days. Been having fun seeing what I can get it to pull. I want to see if I can pull location of mouse pointer too, that is next step.
Built a small python program that will crack password hashes, it is rather simple at the moment, but holds promise. I'll release source on these when they are working at least most of the way.

Python is a fun language and I use it for most simple things I do around my systems. Need to take a closer look at 3 as everything I do is in 2.7 still. I use python for organization and cleaning my HDDs. I am a habitual data hoarder. I have random text files of notes I wrote over 10 years ago... I think it's time to clean.
I use one script that looks at files last access date and generates a report for me. That way I can go look at them and see if I still want to keep them. I ignore system and program files. This is almost exclusively pointed at my data server. It also will read from a blacklist and will ignore files there (picture folders). I have it currently set at 6 months but probably should drop that down.

Tuesday, August 11, 2015

Kali 2.0 frustrations and successes

Well we all saw it happening, we watched it, we experienced it. The massive DDoS attack on the Kali Linux servers, along with the giant upgrade hug we all gave it. It was an eventful day. I saw people taking from 1 hr to 14 hours to download the 3.1 GB ISO. As of right now I have only been able to get the mini ISO to successfully install.
It is stalled out again. When I use the full ISO I get mount issues with using USB where it is looking for the the information under /cdrom instead of /media. Okay not a big deal
ln -s /media /cdrom
Oh wait it didn't like that either... Well I guess I could throw the ISO on there as well.
mount /media/kali2.iso /cdrom -o loop=/dev/loop1
waiting
waiting
waiting
well I guess that wont work in here... hmm
Back to the mini install. All of you are giving it the hug of death still 12 hours after release. I guess I can try a Debian mirror. Lets see if that works.
Decided on the usu.edu server.
That one failed, time to take a systematic approach... Or wait do I care to get this done today?
YES I DO!
Okay time to start at the top of the mirror list.
6 down so far all failing...
all seem to be failing at this point.
I'm going to crash I'll get it going tomorrow. We will see how servers are then.

I had a brain blast over the night. Seems that working tired caused me to slow down, after listening to my brain and sleeping I thought to just watch the mountings when it kept erroring out. It seems that it kept unmounting the /dev/sdb1 (flash drive) so every time it errored out I mounted it again. Did this 3 or 4 times throughout and it worked with out any other issues.

Monday, August 10, 2015

The Hacker Manifesto

by
+++The Mentor+++
Written January 8, 1986
Another one got caught today, it's all over the papers. "Teenager Arrested in Computer Crime Scandal", "Hacker Arrested after Bank Tampering"...

Damn kids. They're all alike.

But did you, in your three-piece psychology and 1950's technobrain, ever take a look behind the eyes of the hacker? Did you ever wonder what made him tick, what forces shaped him, what may have molded him?

I am a hacker, enter my world...

Mine is a world that begins with school... I'm smarter than most of the other kids, this crap they teach us bores me...

Damn underachiever. They're all alike.

I'm in junior high or high school. I've listened to teachers explain for the fifteenth time how to reduce a fraction. I understand it. "No, Ms. Smith, I didn't show my work. I did it in my head..."

Damn kid. Probably copied it. They're all alike.

I made a discovery today. I found a computer. Wait a second, this is cool. It does what I want it to. If it makes a mistake, it's because I screwed it up. Not because it doesn't like me... Or feels threatened by me.. Or thinks I'm a smart ass.. Or doesn't like teaching and shouldn't be here...

Damn kid. All he does is play games. They're all alike.

And then it happened... a door opened to a world... rushing through the phone line like heroin through an addict's veins, an electronic pulse is sent out, a refuge from the day-to-day incompetencies is sought... a board is found. "This is it... this is where I belong..." I know everyone here... even if I've never met them, never talked to them, may never hear from them again... I know you all...

Damn kid. Tying up the phone line again. They're all alike...

You bet your ass we're all alike... we've been spoon-fed baby food at school when we hungered for steak... the bits of meat that you did let slip through were pre-chewed and tasteless. We've been dominated by sadists, or ignored by the apathetic. The few that had something to teach found us willing pupils, but those few are like drops of water in the desert.

This is our world now... the world of the electron and the switch, the beauty of the baud. We make use of a service already existing without paying for what could be dirt-cheap if it wasn't run by profiteering gluttons, and you call us criminals. We explore... and you call us criminals. We seek after knowledge... and you call us criminals. We exist without skin color, without nationality, without religious bias... and you call us criminals. You build atomic bombs, you wage wars, you murder, cheat, and lie to us and try to make us believe it's for our own good, yet we're the criminals.

Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.

I am a hacker, and this is my manifesto. You may stop this individual, but you can't stop us all... after all, we're all alike.

-- Picked this up from http://www.mithral.com/~beberg/manifesto.html please check out this site--

Lenovo Yoga 2 13, Kali Linux 1.0.7, Ubuntu 14.04, Windows 8.1 install, config, wifi

I wanted to share an experience with everyone I hope will help others avoid what I have gone through the past 3 days. I bought a Yoga 11s that I loved but had some issues with the wireless, Lenovo being awesome replaced it with a Yoga 2 13. I love this laptop but ran into some issues with Linux install/wireless, which I wanted to show how to resolve in one place. Hopefully this will help someone else get through this quicker

I am going to try and write this for someone with little Linux experience, if I miss the mark please let me know and I will clarify the best I can.
For work I need Windows 8.1 and Kali Linux, while for home I prefer Ubuntu.

My Yoga 2 13:
I5 1.6 ghz
8 GB ram
256 GB SSD
ORANGE!

My requirements:
I need Windows
I need Kali Linux (livecd, even with persistent mode was not an option as it would not save the wireless fix or system updates) – I would also like this on a USB drive and not the internal SSD
I would like Ubuntu

Needed to do this:
1. 2 USB thumb drives (at least 8gb in size each) I used 2 Leef Supra 32GB drives. They are my favorite right now and are only about $27 at amazon.
2. Phone that can USB Tether or a USB Ethernet card (External USB wireless will show as "Hardware Locked"). Again you can pick one up for sub $10 if you need the USB Ethernet route. I used my Galaxy S5, you will need to download 200-300 mb of items through this so make sure you have the data if you go that route.
3. You may be able to get a USB wifi card to work if you do the following after boot. This only worked once for me.
a.Type ‘sudo rmmod iwlmvm’
b.Type ‘sudo rmmod iwlwifi’
4. ISOs of Ubuntu and Kali Linux (I used Ubuntu 14.04 and Kali Linux 1.0.7)
5. Software to unzip the ISOs. I recommend 7-ZIP and will be referencing this in this guide.
6. I will include the EFI boot files and the WiFi fix files if I can attach. Otherwise I will provide a link to them.
Link: https://www.dropbox.com/s/puxnnoft3gn2b6l/WiFiFix.zip

Recommended (these are just in case you corrupt something making your system not see any OS
1. I would call Lenovo beforehand and get a set of recover disks (this will take 2-3 days)
2. In the meantime a USB Windows 8.1 or 8 ISO (the repair feature may save you)

*Note: At many points in this guide I detail steps and commands. Please double check that you understand the step before proceeding. There are multiple points where a mistyped command or clicking the wrong option will cause your entire system to fail and you will need to reformat the entire drive and start over. This also will make One Touch recovery not work. Proceed with caution.*

I did not need to disable ‘secure boot’ to do this, but keep in mind that you may need to.

Steps:

First let’s go through the installs, and then we will go through grub config and wireless fix

1. In Windows scroll to computer and right click, select manage.
2. Go to “Disk Management”
3. Select the main HDD (notice Lenovo puts a stupid number of partitions on here)
a. I deleted the D: drive on here, if you do this make sure to copy the drives over to your main C: drive. You will want to run each of the installers and repair the drivers after.
4. I used the space from the D: drive and pulled a little more creating a 50 GB partition for Ubuntu and my swap file
a. You can also add more space by right clicking your C drive and selecting shrink
b. Do not format the partitioned data as this will make identifying it later much easier.
5. Open a command line
a. Swipe from the right of the screen and select search
b. Type ‘cmd’
c. right click and select ‘run as admin’
6. For Ubuntu: Type ‘diskpart’ into the command line
a. type ‘list disk’
i. You should see 2-3 disks depending on if you have one or both usb drives in the laptop at the time. I would suggest only doing 1 at a time so you don’t lose track.
b. type ‘select disk $’ (Replace the $ with the number of the drive)
c. ***** Before proceeding make sure you have the correct drive selected or you can ruin your Windows install and Lenovo one touch recovery will not fix it since we have changed the partitions *****
d. type ‘clean’
e. type ‘create partition primary’
f. type ‘active’
g. type ‘format fs=fat32 quick’
h. type ‘assign’
i. type ‘exit’
6. For Kali Linux: Type ‘diskpart’ into the command line
a. type ‘list disk’
i. You should see 2-3 disks depending on if you have one or both usb drives in the laptop at the time. I would suggest only doing 1 at a time so you don’t lose track.
b. type ‘select disk $’ (Replace the $ with the number of the drive)
c. ***** Before proceeding make sure you have the correct drive selected or you can ruin your Windows install and Lenovo one touch recovery will not fix it since we have changed the partitions *****
d. type ‘clean’
e. type ‘create partition primary size= 3272
f. type ‘active’
g. type ‘format fs=fat32 quick’
h. type ‘assign’
i. type ‘exit’
j. By doing this we can maintain a portion of this drive as the install CD and still have linux install/ liveCD if we need to run it on another machine.

7. At this point the drive is ready to have the contents of the ISO copied over.
8. Right click the ISO and select 7-zip then ‘zip to /’ This should unzip the ISO to the location of the ISO into a folder named exactly the same as the ISO.
9. Once this is done for Ubuntu ISO it is done
10. Kali requires a little bit more to be ready
a. Kali will need some files added for EFI boot. --$--
i. Thanks to: https://forums.kali.org/showthread.p...all-Kali-Linux
ii. EFI files are located within the wifi fix folder https://www.dropbox.com/s/puxnnoft3gn2b6l/WiFiFix.zip
11. Now let’s start with Ubuntu


Ubuntu install

1. Place USB drive into the laptop and press the “Lenovo boot” button next to the power button
2. Select ‘Boot Menu’
3. Select ‘EFI USB Device (Name of drive)’ Mine stated Leef Supra
4. Select ‘install Ubuntu’
5. Go through the Ubuntu install until you get to select the install drive
6. Once you get to the install portion it will ask you to select from one of 4 options. Select ‘Manually select partition’
7. Select the “Free Space” where we opened up some of the drive
8. You will need to create 2 partitions, I usually create the swap partition at the end of the drive
a. First I create the swap
i. Set at the end of the drive
ii. Set size to 1024 mb
iii. Set type to ‘swap’
b. Second create the ext 4 partition
i. Set to beginning of drive
ii. Set to remainder of the space
iii. Set type to ext4
iv. Set mount point to /
9. Finish the install and boot into Ubuntu
10. You will notice that your wireless is ‘disabled by hardware’ This is fine for the time being and we will worry about this after the kali install. If we fix it now for some reason after installing kali we get the error again and would just need to fix it again.

Kali Linux install

1. Place USB drive into the laptop and press the “Lenovo boot” button next to the power button
2. Select ‘Boot Menu’
3. Select ‘EFI USB Device (Name of drive)’ Mine stated Leef Supra
4. From the grub menu select ‘install kali linux’ both graphical and text work. I much prefer text install
5. You will get a few errors through the install but that is fine
6. The first we see is about network hardware and ‘load missing firmware from removable media?’ – Select ‘no’
7. Then select no ethernet card
8. It will have you name your machine then it will ask you for the root password
a. If you want to just use root *not recommended* place the password here
b. If you wish to use a non-root account then leave these blank and it will ask you for a name, username, and password of the new machine *Very Recommended* - this will also add this user to the sudoers file
9. It will then ask you to ‘partition disks’
10. Select manual
11. Now here is where it can get a little confusing so read twice click once
12. Select the USB drive from this list
13. Mine shows up under (sdb) – Leef Supra
a. It could be sdc, sdd, sde, etc… depending on how many drives you have plugged in.
14. You should see one primary drive that is 3gb or so that is formatted as FAT32. – DO NOT TOUCH THIS PARTITION!
15. You should see the remainder of this drive as ‘FREE SPACE’ select that
16. Create a partition at the end at size 1024mb and swap
17. Then create another one for the remainder of the drive and set it to ext4 with mountpoint of /
18. Continue through the install after you should see an error warning you that ‘you may not be able to boot’ that is fine, select continue
19. Then select from the menu of all the options ‘continue without bootloader’
20. It should finish up then reboot on its own.

First setup/boot/fix grub

1. You should be able to boot up into GRUB2 menu now.
2. You may not see kali linux in this menu (make sure you have your towel and don’t panic!)
3. Boot into Ubuntu
4. Once you log in you should see that you still cannot use wireless due to being locked by hardware
5. This is expected
6. Let’s fix grub then we will come back to fixing wireless
7. Plug in your device to connect to the internet (USB Tethering or USB Ethernet)
8. Once you verify that you now have an internet connection run the following from terminal
a. ‘sudo add-apt-repository ppa:danielrichter2007/grub-customizer’
b. ‘sudo apt-get update’
c. ‘sudo apt-get install grub-customizer’
9. You can also edit the grub.cfg manually if you know what you are doing… I did not
10. Open grub customizer
11. It should auto populate and you should see ‘debian (kali linux)’ somewhere in the list
12. It should be mounted to /dev/sdb2 or /dev/sdc2 depending on how many devices you have
13. At this point go ahead and save
14. Reboot and test that you can get into each OS
15. This is where my inexperience got me. I spent 2 of my days so I am including this error: If when you boot into Kali you get an error somewhere that says ‘/bin/sh: can’t access tty: job control turned off’ look above it for an error that looks similar to ‘ALERT! /dev/sdc2 does not exist. Dropping to a shell!!’
a. That error is due to the mount point being incorrect in grub, reboot and from within grub highlight the kali boot. Press ‘e’ then towards the bottom you should see ‘root=/dev/sdc2’ change this to ‘root=/dev/sdb2’ again the number doesn’t matter just make sure it stays the same.
b. Press F10
c. If this boots fine then you will need to go back and fix the grub.cfg or load into Ubuntu and open grub customizer again, it should fix this
16. Now you have 3 working OS on the machine with one being on a USB! Congrats!
17. You can remove the USB with no worry of screwing up your install, but you will not be able to boot into Kali Linux until you replace it. I would suggest only removing it and replacing it while the machine is powered off, but that’s just me.

Fix Wireless

Now is the time to do what probably ¾ of you came here for. FIX THE DANG WIRELESS. This is a huge problem from Lenovo’s side that I hope they realize how important Linux is and will fix. I won’t hold my breath though.

Log into Ubuntu : This is well documented in the following forum post on page 3 by user Haohe:
http://ubuntuforums.org/showthread.php?t=2215044&page=3
His has you download quite a large file, mine should be much smaller.
https://www.dropbox.com/s/puxnnoft3gn2b6l/WiFiFix.zip

1. Download the attached package with the fix.
2. Connect your USB internet device (tether or ethernet)
3. Place the packages somewhere easy to access, in this example I will place them under ~/Desktop/WiFiFix
4. Type ‘cd ~/Desktop/WiFiFix/’
5. Now we need to prep the tools we need.
6. Type ‘sudo apt-get update’ – we did this before, but you know, just in case
7. Type ‘sudo apt-get install linux-headers-`uname –r`’ Note around uname-r they are the ` symbol not the ‘ this is located just above the tab on the same key as ~.
8. Type ‘make’
9. Type ‘sudo cp /lib/modules/3.13.0-24-generic/kernel/drivers/platform/x86/ideapad-laptop.ko ~/ideapad-laptop.ko.backup’
10. Type ‘sudo cp ~/Desktop/WiFiFix/ideapad-laptop.ko /lib/modules/3.13.0-24-generic/kernel/drivers/platform/x86/’
11. Type ‘sudo modprobe -r ideapad-laptop’
12. Type ‘sudo modprobe ideapad-laptop’
13. Type ‘sudo rfkill unblock all’
14. Type ‘sudo modprobe -r ideapad-laptop’
15. Type ‘sudo mv ~/ideapad-laptop.ko.backup /lib/modules/3.13.0-24-generic/kernel/drivers/platform/x86/ideapad-laptop.ko’
16. Next we need to blacklist the ideapad module
17. Type ‘sudo echo 'blacklist ideapad-laptop' > /etc/modprobe.d/blacklist-ideapad.conf’
a. The first time I tried this it wouldn’t work. So I did the following
b. ‘sudo touch /etc/modprobe.d/blacklist-ideapad.conf’
c. ‘sudo vim /etc/modprobe.d/blacklist-ideapad.conf’
d. Enter blacklist ideapad-laptop
e. Exit and save
18. Reboot your Yoga 2 13
19. Boot into kali and see if you have wireless, if you do then you are done. If not we will need to repeat this process with one small little change.
Kali Wifi Fix

1. Copy the sources.list from the package provided
2. Replace /etc/apt/sources.list with the included
3. Some of the file path changes but the process remains the same from here.
Congratulations you now have 3 OSes one portable to other machines and working wifi!

Windows 10, Kali 2.0, and Defcon 23 recovery

Just got home from DC23. It was a crazy ride. The 4 days of mind blowing talks, experiences, and workshops was huge! I will be writing more about it now that I am back to the land of solid network connections.
Also Kali 2.0 will come out tomorrow afternoon EST. I am super excited to test this out and will be putting this on my blog as I do. Next post I will be placing something I wrote a few months ago about getting my Lenovo Yoga 2 13 with Kali installed. The post was to get 3 different OS onto the laptop, but I will be moving to solely Linux from here on out.
After spending the week playing with Windows 10 on the laptop, pre Defcon felt like a good time to reinstall an OS, I took the fresh install with me and spent time playing with it. I found a few things.
1. The privacy settings make it a no go at any price.
2. Even after removing "Install Candy Crush Saga" from my machine it has made a reappearance twice now. This also is a no go.
3. General issues with audio settings with the 3 USB headphones I have.
4. The OS itself is quick and slick. It will appeal to the masses. We need to let our friends and family know that the upgrade cannot happen. We cannot allow Microsoft to get away with this. Privacy is key, whether or not you believe you have something to hide. The excuse "Well I have nothing to hide" is no longer acceptable. We need to take a stand. Because what today you have nothing to hide who knows what will be made illegal next year, or if it will cause issues for us down the line.
We need to demand action.
We need to stand up.
We need to rise.
It is the information age, yet many of those making decisions now have little to no understanding of what that means. We get senators asking for us to  "create front doors" to encryption. It should be a requirement, a right, a need, for us to keep our data private. Just because I lock my front door does not make me a criminal. Well encryption is just our information front door. GET OFF MY LAWN.

I want to thank all of you reading this. We are taking our first steps. We are starting to wake up. It is time. It is OUR time.

Saturday, August 8, 2015

New day, seems like a good day to start a blog

I want to get down what I expect of this blog. I don't really care if it ever gets read, it just helps to write things down. I need more experience actively getting my thoughts down and organized. At first this will be more of a stream of consciousness. I intent to speak about many things, I wont really hold to one thing or another.
I will document my learning, work life, 3d printing, blacksmithing, etc... The more I write I hope it helps me to be able to quickly organize my thoughts and make sense of what I am seeing in my day to day.

Friday, August 7, 2015

DC23 Violent Python

Just got out of the DC23 Violent Python class. It was a ton of fun, rather basic for python language need, which is good to see.
https://samsclass.info/124/ViolentPython.shtml
The guy who taught the class keeps a site full with a vulnerability server and some sample code. Basics I would know to go through this is the following.
1. Basics of Python (structure, syntax, variables, loops)
2. Basics of wireshark ( how to start, stop, and follow  TCP stream)

Rather simple and good for people looking at a fun project while learning project.

If you already know Python don't fret it is still fun to figure out these puzzles. I'm going to publish what my code was to solve these as soon as I leave Defcon. Here the wireless is spotty at best and I have run into some issues with it.

Lots of fun. I will keep documenting my learning of security and general hacking.

I want to state that I am performing all of this for educational purposes only and I am not responsible for anything that this information is used for. All sites I reference are specifically open for learning. Be safe. I'm fairly new to this so please let me know if you have any advice.