블로그 이미지
훅크선장

카테고리

분류 전체보기 (363)
사진이야기 (23)
펭귄컴퓨팅 (122)
컴퓨터보안 (84)
절름발이 프로그래머 (59)
하드웨어개조 (23)
멀알려줄까 (35)
잡다한것들 (15)
홈베이킹&홈쿠킹 (2)
Total
Today
Yesterday

달력

« » 2025.7
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

공지사항

태그목록

최근에 올라온 글

WPA 키 크랙을 위한 Rainbow 테이블이 있다고 한다.

1000개의 SSID와 백만개의 단어들로 만들어진 것이 총 33기가짜리이다.
미국돈으로 50달러에 팔고 있다.

1000개의 SSID와 17200개의 단어들도 이루어진 것은 총 7기가짜리로,
10 달러다.

그냥 Torrent로 다운받는 방법도 있는데...
언제나 받을 수 있으려나??



이 기능을 사용하려고,
Aircrack-ng 진영에서는 airolib-ng 라는 도구를 개발하고 있다.
아직 사용할 수 없지만, 향후 버전에서는 볼 수 있다고 한다. 



Posted by 훅크선장
, |
http://kemovitra.blogspot.com/2008/12/hacking-wpa-with-backtrack-3.html

몰라서 사용할 수 없었던,

BackTrack 3 라이브씨디안에 있는 패스워드 목록파일들.

/usr/local/john-1.7.2/password.lst
/pentest/fuzzers/spike/src/password.lst
/pentest/fuzzers/spike/src/wordlist
/pentest/password/pico/cowpatty/final-wordlist.txt.gz
/pentest/wireless/aircrack-ng/test/password.lst
/pentest/wireless/eapmd5pass/sample-wordlist.txt
/opt/windows-binaries/wordlist.txt.gz

나름 유용하게 쓸 데가 있지 않겠는가?

Dictionary Attack...
Posted by 훅크선장
, |
오랫만에 Aircrack-ng Suite에 대한 정보를 정리하다보니,

새롭게 눈에 띄는 것이 있었다.

바로 Aircarck-ng가 탑재된 리눅스 라이브씨디이다.

머, 이미 유명한 BackTrack 이 있지만서도,

Aircrack-ng 가 직접 만들고 있다는 장점? 때문에 한번 들여다 봤다.

원본 라이브씨디 : (프랑스 애들이 만든 거다.)

다운로드 받아서, 얼마나 잘 동작하는 지를 확인해봐야겠다.

근데, 크기가 24 메가 정도 밖에 안되는 것을 보니,
순수한 리눅스 커널과 aircrack-ng 만 들어있는 거 아닌가 모르겠다.
X-window는 커녕, 필요한 드라이버가 다 있는지도 의심스럽다.

aircrack-ng를 탑재한 라이브씨디 : 

추가:
부팅시켜보니, X-Window도 뜨고, 있을 껀 거의 다 있다.
다만, 한글지원은 안된다. 일본어 지원은 있던데... 쓰불~

역쉬 한글화된 Backtrack이 최고다~.
Posted by 훅크선장
, |
무선랜 관련 자료를 정리하다보니,

WPA Key Dictionary Attack에서 사용되는 특이한 하드웨어를 발견하게 되었다.


이 회사에서 만든 PCMCIA용 제품을 이용해서,
WPA Key 크랙킹 속도를 매우 향상시킬 수 있다.

그 성능은 이 블로그에 있는 BT3 Teaser 동영상에서 확인할 수 있다.

아무래도 국내에서 구하기는 틀린 것 같고..

직접 나가서 구할까 고민중이다. 가격은 얼마나 할까??
Posted by 훅크선장
, |
str() 계열의 함수나 다른 문자열 클래스를 이용하지 않는,
순수한 문자버퍼의 문자열 split 하는 예제

