Saturday, 14 January 2023

CCNA - securing switch access

*** Configuring in Packet Tracer ***

Naming the switch and applying a password to enable mode

Switch > en

Switch # conf t

Switch (config) # hostname BOB

BOB (config) # enable secret ******

BOB (config) # exit

BOB # copy run start

Destination filename [startup-config] ? <press enter to save changes>


Applying a password to the console

BOB > en

Password:

BOB # conf t

BOB (config) # line console 0

BOB (config-line) # login

<message appears saying the login is disabled until a password is applied>

BOB (config-line) # password ******

BOB (config-line) # exit

BOB (config) # exit

BOB # wr mem

BOB # exit


Applying a password to terminal sessions

BOB > en

Password:

BOB # conf t

Password:

BOB (config) # line vty 0 15

BOB (config-line) # login

<message appears saying the login is disabled until a password is applied>

BOB (config-line) # password ******

BOB (config-line) # exit

BOB (config) # exit

BOB # wr mem

BOB # exit


SSH connection only for RSA 1024bit keys

BOB # conf t

BOB (config) # ip domain-name homebob.com

BOB (config) # crypto key generate rsa

The name for the keys will be: BOB.homebob.com

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.


How many bits in the modulus [512]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

BOB (config) #  ip ssh version 2

BOB (config) # do show ip ssh

BOB (config) # transport input ssh

BOB (config) # exit

BOB # wr mem


Useful commands for when you have logged into your lab

To stop syslog console messages popping up when you have remotely connected to a device

# no logging console


To switch it back on again

# logging console


To only get the console messages at the end of the output from a show command you can add the command to the line entries

BOB (config-line) # logging synchronous 


You can do the same for the history buffer too:

BOB (config-line) # history size 25

(retains the previous 25 commands in the history buffer)


To stop the device looking for a DNS server, which causes the device to pause for a minute stopping any further commands being typed in, run the following

BOB (config) # no ip domain-lookup


NOTES: 

This command does not work in Cisco Packet Tracer

BOB (config) # transport input ssh


SSH

If you have not created a local account on the switch (if you are not using AAA) then use "admin"

When you get the password prompt use the one for the "line vty".




Wednesday, 3 August 2022

Useful study links

Cloud

 I'm currently using Udemy (Scott Duffy's course, as recommended by a colleague - £13.99 at the time of purchase) to study for the AZ-104 Azure Administrator exam with the addition of the Microsoft docs site listed below and John Savill's exam prep video. You can sign up to get a free 30 day Azure trial with Microsoft with £150 worth of credit to play with, which will help with the practical component. The Azure AZ-104 qualification is dropping down from a bi-annual renewal to annual, due to the amount of content change that goes on in a year.

 

 

Networking

 I have been using all the below resources, bar Pluralsight, for studying for the CCNA. If you want to just get some general network knowledge then I'd recommend Professor Messer's free YouTube channel which covers CompTIA Security+.

 

 

Cybersecurity

 I used to, and still do, struggle to find resources for all things Cybersecurity to get information on the latest issues. Shaun did give me some pointers of following people on twitter and listening to podcasts to get the latest news. I've built on that by finding some more people on YouTube who publish regularly and their recommendations lead to other people to follow. Gerald Auger is someone I've stumbled upon recently who has a lot of content on YouTube and has daily briefs on the days "hot topics". He also updates daily on LinkedIn so you can follow him there.

 If you are interested in the offensive security side (penetration, or pen, testing) then there are a number of resources below that provide reasonably priced CBT courses developed by industry specialists (so developed around their real-world experience) - see The Cyber Mentor (Heath Adams) and HackerSploit.

 The constant theme is that you need to know Networking principles and understand the basics of Security as a minimum to get into Cybersecurity industry - which in real terms means get the CompTIA Networking+ and Security+ accreditations and build from there. The assumption maybe that you already know how a computer works and if not CompTIA A+ would be very handy. The next recommendation is to know your way around Linux as most of the tools used for pen testing are built for this operating system rather than Windows.

 

 

 Remember on average it takes 10,000 hours to become an expert on a subject/skill, which equate to about 5 years, so don't expect it to be an overnight thing! That being said don't let that put you off as all things take time and effort to achieve. You will see as time goes by how your knowledge in a subject increases along with your confidence - so enjoy the journey.

 Studying can be a bit like going to the gym, a bit of a chore until it turns into a habit. Creating a timetable may help…..


 

Tuesday, 26 January 2016

Spreadsheets!

I had a need to merge a number of spreadsheets and stumbled over this useful page.....

http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-excel-2007.html

No cost is always good....just ask the boss....

Friday, 31 July 2015

Powershell - NetApp Volumes, Snapshots and Dedup

Some basic scripts that helped we get some sizing information.

First of all you'll need Powershell (who knew?!) and then the NetApp Powershell Toolkit - I found this link useful for this:

First script get the volume information with a loop due to having a number of Filers to get information on:

Import-Module DataOnTap

$filers = (Get-Content C:\Script_Output\Filers.txt)

