How to install a CUPS Printer – The Visual Guide for Brother Printers (Linux)

We all need to install a printer, and CUPS is the easiest way.

Determine if you have a 32 bit or 64 bit system.
Brother printer drivers are 32 bit.  You must convert your 64 bit system to a multi-architecture system to run 32 bit drivers.  If  your Linux is 32 bit, then go straight to step 1 – and ignore these multi architecture instructions.

Make 64 Bit into a multi architecture system.
Root Terminal
dpkg –add-architecture i386
apt-get update
apt-get install wine-bin:i386
This means you now have a multi architecture system

Step 1 – Software Installer
Applications > System Tools > Administration > Synaptic Package Manager
Search and Install:

Cups
Cups Client
Step 2 – Root Terminal
adduser root lpadmin
Step 3 – Start Cups
/etc/init.d/cups start
Step 4 – Access Cups via the Web Browser
Applications > Internet > Ice Weasel
Step 5 – CUPS will Launch

Step 6 – Add a Printer (Administration Tab)
Add a Printer Button
Insert Root password

Select the Printer to be added (may find an existing printer)
Radial Buttons
Step 7 – Discovered Printers
Select Radial > Continue
If your printer has a Linux Driver – now is the time to install it.

BROTHER DRIVERS HERE

Brother printers offer dedicated Linux drivers – so are a good choice for Linux users (it’s best if we support those makers who write specific Linux drivers for their printers).

Brother Linux Printer Drivers – by model number
Download LPR * CUPS
Install Brother LPR driver THEN
Install Brother CUPSWRAPPER driver
How to Install LPR driver and cupswrapper driver
1. Turn on the printer and connect the USB cable.
2. Open the terminal and go to the directory where the drivers are.
3. Install LPR driver.The install process may take some time. Please wait until it is complete.
            
Command (for dpkg)  :  dpkg  -i  –force-all  (lpr-drivername)
Command (for rpm)  :  rpm  -ihv  –nodeps  (lpr-drivername)
4. Install cupswrapper driver.The install process may take some time. Please wait until it is complete.
Command (for dpkg)  :  dpkg  -i  –force-all  (cupswrapper-drivername)
Command (for rpm)  :  rpm  -ihv  –nodeps  (cupswrapper-drivername)
5. Check if the LPR driver and cupswrapper driver are installed
Command (for dpkg)  :  dpkg  -l  |  grep  Brother
Command (for rpm)  :  rpm  -qa  |  grep  -e  (lpr-drivername)  -e  (cupswrapper-drivername)

END OF BROTHER DRIVERS SECTION

Set Defaults for Printer
Set Default Option button > “Defaults set” will flash up
Accepting Jobs Screen
Now Double Check your work with a Test Print

Maintenance Button Button – Drop Down list
Print Test Page


Continue Reading

How to crack passwords using Hashcat – The Visual Guide

Windows passwords are stored as MD5 hashes, that can be cracked using Hashcat.

Step 1 – Root terminal
mkdir hashes
cd /hashes
gedit hashes.txt

This organises a hashes directory for you, and a hashes.txt file which will contain the hashes to be cracked.

Step 2 – Generate hashes for you to crack
Hashes.txt is the file of password hashes to be cracked – we’ll create hashes to paste into this file.




To generate hashes, use:
Enter the word “password” – and the site will return the MD5 hash, paste it into the hashes.txt

Next, hash a second password ie “password1”,  paste the md5 hashes into hashes.txt.

Fill up your hashes.txt with five test md5 hashes.


This is your test hash file complete.  Now we move into attack mode.

Hashcat options.  Jump to step 4 – to attack.
This is background information so that you can adapt your attack for windows hashes or unix hashes etc.

hashcat –help
-m = hash type  (the hash varies by operating system)
-a = Attack Mode (we’ll use both Straight and Combination Attack)
-r = rules file (look for xyz.rule)

ATTACK CODE:

(Carries out a straight through attack against MD5 hashes using the rockyou dictionary).
hashcat -m 0 -a 0 /root/hashes/hashes.txt /root/rockyou.txt

Attack Modes – just for reference
-a 0  (Each number is a DIFFERENT attack mode)
0 = Straight
1 = Combination
2 = Toggle case
3 = Brute Force


I’ve found that straight or -a 0 is ridiculously fast on simple passwords.
You have been warned.

Hash Type – Just for reference
The operating system determines the hash used.  You need to know the hash type.
Unix = MD5 hash
Kali = SHA512 hash
Windows 7 = HMAC-MD5
-m 0 (Each number is a different Hash Type)
0 = MD5 hash…. so we use -m 0
50 = HMAC-MD5….so we use -m 50