속도도 빠르고, 알고리즘도 신뢰할 수 있다.
순수 C언어 방신의 Split 방식이다.
----------------------------------------------------------------------------------
 DWORD len = 0, count = 0, line_count = 0 ; // 토큰 길이 변수, 토큰 개수 변수, 전체 행 개수 변수
 char line[LINE_MAX_STRING_LEN] = {0};  // 한 라인 문자열
 char *pLine, *cur_ptr, *start_pos;  // 라인 문자열 포인터,  라인내의 현재위치 포인터, 라인내의 시작위치 포인터
 char ipAddr[20] = {0}; // IP 주소를 담기 위한 문자열
 char url[LINE_MAX_STRING_LEN] = {0}; // URL을 담기 위한 문자열
 
 // 입력 파일 스트림으로 파일 열기
 ifstream logfile("a.txt");
 
 while( logFile.getline( line, LINE_MAX_STRING_LEN, '\n') ) // 각 라인을 읽어서, line 문자열 배열에 저장
 {
  // do something 

  count = 1;  // 토큰 개수 지정, 초기화
  line_count++;  // 전체 행 저장 변수 증가

  if( logFile.fail() == 1 ) // 라인을 읽다가 실패한 경우, 에러 출력  파일내용 삭제
  {
   cout << "Line is too Long.. Just Process " << LINE_MAX_STRING_LEN << "bytes.. (" << line_count << ")" << endl;
   logFile.clear();
  }


  if( line_count % 1000000 == 0 ) // 전체 라인 행수가 100만을 넘을 때마다, 화면에 표시를 해준다.
   cout << "   Now Processing " << line_count << "th line" << endl;

  if( line[0] == '#' ) continue;  // 라인의 첫 시작문자가 # 이면, 건너뛴다.
  
  pLine = line; // 라인 문자열 포인터를 지정한다. 초기화
  cur_ptr = pLine; // 라인 문자열 처음에 현재 위치 포인터를 지정한다. 초기화

  // 라인을 분석하기 시작한다.
  while( *cur_ptr != '\0' && *cur_ptr != '\r' && *cur_ptr != '\n' ) // NULL문자, Carrage-Return문자, New Line 문자가 나올 때까지 루프를 유지한다.
  {
   len = 1;  // 라인 문자열에서 추출되는 토큰 길이를 1로 지정, 초기화 

   // 공백문자는 뛰어넘음
   while( *cur_ptr == ' ' || *cur_ptr == '\t' ) 
   { 
  if( *cur_ptr == '\0' ) break;  // 중간에 NULL 문자가 나오면 루프 종료
    cur_ptr++;
   }

   if( *cur_ptr == '\0' )  // 중간에 NULL 문자가 나오면 루프 종료
    break;

   start_pos = cur_ptr; // 토큰 시작위치를 현재로 설정, 초기화

   // 공백문자가 아닌, 실제 문자에 대해서 문자 개수를 센다.
   while( *cur_ptr != ' ' && *cur_ptr != '\t' && *cur_ptr != '\0' ) { cur_ptr++; len++; }
   
   // 원하는 토큰을 저장한다.
   if( count == gSrcIPIdx ) 
   {
    len = min( len, 18 ); 
    lstrcpyn( ipAddr, start_pos, len ); 
    ipAddr[len] = '\0';
   } else if ( count == gUrlIdx )
   {
    len = min( len, LINE_MAX_STRING_LEN - 2);
    lstrcpyn( url, start_pos, len ); 
    url[len] = '\0';
   }
   count++; // 토큰 개수 증가
  }
}
Posted by 훅크선장
, |
함수로 작성된 string 과 wstring 상호 변환

        std::string wstring2string(std::wstring wstr) {
std::string str(wstr.length(),' ');
copy(wstr.begin(),wstr.end(),str.begin());
return str;
}

std::wstring string2wstring(std::string str) {
std::wstring wstr(str.length(),L' ');
copy(str.begin(),str.end(),wstr.begin());
return wstr;
}

Posted by 훅크선장
, |
http://hugman.tistory.com/entry/C-String-Utilts
-----------------------------------------------

namespace SU   // SU represents 'String Utilities'
{
std::vector<std::string> split(std::string& text, std::string separators )
{
size_t n = text.length();
size_t start, stop;
std::vector<std::string> result;
start = text.find_first_not_of(separators);
while ((start >= 0) && (start < n)) {
stop = text.find_first_of(separators, start);
if ((stop < 0) || (stop > n)) stop = n;
result.push_back(text.substr(start, stop - start));
start = text.find_first_not_of(separators, stop+1);
}
return result;
}
std::string FindAndReplace (const std::string& source, const std::string target, const std::string replacement)
{
std::string str = source;
std::string::size_type pos = 0,  // where we are now
found;   // where the found data is
if (target.size () > 0)  // searching for nothing will cause a loop
{
while ((found = str.find (target, pos)) != std::string::npos)
{
str.replace (found, target.size (), replacement);
pos = found + replacement.size ();
}
}
return str;
};  // end of FindAndReplace

bool IsTherePattern(const std::string source, const std::string pattern)
{
// Source string 에 pattern 이 존재하는지 안하는지 boolean value를 리턴한다.
if( source.find(pattern) != std::string::npos) {  // exist?
return true;
}
else {
return false;
}
}

// Trim related methods
// Refer : http://www.codeproject.com/vcpp/stl/stdstringtrim.asp
// 약간 수정함
std::string TrimStart(std::string str, const char *delims)  // trim delims in the start of string
{
str.erase(0, str.find_first_not_of(delims));
return str;
}

std::string TrimEnd(std::string str, const char *delims)    // trim delims in the end of string
{
str.erase(str.find_last_not_of(delims) + 1);
return str;
}

std::string Trim(std::string str, const char *delims)    // trim delims in the start and end of string
{
str = TrimStart(str, delims); 
str = TrimEnd(str, delims); 
return str;
}

// 소문자 대문자 변환
int ToLower(int c)
{
if(c>='A' && c<='Z') return c-'A'+'a';
else return c;
}

std::string ToLowerStrings(std::string str)
{
std::string result = "";
for(size_t i=0; i < str.length(); i++)
result += ToLower(str[i]);
return result;
}

int ToUpper(int c)
{
if(c>='a' && c<='z') return c-'a'+'A';
else return c;
}

std::string ToUpperStrings(std::string str)
{
std::string result = "";
for(size_t i=0; i <str.length(); i++)
result += ToUpper(str[i]);
return result;
}

#ifdef FOR_WINDOWS_ONLY 
std::string CString2std_string(CString str)
{
return LPSTR(LPCTSTR(str));
}


char* CString2char_pointer(CString str)
{
return LPSTR(LPCTSTR(str));
}

CString GetCurrentPath()
{
HMODULE hModule;
hModule = ::GetModuleHandle(NULL); // handle of current module
ASSERT(hModule != 0);

CString strExeFileName;
VERIFY(::GetModuleFileName(hModule, strExeFileName.GetBuffer(_MAX_PATH), 
_MAX_PATH));
strExeFileName.ReleaseBuffer();

char Drive[_MAX_DRIVE];
char Path[_MAX_PATH];
char Filename[_MAX_FNAME];
char Ext[_MAX_EXT];

// suha, for VC++ 2005, convert to char array from CString
char CharPath[_MAX_PATH]; 
for (int it = 0 ; it < _MAX_PATH ; it++)
{
CharPath[it] = strExeFileName.GetAt(it);
if (CharPath[it] == '\0') break;
}

_splitpath(CharPath, Drive, Path, Filename, Ext);

return CString(Drive)+CString(Path); // has trailing backslash
}
#endif
}
Posted by 훅크선장
, |
C++ 표준 문자열 string 객체를 wchar_t* 타입의 문자열로 바꾸는 함수

