This commit is contained in:
Michał Jankowski 2020-01-17 19:31:21 +01:00
commit a19e8a12a5
11 changed files with 51 additions and 0 deletions

BIN
2.tcpd Normal file

Binary file not shown.

BIN
2_example.pcapng Executable file

Binary file not shown.

20
2_program.c Executable file
View File

@ -0,0 +1,20 @@
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <string.h>
#include <arpa/inet.h>
#include <unistd.h>
int main(void) {
struct sockaddr_in adr;
int s;
s = socket(PF_INET, SOCK_STREAM, 0);
adr.sin_family = AF_INET;
adr.sin_port = htons(40);
adr.sin_addr.s_addr = inet_addr("150.254.78.2");
connect(s, (struct sockaddr*) &adr, sizeof(adr));
printf("Done.");
return 0;
}

BIN
6.tcpd Normal file

Binary file not shown.

BIN
6_example.pcapng Executable file

Binary file not shown.

31
6_program.c Executable file
View File

@ -0,0 +1,31 @@
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
int main(int argc, char **argv)
{
struct sockaddr_in adr;
int s, bytesSend;
char message = 0x0a;
s = socket(AF_INET, SOCK_DGRAM, 0);
adr.sin_family = AF_INET;
adr.sin_port = htons(40);
adr.sin_addr.s_addr = inet_addr("150.254.76.1");
bytesSend = (int) sendto(s,&message, 1, 0, (struct sockaddr*) &adr, sizeof(adr));
if (bytesSend != 1) {
printf("SOME ERROR.");
} else {
printf("UDP PACKET WAS SEND.");
}
close(s);
return 0;
}

BIN
SieciProjekt2.odt Executable file

Binary file not shown.

BIN
SieciProjekt2.pdf Executable file

Binary file not shown.

BIN
dns_query.pcapng Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.