Step 3 – Locate password database for the attack
To locate the Rockyou password database in KALI type:
locate *rock*


To locate Hashcat Rules files
cd /usr/share/hashcat/rules
ls -l

You can gedit each rule file to read it if you wish…. that’s a great way to learn more about hashcat 

Step 4 – the REAL ATTACK code
hashcat -m 0 -a 1 /root/hashes/hashes.txt /root/rockyou.txt
(to launch a combination attack against MD5 password hashes)

or

hashcat -m 0 -a 0 /root/hashes/hashes.txt /root/rockyou.txt
(a straight through attack is super fast on simple passwords)

The attack looks like this:

The hashes are shown – with the plain text password given next to it.

The Rockyou database has several million passwords, but if it’s not in there, then it won’t be cracked.

The 2 major cracking dictionaries are Rockyou, and CrackStation.
Rockyou contains 14 million unique passwords.
CrackStation.  For MD5 and SHA1 hashes, there is a 190GB, 15-billion-entry lookup table, and for other hashes, they offer a 19GB 1.5-billion-entry lookup table.
Download CrackStation by Torrent:
https://crackstation.net/buy-crackstation-wordlist-password-cracking-dictionary.htm
Some hashes will fail to be cracked,  this is due to several reasons, it may not be a md5 hash, it may not be in your password list etc.

Hashes are case sensitive, so Password1 is not the same as password1.

oclHashcat-Plus uses your GPU rather than your CPU to crack passwords.  Graphics cards are MUCH faster as an attack tool, than a CPU… MANY times faster.

BRUTE FORCE HACKING – Brute force Calculator – A Visual Guide

SupraFortix – Hashcat Password Cracking – Uni South Wales blog

Continue Reading

How to configure IPTABLES to block Telnet and FTP – The Visual Guide

Iptables is a kernel based utility to set up access control based on protocols, services, ports or the actual interface.  You will use Zenmap to test the iptables are operational.

Step 1 – Root Terminal – To reject Telnet incoming connections
iptables -A INPUT -p tcp –dport 23 -j REJECT
iptables -L -n -v

Your rules will be displayed



How to DROP Telnet instead of REJECT
iptables -A INPUT -p tcp –dport 23 -j DROP

iptables -L -n -v
iptables -v -L INPUT


Step 2 – To stop TELNET outbound connections
iptables  -A OUTPUT -p tcp  –sport 23 -j DROP
iptables -L -n -v
iptables -v -L OUTPUT


DROP vs REJECT
The REJECT target will send a reply icmp packet to the source system telling that system that the packet has been rejected. By default the message will be “port is unreachable”.

The DROP target simply drops the packet without sending any reply packets back.

The REJECT target is vulnerable to DoS  attacks.


Step 3 – Want to see Line numbers on the rules?
iptables -L -v -n –line-number


Step 4 – Made a mistake and need to delete a rule?
List by line numbers – then delete the  rule by it’s line number

iptables -D INPUT 2
-D = Delete
INPUT  rule 2


The rules are temporary… so after a reboot they’ll be cleared

Step 5 – Test the rules with ZENMAP
Applications > Kali > Vulnerability > Misc Scanners < Zenmap
Type the IP address of your machine into Target > Scan



The iptables blocking telnet gave these results when tested :


When both FTP and Telnet are blocked, Zenmap results were:

That’s it.  You’ve blocked Telnet incoming and outgoing, and doublechecked your work using Zenmap.  Easy right?

------------------------------------------------------------------------------------------------------------
So what is Iptables?
Iptables is a user space utility
Designed to configure the 3 network layer kernel filtering chains
INPUT, OUTPUT, FORWARD
-i = Incoming interface (INPUT and FORWARD Chains)
-o = Outgoing interface
-A = Append or Add to a chain
-P = Default policy eg deny all or allow all
Continue Reading

how to fix package header errors linux

If you get the no package header error.

apt-get upgrade
Reading package lists… Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/security.kali.org_kali-security_dists_kali_updates_non-free_i18n_Translation-en
E: The package lists or status file could not be parsed or opened.



The Solution
sudo rm /var/lib/apt/lists/* -vf


apt-get update
apt-get upgrade


That’s it!!

Continue Reading

Metasploit – Payload UML models

http://www.exploit-db.com/wp-content/themes/exploit/docs/27935.pdf







A 52 page document full of UML diagrams for exploits and payloads.  Have fun!
Continue Reading