2019. 11. 27.

iOS 취약점 점검 - DVIA 설치

1. 탈옥

  • 우선 iOS 폰이 탈옥이 되어있어야 한다. (루팅이라고도 함)
  • 탈옥의 방법은 굉장히 다양하고 애플 정책에 따라 계속 바뀌므로 따로 기재하지는 않는다


2. 점검 할 앱 설치 (DVIA) - http://damnvulnerableiosapp.com/(https://github.com/prateek147/DVIA-v2/releases)

  •  이는 무료로 제공하는 iOS 점검용 앱인데, swift와 object-c 버전이 각각 다운받을 수 있다. 
  • 그리고 루팅 폰에서 아래를 설치한다.
    • cydia 소스를 추가(https://cydia.akemi.ai/)
    • AppInst 설치
    • AppSync 설치
    • Apple File Conduit2 설치 (폰 리부팅)
  • Filezila 를 통해 다운받은 ipa 파일을 폰에 넣고 'appinst ipa파일명' 으로 권한을 부여한다


3. 점검 시작

  • 준비는 끝났으니 이제 점검을 수행하면 된다.
  • 테스트로 jailbreak Detection 을 우회해 본다. 
(IDA로 forjail 로 검색하면 쉽게 탈옥탐지 메소드를 찾을 수 있다.)
 (TBZ 이므로 frida를 실행하여 레지스트리 값을 변조한다)




Continue reading

2019. 10. 30.

[python] 크롤링 데이터를 mysql에 삽입

이전 포스트(https://coashanee5.blogspot.com/2019/10/blog-post_29.html)는 공공기관의 채용공고 사이트의 검색결과를 수집하여 기업명과, 공고URL을 출력하였다. 이번 포스트에서는 수집한 내용을 데이터베이스에 넣어 보도록 하겠다.

1. 우선 mysql을 설치를 한 후, 데이터를 넣기 위한 데이터베이스를 만든다. 
create DataBase scraping;
2. 이번에는 데이터를 저장할 테이블을 생성한다. 
create Table job_offer (id BIGINT(7) NOT NULL AUTO_INCREMENT, comp VARCHAR(200), title VARCHAR(200), URL VARCHAR(1000), created TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(id));

3. 기존 소스에 DB연결과 데이터를 저장하는 내용을 추가한다.

# 공공기관 채용정보에서 정보통신 공고만 추려서 리스팅하는 소스
import requests
from bs4 import BeautifulSoup
from urllib.request import urlopen
import re
import ssl
import datetime
import pymysql
context = ssl._create_unverified_context()


# url을 변수에 삽입하여 저장한다.
url = "https://job.alio.go.kr/recruit.do?pageNo=1&param=&search_yn=Y" \
      "&idx=&recruitYear=&recruitMonth=&detail_code=R600020&location=R3010&work_type=R1010" \
      "&work_type=R1030&career=R2020&education=R7010&education=R7040&education=R7050" \
      "&education=R7060&replacement=N&s_date=2019.03.12&e_date=2019.10.12&org_name=&title=&order=REG_DATE"

conn = pymysql.connect(host='127.0.0.1', user='root',passwd='test1234', db='mysql')
cur = conn.cursor()
cur.execute("USE scraping")

html = urlopen(url, context=context)
bsObj = BeautifulSoup(html.read(), "html.parser")

table = bsObj.find("table",class_="tbl type_03")

def extractNumber(word):
    i = int(re.findall('\d+', word)[0])
    return i

def store(comp, title, URL):
    cur.execute(
        "INSERT INTO job_offer (comp, title, URL) VALUES (\"%s\", \"%s\", \"%s\")", (comp, title, URL)
    )
    cur.connection.commit()

list = []
trs = table.tbody.findAll("tr")
for idx, tr in enumerate(trs):
    title = tr.select("td")[2].get_text().strip() # 제목
    comp = tr.select("td")[3].get_text().strip() # 기업명
    a = extractNumber(tr.select("td")[2].find("a").attrs['onclick'])

    new_url = "https://job.alio.go.kr/recruitview.do?pageNo=1&param=&search_yn=Y&idx={0}" \
              "&recruitYear=&recruitMonth=&detail_code=R600020&location=R3010&work_type=R1010" \
              "&work_type=R1030&career=R2020&education=R7010&education=R7040" \
              "&education=R7050&education=R7060&replacement=N&s_date=2019.03.12" \
              "&e_date=2019.10.12&org_name=&title=&order=REG_DATE".format(a)
    print(idx, title, comp, new_url)
    store(comp, title, new_url)

cur.close()
conn.close()

실행결과, 다음과 같이 데이터가 저장되는 것을 확인할 수 있다.


Continue reading

2019. 10. 29.

[python] 공공기관 채용정보시스템의 채용공고 출력하는 파이썬코드

공공기관 채용정보시스템에서 원하는 공고를 검색하여 크롤링하는 소스이다.

# 공공기관 채용정보에서 정보통신 공고만 추려서 리스팅하는 소스
import requests
from bs4 import BeautifulSoup
from urllib.request import urlopen
import re
import ssl
import datetime
context = ssl._create_unverified_context()


# url을 변수에 삽입하여 저장한다.
url = "https://job.alio.go.kr/recruit.do?pageNo=1&param=&search_yn=Y" \
      "&idx=&recruitYear=&recruitMonth=&detail_code=R600020&location=R3010&work_type=R1010" \
      "&work_type=R1030&career=R2020&education=R7010&education=R7040&education=R7050" \
      "&education=R7060&replacement=N&s_date=2019.03.12&e_date=2019.10.12&org_name=&title=&order=REG_DATE"

html = urlopen(url, context=context)
bsObj = BeautifulSoup(html.read(), "html.parser")

table = bsObj.find("table",class_="tbl type_03")

def extractNumber(word):
    i = int(re.findall('\d+', word)[0])
    return i

list = []
trs = table.tbody.findAll("tr")
for idx, tr in enumerate(trs):
    title = tr.select("td")[2].get_text().strip() # 제목
    gName = tr.select("td")[3].get_text().strip() # 기업명
    #place = tr.select("td")[4].get_text().strip().replace("\t","").replace("\r","").replace("\n","") # 장소
    #type = tr.select("td")[5].get_text().strip() # 고용 형태
    a = extractNumber(tr.select("td")[2].find("a").attrs['onclick'])

    new_url = "https://job.alio.go.kr/recruitview.do?pageNo=1&param=&search_yn=Y&idx={0}" \
              "&recruitYear=&recruitMonth=&detail_code=R600020&location=R3010&work_type=R1010" \
              "&work_type=R1030&career=R2020&education=R7010&education=R7040" \
              "&education=R7050&education=R7060&replacement=N&s_date=2019.03.12" \
              "&e_date=2019.10.12&org_name=&title=&order=REG_DATE".format(a)
    #list.append(title + ", " + gName + ", "+new_url)
    print(idx, title, gName, new_url)
#print (list)

실행 결과는 아래와 같다. 



이후에는 크롤링 결과를 1) 엑셀 다운로드, 2) 메일 전송 3) 웹 서버에 띄우기 이런 정도로 포스팅을 해 볼까 생각중이다.

Continue reading

Popular Posts

Recent Posts

Powered by Blogger.