wchar_t* string2LPWSTR(const std::string input)
{
// null-call to get the size
size_t needed = ::mbstowcs(NULL,&input[0],input.length());

// allocate
std::wstring output;
output.resize(needed);

// real call
::mbstowcs(&output[0],&input[0],input.length());

// You asked for a pointer
wchar_t *pout = output.c_str();

return pout;
}
Posted by 훅크선장
, |
CString을 특별한 문자열을 기준으로 Split 하는 함수

사용법:  
CstringArray Splitstrings;
int numofsplitedstrings = SplitString(inputstring, L" ", Splitedstrings);

구현:
int SplitString(const CString& strInputString, const CString& strDelimiter, CStringArray& arrStringArray)
{
int iPos = 0;
int newPos = -1;
int sizeS2 = strDelimiter.GetLength();
int isize = strInputString.GetLength();

CArray<INT, int> positions;

newPos = strInputString.Find (strDelimiter, 0);

if( newPos < 0 )
return 0;

int numFound = 0;

while( newPos > iPos )
{
numFound++;
positions.Add(newPos);
iPos = newPos;
newPos = strInputString.Find (strDelimiter, iPos + sizeS2);
}

for( int i=0; i <= positions.GetSize(); i++ )
{
CString s;
if( i == 0 )
s = strInputString.Mid( i, positions[i] );
else
{
int offset = positions[i-1] + sizeS2;
if( offset < isize )
{
if( i == positions.GetSize() )
s = strInputString.Mid(offset);
else if( i > 0 )
s = strInputString.Mid( positions[i-1] + sizeS2, positions[i] - positions[i-1] - sizeS2 );
}
}
arrStringArray.Add(s);
}
return numFound;
}
Posted by 훅크선장
, |
아시는 분들은 다 아시는 내용을 잊지 않기 위해서, 글로 남겨봅니다.

1. 닥터 와트슨을 기본 디버거로 설정한다.
c:> Drwtwn32.exe -i

2. 닥터 와트슨의 로그 디렉토리를 간단한 경로로 바꿔준다.
너무 길고 찾아가기 어려운 로그 디렉토리를 c:\log 이런 식으로 바꿔준다.

3. 프로그램을 실행한다. 오류가 나면,
    로그파일과 user.dmp 파일이 생성된다.

4. 텍스트로 된 로그파일을 확인해본 후, user.dmp 파일을 연다.
    visual studio에서 열린다.

5. Visual Studio가 실행되면,
   1) 메뉴에서 디버그 -> 시작
   2) 솔루션 파일을 작성한다고 선택
   3) 에러상황이 발생하고 중단되면,
   4) 에러가 발생한 코드에서 오른쪽버튼으로 디스어셈블리로 이동하거나, 소스코드로 이동하여, 상황을 확인해본다.
   5) 메뉴에서 디버그 -> 창 -> 호출스택  선택
   6) 호출스택을 보면, Asm과 C, C++ 항목이 존재하고, 그중에서 C++을 선택하면,
       소스의 어떤 부분에서 에러가 발생하였는지를 알 수 있다.

       소스코드 어느 부분에서 에러가 발생했는 지를 알 수있다.
Posted by 훅크선장
, |