tcp request

programming/perl 2010. 5. 10. 09:29 |
$ARGC=@ARGV;
if ($ARGC !=2) {
        print "Usage: $0 <host> <port>\n";
        print "Example: $0 192.168.1.210 445\n";
        exit;
}
use Socket;

my($remote,$port,$iaddr,$paddr,$proto);
$remote=$ARGV[0];
$port = $ARGV[1];

$iaddr = inet_aton($remote) or die "Error: $!";
$paddr = sockaddr_in($port, $iaddr) or die "Error: $!";
$proto = getprotobyname('tcp') or die "Error: $!";

socket(SOCK, PF_INET, SOCK_STREAM, $proto) or die "Error: $!";
#connect(SOCK, $paddr) or die "Error: $!";
connect(SOCK, $paddr);

$sploit="\x30\x30\x30";

print $sploit;
send(SOCK, $sploit,0 ) or die "Cannot send query: $!";
sleep(1);
close(SOCK);
exit;

'programming > perl' 카테고리의 다른 글

socket TCP server  (0) 2010.05.10
udp request  (0) 2010.05.10
외부파일실행예제  (0) 2010.04.28
웹페이지 긁어오기 예제  (0) 2010.04.09
HTTP 파일업로드(Perl)  (0) 2009.12.30
Posted by applicationlayer
:

gcc -lz옵션

programming/C++ 2010. 5. 6. 21:08 |
poc를 컴파일하는데 에러가 발생했다

#gcc poc.c -o poc
/tmp/ccKjCDpt.o(.text+0x214): In function `zflush':
: undefined reference to `deflate'
/tmp/ccKjCDpt.o(.text+0x3c7): In function `zgetch':
: undefined reference to `inflate'
/tmp/ccKjCDpt.o(.text+0x4e3): In function `do_compression':
: undefined reference to `deflateInit_'
/tmp/ccKjCDpt.o(.text+0x4fa): In function `do_compression':
: undefined reference to `inflateInit_'
collect2: ld returned 1 exit status

compress관련 라이브러리인 libzip을 링크시켜야 된단다.

아래와 같은 옵션을 사용하여 컴파일이 가능하다.

#gcc poc.c -o poc -lz




'programming > C++' 카테고리의 다른 글

wireshark 의 패킷수집절차  (0) 2010.07.17
main, _tmain, wmain  (0) 2010.04.17
CString형변환  (0) 2009.10.12
Posted by applicationlayer
:

출처: http://kaiserinlee.thoth.kr/?mid=blog&document_srl=1335548


- session_start(); 전에 출력문이 있으면 안된다.

- 그래도 안된다면 세션변수가 저장되는 폴더 권한을 777로 주었는지 확인해보자.

- 그래도 안된다면 UTF-8(BOM없음) 형식으로 저장해보자.

- 그래도 안된다면 모든 파일을 이 형식으로 저장하자.

- 그래도 안된다면 php.ini 에서 default-charset utf-8 로 설정해보라.

  난 이것도 안해줘서 경고문이 떴었다 -_ㅠ

- 설정은 모두 통일하자 !

'programming > php' 카테고리의 다른 글

PHP backticks shell command  (0) 2010.08.04
exec(함수  (0) 2010.04.22
safemode  (0) 2010.03.08
PHP 소스분석  (0) 2009.10.22
Posted by applicationlayer
: