BackBox Indonesia
Simple Port scanner - Printable Version

+- BackBox Indonesia (https://www.backboxindonesia.or.id)
+-- Forum: Coding (https://www.backboxindonesia.or.id/forum-31.html)
+--- Forum: C and C++ Programming (https://www.backboxindonesia.or.id/forum-39.html)
+--- Thread: Simple Port scanner (/thread-45.html)



Simple Port scanner - katob - 03-11-2016

jadi nganu
ini cuma mau share aplikasi sederhana buat scan port anu..

codenya sudah ane kasih comment. 

source portscanner.c :
Code:
#include <stdio.h>
#include <sys/socket.h> //socket header
#include <arpa/inet.h>

int main(int argc, char **argv)
{
    struct sockaddr_in sock;
    int fsock, portAW, portAK;
    
    if(argc != 4){
        printf("Usage : <Ip Address> <Port Awal> <Batas Port> \n");
        return 0;
    }

    //convert argv to int
    portAW = atoi(argv[2]);
    portAK = atoi(argv[3]);

    printf("[+]Ip Address : %s\n",argv[1]);        
    while(portAW != portAK)
    {    
        //create socket
        fsock=socket(AF_INET, SOCK_STREAM, 0);

        //struct di lib <arpa/inet.h>
        sock.sin_family =AF_INET;
        sock.sin_addr.s_addr = inet_addr(argv[1]);    
        sock.sin_port = htons(portAW);
        
        if(connect(fsock, (struct sockaddr *)&sock, sizeof(sock)) >= 0)
            printf("[+]Port Kebuka: %d\n",portAW);            

    portAW++;    
    }

    return 0;
}


screenshutnya :

[Image: 1935716_1155543904458105_801470153846748...e=578E688E]

ga terima kritik. 
terima masukan :D


RE: Simple Port scanner - fikri2992 - 03-12-2016

mantaf gan kreatif banget hahah :D


RE: Simple Port scanner - anongep - 03-12-2016

komeng ^_^ /


RE: Simple Port scanner - Aiden_ - 03-13-2016

mau belajar C, tpi kurang referensi buat belajar menggunakan library nya :'(


RE: Simple Port scanner - teh - 03-13-2016

saya bisa sdikit mnguasai bhasa C tapi masih bingung soal file header library nya -_-


RE: Simple Port scanner - Aiden_ - 03-15-2016

(03-13-2016, 09:35 AM)teh Wrote: saya bisa sdikit mnguasai bhasa C tapi masih bingung soal file header library nya -_-

wkwk itu kendala ane juga kalau belajar C :D
kurang ada nya referensi