Tag: open

Python

Banner Grabbing with Python

A simple banner grabber in Python: import optparse from socket import *   def banner(targetHost, targetPort): try: connsocket = socket(AF_INET, SOCK_STREAM) connsocket.connect((targetHost, targetPort)) connsocket.send(’Hi therern’) results = connsocket.recv(100) print ” + str(results) connsocket.close() except: print ‘error’ def main(): options = {} parser = optparse.OptionParser(’usage %prog -H <target host> -P <target port>’) parser.add_option(’-H’, ‘–host’, dest=’target_host’, type=’string’, …

Metasploit, NMAP, Port Scanning

Discover open mysql ports

MySQL is running by default on port 3306. To discover MySQL you can do it either with nmap or with Metasploit’s auxiliary modules.   The NMAP way Nmap is a free and open source network discovery and security auditing utility. It can discover open ports, running services, operating system version and much more. To discover …

Backdoors, Netcat

Create Backdoor in Windows with ncat

Let’s see how we can create a non-persistent backdoor in Windows with ncat. We are going to need ncat.exe. Download and install Nmap. Locate ncat.exe in nmap’s installation folder. You will probably find ncat.exe, in this folder x:\Program Files (x86)\Nmap if you have 64bit Windows 7 system as I have. Copy it. It can work …

Cryptography, General, Security Software

TrueCrypt | Disk Encryption

TrueCrypt is an open-source and cross-platform disk encryption software. It works on Windows 7/Vista/XP, Mac OS X, and Linux.¬†It is also available as stand alone executable. It establishes¬†and maintains an on-the-fly-encrypted volume (data storage device). On-the-fly encryption means that data is automatically encrypted right before it is saved and decrypted right after it is loaded, …

Metasploit, NMAP

Port Scanning with Nmap and Metasploit

Port Scanning Nmap is a free and open source tool for network discovery and security auditing. Nmap is able to determine what hosts are available on the network, what operating systems and services are running on target hosts, identify the type of the firewalls that are in use, and dozens of other capabilities. It is …

Linux

Inspect network connections with netstat

List network connections, open ports and the programs running behind those ports with netstat. Open a terminal and type: netstat -apenetstat -ape -a, –all, –listening display all sockets (default: connected) -p, –programs display PID/Program name for sockets -e, –extend display other/more information Output: Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name …

Python

Scan for open ports with Python

A simple and fast port scanner written in Python. #!/usr/bin/env python from socket import *   if __name__ == ‘__main__’: target = "localhost" target_ip = gethostbyname(target) print "Scanning", target, "-", target_ip   for i in range(1, 1024): sock = socket(AF_INET, SOCK_STREAM)   result = sock.connect_ex((target_ip, i))   if(result == 0) : print ‘Port %d: OPEN’ …

Backtrack, Linux, Tools

Map the network with lanmap2 and Backtrack

1. Open your backtrack vm. 2. Goto Applications->BackTrack->Information Gathering->Network Analysis->Network Scanners->lanmap2. 3. After lanmap2 finishes loading open a new terminal tab. 4. Issue the following command in the new tab: nmap -vv -A xxx.xxx.xxx.*nmap -vv -A xxx.xxx.xxx.* 5. When nmap scanning has finished, stop-terminate lanmap2, change directory to /pentest/enumeration/lanmap2and paste the following command: cd graph …