Articles

Metasploit Framework Windows Tutorial
Remote Desktop Connection
Windows Processes That May Be Dangerous
How-To use NetCat a Tutorial
Common Linux Commands
Common Ports
Netcat Commands
HTTP Response Codes
War-Google Hack Terms
Wardriving
Avoiding Social Engineering and Phishing Attacks
Intrusion Detection on Linux
Linux Intrusion Detection
Penetration Testing Guide
Penetration Testing Tools
Social Engineering Fundamentals, Part I: Hacker Tactics
Social engineering (computer security)
The Psychology of Social Engineering

The Archives

General GSO
GovernmentSecurity.org News & Suggestions
In The News
Open Topic
General Security Information
Trash Can
Exploit & Vulnerability Mailing List Archives
Trial Member Forum
Product and Program Reviews GSO Tutorials
System Security
Windows Systems
Beginners Section
Linux & Unix Systems
File Downloads
Exploit Research & Discussion Trojan & Virus Errata
Networking Security / Firewall / IDS / VPN / Routers
System Hardening
E-Mail Security
Wifi Security
Trial Member Uploads
Upload discovered Trojans & Mal ware
GSO Programming Section
C , C++ , VC++
Visual Basic.NET
Perl /CGI
Java/Javascript
PHP/XML/ASP/HTML
Assembly + Other
The Cork Board
Network Security Consultant Directory
Network Security Jobs
The Archives
Encryption Information
General Network Security
Internet Anonymity
HTTP Protocol Security
Linux Security
MS IIS Information
Exploit Articles
Programming / Tool Design
GSO Software Projects
Public Downloads
Microsoft Security Questions and Papers

GhostShell
(IN C++)
keep in mind I am a beginner...
So I want to to write a simple app that is very useful. So what do you guys think that I could write that hasnt been done a thousand times that is very useful. What do you think you could use everyday to make your life on the pc easier. I am writing it for windows so keep that in mind. My whole thing is I just need some ideas bcuz i wanted some different opinions. Hmm some requirements would be that it isnt GUI and is for windows thats about it. so please leave your opinions. So tell me what tool you would like me to write smile.gif
spook
Try getting some inspiration, because just using others their inspiration won't help you the next time you make a program. You want to write a program that will help you gain some C skills..

Write something that you find useful, that you can use. if it already exists, you try to write a better one with extra functions. No?
GhostShell
QUOTE(spook @ Jun 22 2005, 09:45 PM)
Try getting some inspiration, because just using others their inspiration won't help you the next time you make a program. You want to write a program that will help you gain some C skills..

Write something that you find useful, that you can use. if it already exists, you try to write a better one with extra functions. No?
*


ok thx i will start thinking smile.gif
Yorn
You could make a command-line banner reader for HTTP:

Usage:
bannerreader.exe <IP> <Port> (default 80)

Automatically does a TCP connection and returns the server banner listing.

Sends:
--------START----------
GET / HTTP/1.0<CRLF><CRLF>
----------STOP------------

Receives:
--------START----------
HTTP/1.1 200 OK
Date: Tue, 21 Jun 2005 22:26:19 GMT
Server: Apache/1.3.33 (Unix) mod_gzip/1.3.26.1a mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.11 FrontPage/5.0.2.2634a mod_ssl/2.8.22 OpenSSL/0.9.7a
Last-Modified: Sat, 26 Feb 2005 03:09:52 GMT
ETag: "11dc030-b9d-421fe880"
Accept-Ranges: bytes
Content-Length: 2973
Connection: close
Content-Type: text/html
----------STOP------------

If you get my idea. Might take some work, but not much, just have it stop after reading "Content-Type".
GhostShell
sweet...i was thinking about something like that maybe a banner scanner.maybe an http banner grabber scanner smile.gif
Erion
I'd suggest you to get some confidence in coding with sockets (TCP, UDP, server, client, etc etc).

