본문 바로가기

Python80

간단한 자동명령 수행 간단한 자동명령 수행참조: 스마트폰에 원하는 파일 자동 업로드참조: pwntools install 및 Getting Started(ftp 접속) 1.소스 ''' write by SpeeDr00t ''' from pwn import * class cshell : ''' get shell ''' def __init__(self) : self.handle = '' def get_shell(self) : self.handle = process('/bin/sh') self.handle.sendline('pwd') print self.handle.recvline() + "\n" return self.handle def send_cmd(self,cmd,until_str='$' ) : self.handle.sendli.. 2016. 11. 3.
whitehat cft 문제 whitehat cft 문제 급하게 짜느라고 소스는 엉망이지만 , 나중을 위해 기록^^ from pwn import * from re import findall from subprocess import check_output c = remote("121.78.147.159", 55511) r = c.recvuntil("input Opcode") print r code = "" i=0 eax = 0xeb172f5b ebx = 0x5be4d5fa ecx = 0x8aabb74e edx = 0xca568210 esp = 0xb0a6bd97 ebp = 0x2044ada2 esi = 0xefc7fe7a edi = 0x6f9d6a62 for s in findall(".{3} = 0x.{0,8}", r): s = s... 2016. 10. 10.
powershell(ubuntu version)에서 python 호출하기 powershell(ubuntu version)에서 python 호출하기 1. class1.py #!/usr/bin/python3 import json # Define a class with a method that returns JSON class returnsjson: def method1(this): return json.dumps(['foo', { 'bar': ('baz', None, 1.0, 2), 'buz': ('foo1', 'foo2', 'foo3') }, 'alpha', 1,2,3]) c = returnsjson() print (c.method1()) 2. class1.ps1 # # Wrap Python script in such a way to make it easy to # consum.. 2016. 8. 22.
file write ][ 랜덤하게 파일을 생성해서 임의 데이터 쓰기 file write ][ 랜덤하게 파일을 생성해서 임의 데이터 쓰기 import random data = "00000000" ascii_str1 = ['a', 'b', 'c', 'd', 'e' , 'f' , 'g' ,'h' , 'i' , 'j' ,'k', 'l' ,'m' ,'n' ] ascii_str2 = ['o', 'p', 'q', 'r', 's' , 't' , 'u' ,'v' , 'w' , 'x' ,'y', 'z' ] for t in range(1,100000000): rand_str1 = random.choice(ascii_str1) rand_str2 = random.choice(ascii_str2) filename = "d:\\test" + rand_str1 + rand_str2 + "%d.txt.. 2016. 8. 8.