Tek Sunucuyu veya  IP Adresi tarama

Tek bir IP adresi Tarama:

  $ nmap 192.168.1.1

Host Adı Tarama:

  $ nmap ozkantan.com

Ayrıntı Seviye artırın:

  $ nmap -v ozkantan.com
  $ nmap -vv ozkantan.com

IP Adresleri Tarama

Çoklu IP Adresleri Tarama:

  $ nmap 192.168.1.1 192.168.1.2 192.168.1.3
  $ nmap 192.168.1.1,2,3

Bir Alt Ağ Tarama:

  $ nmap 192.168.1.0/24
  $ nmap 192.168.1.*

IP Adresleri (192.168.1.0 – 192.168.1.200) Aralığı tarama:

  $ nmap 192.168.1.0-200

Aktif Bilgisayarlar için Ağ Taraması

Bir ağ üzerinde aktif Hosts tara:

  $ nmap -sn 192.168.1.0/24

 Dosyadan Hosts Listesini tarama

Tarama Dosyadan sağlar:

  $ nmap -iL input.txt

 Nmap IP / Hosts / Ağları Dışındakini Tara

Nmap taraması Hedefler hariç:

  $ nmap 192.168.1.0/24 --exclude 192.168.1.1
  $ nmap 192.168.1.0/24 --exclude 192.168.1.1 192.168.1.5
  $ nmap 192.168.1.0/24 --exclude 192.168.1.1,2,3

Bir dosyadan  listesi hariç tutulursa:

  $ nmap 192.168.1.0/24 --excludefile exclude.txt

Belirli Bağlantı Noktaları için Tarama

Tek port tara:

  $ nmap -p 80 192.168.1.1

Birkaç port tara:

  $ nmap -p 80,443 192.168.1.1

Port aralığı tara:

  $ nmap -p 80-1000 192.168.1.1

Tüm portları tara:

  $ nmap -p "*" 192.168.1.1

En çok Kullanılan portları tara:

  $ nmap --top-ports  5 192.168.1.1
  $ nmap --top-ports 10 192.168.1.1

Desteklenen belirli IP Protokolleri  Tara

IP Protokolleri (TCP, UDP, ICMP, vb) desteklenen:

  $ nmap -sO 192.168.1.1

Tarama İçin TCP / UDP bağlantı noktaları

Tüm TCP Portları tara:

  $ nmap -sT 192.168.1.1

Özellikle belirli TCP Port tara:

  $ nmap -p T: 80 192.168.1.1

Tüm UDP Portları tara:

  $ nmap -sU 192.168.1.1

Belirli UDP Portları tara:

  $ nmap -p U:53 192.168.1.1

Farklı portları tarama :

  $ nmap -p U:53,79,113,T:21-25,80,443,8080 192.168.1.1

Hızlı Tarama gerçekleştirin

Hızlı Mod :

  $ nmap -F 192.168.1.1

 Detaylı Belirli Durumları Gösteren Tarama:

  $ nmap --reason 192.168.1.1

Sadece Açık Portlar

Sadece Açık Portlar göster:

  $ nmap --open 192.168.1.1

İşletim Sistemi Algılama

OS Algılama açın:

  $ nmap -O 192.168.1.1

 

13. Servis Sürüm Algılama

Sürüm Algılama açın:

  $ nmap -sV 192.168.1.1

* Uzak bir ana bilgisayarda çalışan yazılımın hangi sürümünün keşfedin.

14. Firewall Algılama

Bir ana bilgisayar herhangi Paket Filtreler veya Firewall ile korunan olup olmadığını öğrenmek:

  $ nmap -sA 192.168.1.1

MAC Address Sızdırma

MAC Adresi :

  $ nmap --spoof-mac 00:11:22:33:44:55 192.168.1.1

Rastgele MAC Adresi :

  $ nmap --spoof-mac 0 192.168.1.1

Güvenlik Açıkları ve Güvenlik Duvarı Tarama

TCP  Scan:

  $ nmap -sN 192.168.1.1

TCP Fin Tarama:

  $ nmap -sF 192.168.1.1

* Sadece TCP FIN bit ayarlayın.

TCP Xmas Tarama:

  $ nmap -sX 192.168.1.1

 

SYN Tarama

TCP SYN Scan:

  $ nmap -sS 192.168.0.1

No Ping

 

  $ nmap -Pn 192.168.1.1

DNS Devre Dışı

 

  $ nmap -n 192.168.1.1

