Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // niceforce v1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <stdio.h>
- #include <windows.h>
- #include <winsock.h>
- //#include "StdAfx.h"
- //#include "config.h"
- #pragma comment(lib, "ws2_32.lib")
- //////////////////////////////////////////////////////////////////////////////
- ///// LOADING DOTS /////
- ///// /////
- //////////////////////////////////////////////////////////////////////////////
- int loading_dots()
- {
- printf("."); Sleep(500); printf("."); Sleep(500);
- printf("."); Sleep(500); printf(".\n\n"); Sleep(1000);
- return 0;
- }
- //////////////////////////////////////////////////////////////////////////////
- ///// BRUTE FORCE /////
- ///// /////
- //////////////////////////////////////////////////////////////////////////////
- int brute_force(char *myline)
- {
- for (int w=0; words[w]; w++)
- {
- for (int u=0; users[u]; u++)
- {
- for (int p=0; password[p]; p++)
- {
- {
- {
- printf("[+] brute_force: Starting %s", myline);
- loading_dots();
- //break;
- }
- }
- Sleep(1000);
- }
- }
- Sleep(1000);
- }
- return 0;
- }
- //////////////////////////////////////////////////////////////////////////////
- ///// WRITE TO FILE /////
- ///// /////
- //////////////////////////////////////////////////////////////////////////////
- int write_file(char *myline)
- {
- printf("[+] write_file: Starting\n");
- //loading_dots();
- FILE *f;
- f = fopen("output.txt","a+");
- fprintf(f, myline);
- printf("[+] Writing to file: %s", myline);
- Sleep(500);
- fclose(f);
- return 0;
- }
- //////////////////////////////////////////////////////////////////////////////
- ///// READ FROM FILE /////
- ///// /////
- //////////////////////////////////////////////////////////////////////////////
- int read_file()
- {
- printf("[+] read_file: Starting");
- loading_dots();
- static const char filename[] = "read.txt";
- FILE *myfile = fopen (filename, "r");
- if (myfile != NULL)
- {
- char myline[128];
- while (fgets(myline, sizeof myline, myfile) != NULL)
- {
- //printf("%s",myline);
- //brute_force(myline);
- write_file(myline);
- }
- fclose(myfile);
- Sleep(1000);
- printf("\n[+] Finished Reading: %s\n", filename );
- }
- else
- {
- Sleep(1500);
- perror ( filename ); /* why didn't the file open? */
- printf("\n[+] Please check: %s and try again\n", filename);
- exit(1);
- }
- return 0;
- }
- //////////////////////////////////////////////////////////////////////////////
- ///// PRINT HEADER /////
- ///// /////
- //////////////////////////////////////////////////////////////////////////////
- int print_header()
- {
- printf("\t\t#################################################\n");
- printf("\t\t### iCe-ForCe v1.0 ###\n");
- printf("\t\t#################################################\n\n");
- printf("\t\t usage: iceforce.exe -w words.txt -o output.txt \n\n");
- return 0;
- }
- //////////////////////////////////////////////////////////////////////////////
- ///// CREATE SOCKET /////
- ///// /////
- //////////////////////////////////////////////////////////////////////////////
- int create_socket()
- {
- printf("[+] create_socket: Starting");
- loading_dots();
- WSADATA wsda;
- WSAStartup(0x0101,&wsda);
- struct sockaddr_in server;
- static int sockfd;
- struct hostent *h;
- if((sockfd=socket(AF_INET,SOCK_STREAM,0))==-1)
- {
- printf("Socket Error...");
- exit(1);
- }
- if((h=gethostbyname("irc.rizon.net"))==NULL)
- {
- printf("[+] Host name error!\n");
- exit(1);
- }
- server.sin_addr=*((struct in_addr*)h->h_addr);
- server.sin_port=htons(6667);
- server.sin_family=AF_INET;
- if(connect(sockfd,(struct sockaddr*)&server,sizeof(struct
- sockaddr))==-1)
- {
- printf("[+] Connection out\n");
- exit(1);
- }
- printf("[+] Connected to host\n");
- return 0;
- }
- int main()
- {
- print_header();
- create_socket();
- read_file();
- // brute_force();
- //write_file();
- printf("goodbye!\n");
- Sleep(1000);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement