๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • Tried. Failed. Logged.
728x90

์ „์ฒด ๊ธ€721

๋ฆฌ๋ˆ…์Šค - WSL2 Ubuntu cmd์—์„œ ์‰˜ ์ง„์ž… Ubuntu ์‰˜ ์ง„์ž… wsl -d ubuntu ์‹œ์ž‘ ๊ฒฝ๋กœ ์ง€์ • wsl --cd / -d ubuntu WSL ๋ฆฌ์ŠคํŠธ wsl --list 2023. 5. 4.
ํŒŒ์ด์ฌ - ๋งฅ ์ฃผ์†Œ ๋ณ€๊ฒฝ(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.
728x90