If you are starting to code do something you think it is usefull to you, not to the others, even if it is something that has already been done try to do it yourself to learn (and if you can't you always see what others have done....).

Cheers,
ninar12
just code a irc timebot biggrin.gif should be easy done with sockets
GhostShell
yeah i was also thinking of doing an irc bot type of thing but does anyone have some good c++ source of an irc bot to look at? or some examples names compiled versions doesnt really matter i just need some examples and opinions of irc bots. Or it would be cool if someone had there own irc bot coded in c++ that they could let me take a look at. Well I am looking for examples so please reply smile.gif
pedropalmeiro
i found that coding a trojan is one of the first thing that should be made when starting to learn a programming language. and/or an OS.
See, you learn:
- how to install and where to install stealth apps
- how to work with sockets, read write, blocking, non blocking... etc..
- possibly grabbing some screenshots
- play some .wav or mp3 like "I 0WNED YOU MACHINE" tongue.gif (very lame.. don't try it)
- interact with API. EX: create a new process, download a new file form the internet...
- open/close cdrom (even more lame... biggrin.gif )

..just some toughts that crossed my mind while replying....
this will create a lot of warning points by the ppl from the anti-virus companies that are reading this post... but what a hell, the guy just wants to learn a new language...
Yorn
It is important that you learn how to program with sockets pretty much right away. If you can't do that, you're never going to want to learn how to do much of anything else. Programmers code for the love of coding.
chris105
Yes definately a RAT (Remote administration tool) of some variety, you get to deal with APIs (just by putting simple features like open or close CD tray and little features like that which are mainly useless but good for learning). You also get to deal with sockets and a client / server sort of model. Go for reverse connect and then you have to deal with multiple connections. At the end of the learning experience you also have an undetected RAT to play around with. An IRC client is a good start too, read the RFC and it will give you experience in connecting to and dealing with a pre-established protocol. Then try and make your own chat protocol, make it P2P learn how clients find each other etc. Its really interesting. One thing I would say is dont rely on code snippets or looking at other peoples code, in fact dont look at examples unless you really need to and you thought about the problem for at least a few days and it wont go away. Reading the manual is alright and so is looking up functions but you will gain more knowledge and ability to solve problems as well as a greater sense of acheivement if you do it by yourself.
raging_bull
Maybe you can make a tool that filters ip adresses out of an txt file.. so if you have a nuked dfind scan it can filter all the correct ip's out of it..

I would be very greatfull if you can make such like this!
SkitZZ
QUOTE(Yorn @ Jun 22 2005, 10:33 PM)
You could make a command-line banner reader for HTTP:
*


I decided to take your advice and learn a bit more about win sockets tongue.gif
I'm just a beginner so any comment, advice welcomed.

CODE
/*

HTTP Banner Grabber

Not much to say just a basic HTTP Banner Grabber.

Thanks to GSO, MSDN and google for the code :P

Thanks to Yorn and GSO for the idea;)

*/

#include <winsock.h>
#include <stdio.h>

#pragma comment(lib,"Ws2_32.lib")

SOCKET connSocket;
const char* sendHeader = "GET / HTTP/1.0\r\n\r\n";

void progUsage(char *prog)
{
printf("\n[+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+]\n");
printf("[+]\n");
printf("[+]\t\t      HTTP Banner Grabber coded by SkitZZ\n");
printf("[+]\n");
printf("[+]\n");
printf("[+] Usage: %s <server name> <port number>\n", prog );
printf("[+]\n");
printf("[+] \t   <server name> Server name or IP address.\n" );
printf("[+] \t   <port number> Server port number, default port is 80.\n");
printf("[+]\n");
printf("[+] Example: %s www.localhost.com 80\n", prog );
printf("[+] \t     %s localhost.com\n", prog );
printf("[+] \t     %s 127.0.0.1\n", prog );
printf("[+]\n");
printf("[+]\n");
printf("[+]\t\t\t\tThanks to GSO\n");
printf("[+]\n");
printf("[+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+][-][+]\n");
exit (1);
}

void closeSocket()
{
closesocket(connSocket);
WSACleanup();
exit (1);
}

void openSocket(char* serverName, int portNumber)
{
struct sockaddr_in addr;
struct hostent *hp;

connSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connSocket == INVALID_SOCKET)
{
 printf("\n[-] Error at SOCKET(): %ld\n", WSAGetLastError());
 closeSocket();
}

if (isalpha(serverName[0]))
{
 hp = gethostbyname(serverName);

 if (hp == NULL )
 {
  printf("\n[-] Error %d Can't resolve: %s\n", WSAGetLastError(), serverName);
  closeSocket();
 }

 memset(&addr,0,sizeof(addr));
 memcpy(&(addr.sin_addr),hp->h_addr,hp->h_length);
}
else
{
 memset(&addr,0,sizeof(addr));
 addr.sin_addr.s_addr = inet_addr(serverName);
}

addr.sin_family=AF_INET;
addr.sin_port = htons(portNumber);

printf("\n[+] Connecting to %s port %d\n", inet_ntoa(addr.sin_addr), portNumber);

if (connect(connSocket, (struct sockaddr*) &addr, sizeof(addr)) == SOCKET_ERROR)
{
 printf("\n[-] Error %d. Failed to connect to %s\n", WSAGetLastError(), serverName);
 closeSocket();
}
}

int main(int argc, char** argv)
{
int portNumber, socketRead, result, i=0;
char recvbuff[1028], banner[256];
char *pdest;
WSAData wData;

if(argc != 2 && argc != 3)
{
 progUsage(argv[0]);
}

if (WSAStartup(MAKEWORD(2, 0), &wData) != NO_ERROR)
{
 printf("\n[-] WSA initialization failed.\n");
 return 1;
}

if(argc == 3)
{
 portNumber = atoi(argv[2]);
 openSocket(argv[1], portNumber);
}
else
{
 portNumber = 80;
 openSocket(argv[1], portNumber);
}

send(connSocket, sendHeader, strlen(sendHeader), 0);

socketRead = recv(connSocket, recvbuff, sizeof(recvbuff), 0);

if(socketRead == 0)
{
 printf("\n[-] Error %d. Can't receive from %s\n", WSAGetLastError(), argv[1]);
 closeSocket();
}

pdest = strstr(recvbuff, "Server: ");

if(pdest == 0)
{
 printf("\n[-] Can't find banner at %s\n", argv[1]);
 closeSocket();
}

result = (int)(pdest - recvbuff + 8);

   do
{
 banner[i++]=recvbuff[result++];
 banner[i]='\0';
   }
while (recvbuff[result] != '\n');

printf("[+] Banner recived from %s: %s\n",argv[1],banner);

closeSocket();

return 0;
}


Examples:
CODE
C:\>http_bg.exe 192.168.92.130

[+] Connecting to 192.168.92.130 port 80
[+] Banner recived from 192.168.92.130: Microsoft-IIS/5.0

C:\>http_bg.exe 192.168.92.131 80

[+] Connecting to 192.168.92.131 port 80
[+] Banner recived from 192.168.92.131: Apache/2.0.36 (Unix) mod_ssl/2.0.36 OpenSSL/0.9.6b PHP/4.2.1

C:\>http_bg.exe 192.168.92.132 81

[+] Connecting to 192.168.92.132 port 81
[+] Banner recived from 192.168.92.132: Apache/2.0.54 (Win32) PHP/5.0.4

C:\C\http_grabber\http_bg>



[attachmentid=3577]

SkitZZ
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.