Nmap  çıktısını dosyaya kaydet

 

  $ nmap 192.168.1.1 > output.txt
  $ nmap -oN output.txt 192.168.1.1

Nmap çıkışı bir XML dosyası olarak kaydet:

  $ nmap -oX output.xml 192.168.1.1

Citrix Xenserver kurulumunu basit ve hızlı şekilde resimlerle anlatımı aşağıdaki gibidir.

Öncelikle Citrix Xenserver .iso dosyasını

http://xenserver.org/open-source-virtualization-download.html

adresinden indiriyoruz.

Kurulum ekranı çok basit şekilde ilerliyor.

   

Klavye dil seçimini trq yapıyoruz.

Kurulumun nereden yapılacağını seçiyoruz.

İlave paket kurulup kurulmayacağını soruyor, şimdilik No diyerek devam ediniz.

Kuruluma başlayabiliriz…

Kurulum aşaması next-next ten ibaret olduğu için hızlı geçtim.

Son aşamada karşımıza kurulum bitmiş hali aşağıdaki gibidir.

 

Kurulum aynı şekilde çok basit kurulacağı yeri gösterip kurulumu gerçekleştiriyoruz.

Kurulum next-next devam ettiği için kısa geçiyorum ve bitiriyoruz.

Citrix XenCenter programını çalıştırdığımızda aşağıdaki gibi daha kolay sunucu oluşturma, sunucu çıkarma ve yönetimi kısacası

daha kolay hale getirmek için arayüzü kurmuş olduk.

#!/bin/bash host=$1 port_first=1 port_last=65535 for ((port=$port_first; port<=$port_last; port++)) do (echo >/dev/tcp/$host/$port) >/dev/null 2>&1 && echo “$port open” done

1. Test if a particular TCP port of a remote host is open.

$ nc -vn 192.168.233.208 5000
nc: connect to 192.168.233.208 5000 (tcp) failed: Connection refused
$ nc -v 192.168.233.208 22
Connection to 192.168.233.208 22 port [tcp/ssh] succeeded!
SSH-2.0-OpenSSH_6.0p1 Debian-4

2. Send a test UDP packet to a remote host.

The command below sends a test UDP packet with 1 second timeout to a remote host at port 5000.

$ echo -n “foo” | nc -u -w1 192.168.1.8 5000

3. Perform TCP port scanning against a remote host.

The command below scans ports in the ranges of [1-1000] and [2000-3000] to check which port(s) are open.

$ nc -vnz -w 1 192.168.233.208 1-1000 2000-3000

4. Copy a file (e.g., my.jpg) from hostA.com to hostB.com.

On hostB.com (receiver):

$ nc -lp 5000 > my.jpg

On hostA.com (sender):

$ nc hostB.com 5000 < my.jpg

5. Transfer a whole directory (including its content) from hostA.com to hostB.com.

On hostB.com (receiver):

$ nc -l 5000 | tar xvf –

On hostA.com (sender):

$ tar cvf – /path/to/dir | nc hostB.com 5000

6. Perform UDP port scanning against a remote host.

