본문 바로가기
  • Tried. Failed. Logged.
728x90

분류 전체보기720

파이썬 - 맥 주소 변경(changeMAC) changeMAC.py (관리자 권한 필요) from winreg import * import os, time def run(adapterName, adapterType="Wi-Fi"): aReg = ConnectRegistry(None, HKEY_LOCAL_MACHINE) aKey = OpenKey(aReg, r"SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}") oKey = None sValue = None for i in range(255): try: aValue_name = EnumKey(aKey, i) oKey = OpenKey(aKey, aValue_name) sValue = QueryValueEx(oK.. 2023. 5. 2.
윈도우 - 맥 주소(MAC Address) 변경 with 레지스트리 수정 수동으로 맥 주소 변경: 장치 관리자 > 네트워크 어댑터 > 속성 > 고급 > 로컬 관리 주소 > 값 수정 맥 주소, 사설 아이피 변경 확인 명령어 ipconfig /all cmd로 레지스트리 수정(관리자 권한 실행 필요) reg add HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0001 /v NetworkAddress /d 000000000000 # 이더넷일 경우 netsh interface set interface "이더넷" disable netsh interface set interface "이더넷" enable # 와이파이일 경우 netsh interface set interface "Wi-F.. 2023. 5. 2.
윈도우 - 인터넷 끊기, DHCP 구성 해제/할당(ipconfig /release, ipconfig /renew) 인터넷 끊기(이더넷) | DHCP 구성 해제(할당되어있는 IPv4 주소 해제) ipconfig /release 인터넷 연결(이더넷) | DHCP로부터 새로운 IPv4 주소를 할당 ipconfig /renew 인터넷 끊기(와이파이) ipconfig /release Wi-Fi 인터넷 연결(와이파이) ipconfig /renew Wi-Fi 출처: https://superuser.com/questions/1719455/ipconfig-release-renew-for-wi-fi-doesnt-work ipconfig release/renew for Wi-Fi doesn't work ipconfig /renew Wi-Fi ipconfig /release Wi-Fi Either of those commands don'.. 2023. 5. 2.
DreamHack - Mitigation: Stack Canary 실습 문제(카나리 값 구하기) https://learn.dreamhack.io/112#p2477 로그인 | Dreamhack dreamhack.io 우선 a를 8개 이하로 입력할 경우 아무런 문제는 없어 보인다. 만일 a를 9개를 입력하게 된다면 뒷부분에 tTc(xU8라는 이상한 값이 붙는다. 메모리를 눈으로 확인하면 카나리 영역에는 저런 식으로 값이 저장돼있는 것이다. 왜 a를 8개를 입력하면 카나리 값이 출력이 되지 않는가? 그 이유는 카나리에 문자 끝 부분에는 \x00인 즉 NULL을 가지고 있기 때문에 printf 출력을 하면 문자의 끝으로 인식이 되어 카나리 값이 함께 출력되지 않은 것이다. 그러므로 카나리를 유추하기 위해서는 \x00 부분을 다른 문자로 덮어 씌어서 나머지 7바이트를 가져오고 \x00을 그 앞에다 붙이면 진.. 2023. 5. 1.
DreamHack - Return to Shellcode 풀이 r2s.c // Name: r2s.c // Compile: gcc -o r2s r2s.c -zexecstack #include #include void init() { setvbuf(stdin, 0, 2, 0); setvbuf(stdout, 0, 2, 0); } int main() { char buf[0x50]; init(); printf("Address of the buf: %p\n", buf); printf("Distance between buf and $rbp: %ld\n", (char*)__builtin_frame_address(0) - buf); printf("[1] Leak the canary\n"); printf("Input: "); fflush(stdout); read(0, buf, 0x1.. 2023. 5. 1.
DreamHack - Quiz: x86 Assembly 1 문제 end로 점프하면 프로그램이 종료된다고 가정하자. 프로그램이 종료됐을 때, 0x400000 부터 0x400019까지의 데이터를 대응되는 아스키 문자로 변환하면 어느 문자열이 나오는가? [Register] rcx = 0 rdx = 0 rsi = 0x400000 ======================= [Memory] 0x400000 | 0x67 0x55 0x5c 0x53 0x5f 0x5d 0x55 0x10 0x400008 | 0x44 0x5f 0x10 0x51 0x43 0x43 0x55 0x5d 0x400010 | 0x52 0x5c 0x49 0x10 0x47 0x5f 0x42 0x5c 0x400018 | 0x54 0x11 0x00 0x00 0x00 0x00 0x00 0x00 =============.. 2023. 5. 1.
DreamHack - Return Address Overwrite rao.c // Name: rao.c // Compile: gcc -o rao rao.c -fno-stack-protector -no-pie #include #include void init() { setvbuf(stdin, 0, 2, 0); setvbuf(stdout, 0, 2, 0); } void get_shell() { char *cmd = "/bin/sh"; char *args[] = {cmd, NULL}; execve(cmd, args, NULL); } int main() { char buf[0x28]; init(); printf("Input: "); scanf("%s", buf); return 0; } 버퍼의 사이즈는 0x28(40 bytes)이며, get_shell() 함수로 return 하.. 2023. 4. 30.
OSINT 관련 도구 모음(API, 검색 엔진 등) https://github.com/cipher387 cipher387 - OverviewHello, I am cipher387 (aka @cyb_detective). I am very passionate about OSINT (Open Source INTelligence) and everything related to it. - cipher387github.com 2023. 4. 28.
윈도우 - cmd 관리자 권한 실행인지 확인 하기 @echo off bcdedit >>nul if %errorlevel% == 1 ( echo 관리자 권한이 아닙니다. pause exit ) echo 관리자 권한으로 실행하였습니다. pause exit 출처: https://gaesae.com/74 CMD 관리자 권한으로 실행 여부 체크하기 배치파일 작성 시 관리자 권한이 필요한 프로그램을 실행시켜야하는 경우가 있습니다. 해당 코드가 실행되기 전에 미리 관리자 권한으로 실행 되었는지 체크하여 관리자 권한으로 실행되지 않 gaesae.com 2023. 4. 27.
DreamHack - basic_exploitation_000 풀이 basic_exploitation_000.c #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); signal(SIGALRM, alarm_handler); alarm(30); } int main(int argc, char *argv[]) { char buf[0x80]; initialize(); printf("buf = (%p)\n", buf); scanf("%141s", buf); return 0; } 사용자로부터 141 바이트 크기의 문자열을 입.. 2023. 4. 26.
DreamHack - basic_exploitation_001 풀이 checksec으로 파일 보호 기법들 확인 NX(No-eXecute) 보호 기법이 활성화되어 있으므로, 쉘 코드는 실행되지 않지만, Stack Canary가 활성화되지 않은 것으로 보아 Return Address Overwrite에 취약하다는 것을 알 수 있다. basic_exploitation_001.c 분석 #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); signal(SIGALRM, alarm_handler); alarm(30); } vo.. 2023. 4. 25.
다크넷 - 윈도우에서 Tor로 히든 서비스 생성하기 1. Tor Project 공식 사이트에서 Tor 브라우저 다운로드 https://www.torproject.org/ko/download/ The Tor Project | Privacy & Freedom OnlineDefend yourself against tracking and surveillance. Circumvent censorship.www.torproject.org 2. 파일 경로를 아래와 같이 배치tor.exe: C:\Tor\tor.exe torrc: C:\Tor\torrc 3. C:\Tor\torrc(Tor 설정 파일) 수정HiddenServiceDir "C:/Tor/hidden_service/" HiddenServicePort 80 127.0.0.1:80 4. 서비스 생성/삭제C:\Tor.. 2023. 4. 19.
728x90