Foreach ($filer in $filers){

Connect-NAController $filer -Credential <account-name>

Get-NaVol | Select @{Name="HostName";Expression={$filer}}`
,@{Name="VolumeName";Expression={$_.name}}`
,@{Name="TotalSize(GB)";Expression={[math]::Round([decimal]$_.SizeTotal/1gb,2)}}`
,@{Name="AvailableSize(GB)";Expression={[math]::Round([decimal]$_.SizeAvailable/1gb,2)}}`
,@{Name="UsedSize(GB)";Expression={[math]::Round([decimal]$_.SizeUsed/1gb,2)}}`
,PercentageUsed | Export-CSV C:\Script_Output\filers-vol-size.csv -Append -NoTypeInformation
}


Second script lists the snapshots per volume on each Filer:

Import-Module DataOnTap

$filers = (Get-Content C:\Script_Output\Filers.txt)

Foreach ($filer in $filers){
Connect-NAController $filer -Credential <account-name>
get-navol | get-nasnapshot | Select @{Name="HostName";Expression={$filer}}`
,@{Name="VolumeName";Expression={$_.TargetName}}`
,@{Name="SnapshotName";Expression={$_.Name}}`
,@{Name="CumlativeTotal(GB)";Expression={[math]::Round([decimal]$_.CumulativeTotal/1gb,2)}}`
,@{Name="Total(GB)";Expression={[math]::Round([decimal]$_.Total/1gb,2)}}`
,Created | Export-CSV C:\Script_Output\ifilers-snapshot-size.csv -Append -NoTypeInformation
}


Third script is for the Data Dedup information on each Filer (this script needs more work on it as I had to run it against each Filer instead of having a text file list of Filers

Import-Module DataOnTap

$controller = "isg-filer06"

Connect-NAController $controller -Credential <account-name>

Get-NaVol | foreach {
$volname = $_.name
Get-NaVolSis $_ | Select-Object @{n="HostName";e={$controller}}`
,@{n="VolumeName";e={$volname}}`
,@{Name="TotalSaved(GB)";Expression={[math]::Round([decimal]$_.TotalSaved/1gb,2)}}`
,State,PercentageSaved | Export-CSV C:\Script_Output\filers-dedup1.csv -Append -NoTypeInformation
}


Again, thanks to a number of bloggers out there where I managed to re-hash a few scripts to get what I wanted. I will credit them when I find their pages again!

Thursday, 6 November 2014

NetApp - Simulator install

NetApp simulator - useful for training on.

First of all you will need a NetApp account to be able to log on to the site and gain access to the simulator.

Having downloaded the Simulator for ESX and then uploaded it to the relevant host I received a error about the path the VMDK file is invalid.

I managed to get the Simulator up and running by following instructions on the NetApp Community site.

Useful links:

http://now.netapp.com/NOW/cgi-bin/simulator

http://community.netapp.com/t5/Simulator-Discussions/Ontap-simulator-8-2-got-sim-vmdk-error-on-ESX-5i-resolved-using-Vcenter/td-p/47845



Tuesday, 12 August 2014

SQL - Unable to open SSMS

We had a call in for a third party to access a SQL server - the people who set the server up had not long left the Company and didn't leave any passwords for us.

Logging onto the server was fine. Opening up SSMS was the problem. No Permissions.

One of my colleagues found this useful nugget of information for SQL 2008 and above (I don't know how far above - the article said 2008 and above and the edition we have is SQL 2008 R2).

Using PSEXEC (Sysinternals) with the following syntax and an elevated CMD prompt you gain access to SSMS

# PsExec -s -i "C:\Program Files (x86)\Microsoft SQL Server\<path-to-Ssms.exe>\Ssms.exe"

(Path will vary depending on version!)

PsExec will run interactively (-i) using the system account (-s).

Kudos obviously goes to the creator of the original link:
http://www.mssqltips.com/sqlservertip/2682/recover-access-to-a-sql-server-instance/

Friday, 13 June 2014

SQL - T-SQL How long does the DB backup take

Found this useful query with regards looking for how long the SQL backup takes. Baselining the backups to spot when you started having problems.

USE <DBNAME>
GO
-- Get Backup History for required database
SELECT TOP 100
s.database_name,
m.physical_device_name,
CAST(CAST(s.backup_size / 1000000 AS INT) AS VARCHAR(14)) + ' ' + 'MB' AS bkSize,
CAST(DATEDIFF(second, s.backup_start_date,
s.backup_finish_date) AS VARCHAR(4)) + ' ' + 'Seconds' TimeTaken,
s.backup_start_date,
CAST(s.first_lsn AS VARCHAR(50)) AS first_lsn,
CAST(s.last_lsn AS VARCHAR(50)) AS last_lsn,
CASE s.[type]
WHEN 'D' THEN 'Full'
WHEN 'I' THEN 'Differential'
WHEN 'L' THEN 'Transaction Log'
END AS BackupType,
s.server_name,
s.recovery_model
FROM msdb.dbo.backupset s
INNER JOIN msdb.dbo.backupmediafamily m ON s.media_set_id = m.media_set_id
WHERE s.database_name = DB_NAME() -- Remove this line for all the database
ORDER BY backup_start_date DESC, backup_finish_date
GO