$ nc -vnzu 192.168.1.8 1-65535
Connection to 192.168.1.8 68 port [udp/*] succeeded!
Connection to 192.168.1.8 5353 port [udp/*] succeeded!
Connection to 192.168.1.8 16389 port [udp/*] succeeded!
Connection to 192.168.1.8 38515 port [udp/*] succeeded!
Connection to 192.168.1.8 45103 port [udp/*] succeeded!

The above command checks which UDP port(s) of a remote host are open and able to receive traffic.

7. Listen on a UDP port and dump received data in text format.

The command below listens on UDP port for incoming messages (lines of text).

$ nc -u localhost 5000

Note that this command dies after receiving one message. If you want to receive multiple messages, use whileloop as follows.

$ while true; do nc -u localhost 5000; done

8. Back up a (compressed) hard drive (e.g., /dev/sdb) to a remote server.

On a remote server:

$ nc -lp 5000 | sudo dd of=/backup/sdb.img.gz

On a local host with a hard drive:

$ dd if=/dev/sdb | gzip -c | nc remote_server.com 5000

9. Restore a hard drive from a compressed disk image stored in a remote server.

On a local host:

$ nc -lp 5000 | gunzip -c | sudo dd of=/dev/sdb

On a remote server with a backup disk image (e.g., /backup/sdb.img.gz):

$ cat /backup/sdb.img.gz | nc my_local_host.com 5000

10. Serve a static web page as a web server.

Type the command below to launch a web server that serves test.htmlon port 8000.

$ while true; do nc -lp 8000 < test.html; done

Now go to http://<host_ip_address>:8000/test.html to access it. Note that in order to use a well known port 80, you will need to run nc with root privilege as follows.

$ while true; do sudo nc -lp 80 < test.html; done

11. (Insecure) online chat between two hosts.

On one host (192.168.233.203):

$ nc -lp 5000

On another host:

$ nc 192.168.233.203 5000

After running the above commands, anything typed on either host appears on the other host’s terminal.

12. Launch a “remote shell” which allows you run from local host any commands to be executed on a remote host.

On a remote host (192.168.233.208):

$ nc -lp 5000 -e /bin/bash

On local host:

$ nc 192.168.233.208 5000

After running the above command on local host, you can start running any command from local host’s terminal. The command will be executed on the remote host, and the output of the command will appear on local host. This setup can be used to create a backdoor on a remote host.

13. Create a web proxy for a particular website (e.g., google.com).

$ mkfifo proxypipe $ while true; do nc -l 5000 0<proxypipe | nc www.google.com 80 1> proxypipe; done

The above commands create a named pipe proxypipe, and use nc to redirect all incoming TCP/5000 connections to http://www.google.com via the bidirectional pipe. With this setup, you can access Google by going to http://127.0.0.1:5000.

14. Create an SSL proxy for a particular website (e.g., google.com).

$ mkfifo proxypipe $ mkfifo proxypipe2 $ nc -l 5000 -k > proxypipe < proxypipe2 & $ while true do; openssl s_client -connect www.google.com:443 -quiet < proxypipe > proxypipe2; done

The above commands use nc to proxy SSL connections to Google.com.

15. Stream a video file from a server, and client watches the streamed video using mplayer.

On a video server (192.168.233.208):

$ cat video.avi | nc -l 5000

On a client host:

$ nc 192.168.233.208 5000 | mplayer -vo x11 -cache 3000 –

16. Listen on a TCP port using IPv6 address.

The following command let nc use IPv6 address when listening on a TCP port. This may be useful to test IPv6 setup.

$ nc -6 -l 5000
$ sudo netstat -nap | grep 5000
tcp6       0      0 :::5000                 :::*                    LISTEN      4099/nc



Alıntı:http://xmodulo.com

Linux console üzerinden dış ip ve lokasyon bilgileri bulma komutu:

# curl ipinfo.io

 

Farklı bir ip nin lokasyon bilgisini almak için:

#curl ipinfo.io/88.x.x.x

Belirli tarihten istenilen gün sayısı kadar sonrası: date -d '2016-10-31 + 26 days' +"%Y"-"%m"-"%d"

Daha fazla örnek:

To print the date of the day before yesterday.

$ date –date=’2 days ago’ To rename a file with the current date and time.

$ STAMPME=$HOME/sample_$(date +%Y%m%d-%H%M).txt $ mv $HOME/sample.txt $STAMPME To print the date of the day three months and one day hence.

$ date –date=’3 months 1 day’ To print the day of year of Christmas in the current year.

$ date –date=’25 Dec’ +%j To print the current full month name and the day of the month.

$ date ‘+%B %d’ To print a date without the leading zero for one-digit days of the month, you can use the (GNU extension) ‘-‘ modifier to suppress the padding altogether.

$ date -d=1may ‘+%B %-d’ To print the current date and time in the format required by many non-GNU versions of ‘date’ when setting the system clock.

$ date +%m%d%H%M%Y.%S To set the system date and time.

$ date –set=”2016-1-20 11:59 AM” To set the system clock forward by two minutes.

$ date –set=’+2 minutes’ To print the date in the format specified by RFC-822 (day month year hh:mm:ss zzz).

$ date –rfc To convert a date string to the number of seconds since the epoch 1970-01-01 00:00:00 GMT

$ date –date=’2000-01-01 00:00:01 UTC +5 hours’ +%s 946706400 To convert a date string to the number of seconds since the epoch 1970-01-01 00:00:00 local zone

$ date –date=’2000-01-01 00:00:01′ +%s 946684800 To convert a number of seconds back to a more readable date

$ date -d '1970-01-01 946684800 sec' +"%Y-%m-%d %T %z" 2000-01-01 00:00:00 +0000