从零开始的学习生涯

FDrag0n的学习生涯

  • 首页
  • 标签
  • 分类
  • 归档
  • 关于
  • 搜索

Linux后门总结

发表于 2018-11-07

测试环境

ubuntu16.04
反弹shell目标:127.0.0.1:233

cron定时反弹shell

阅读全文 »

HCTF2018-Kzone

发表于 2018-10-19

Kzone

随手一测发现备份文件泄露,www.zip,下载后代码审计。

看到有后台

查看login.php的源码:/www/admin

发现引入了配置文件../include/common.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

error_reporting(0);
header('Content-Type: text/html; charset=UTF-8');
define('IN_CRONLITE', true);
define('ROOT', dirname(__FILE__).'/');
define('LOGIN_KEY', 'abchdbb679546');
date_default_timezone_set("PRC");
$date = date("Y-m-d H:i:s");
session_start();

include ROOT.'../config.php';

if(!isset($port))$port='3306';
include_once(ROOT."db.class.php");
$DB=new DB($host,$user,$pwd,$dbname,$port);

$password_hash='!@#%!s!';
require_once "safe.php";
require_once ROOT."function.php";
require_once ROOT."member.php";
require_once ROOT."os.php";
require_once ROOT."kill.intercept.php";
?>
阅读全文 »

SCTF2018-nginx的秘密wp

发表于 2018-09-13

NGINX的秘密

NGINX配置问题导致任意文件读取 /static../etc/nginx/nginx.conf,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

#access_log /var/log/nginx/access.log;
#error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

proxy_cache_path /tmp/mycache levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=30s use_temp_path=off;

limit_conn_zone $binary_remote_addr zone=conn:10m;
limit_req_zone $binary_remote_addr zone=allips:10m rate=2r/s;


server {
listen 4455 default_server;
server_name localhost;

location /static {
alias /home/;
}

location ~* \.(css|js|gif|png){
proxy_cache my_cache;
proxy_cache_valid 200 30s;
proxy_pass http://bugweb.app:8000;
proxy_set_header Host $host:$server_port;
proxy_ignore_headers Expires Cache-Control Set-Cookie;
}

location / {
limit_conn conn 10;
proxy_pass http://bugweb.app:8000;
proxy_set_header Host $host:$server_port;
}
}
##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}


#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

可以看到开启了缓存,会把css|js|gif|png这四种文件类型缓存。

阅读全文 »

PHP数组与c数组差异而引发的安全问题

发表于 2018-08-24

C语言数组

C语言的数组都是由连续的内存位置组成。最低的地址对应第一个元素,最高的地址对应最后一个元素。

设有一个数组

1
int array[2];

无论是先给array[0]赋值,还是先给array[1]赋值,其在内存中的排序都是array[0]在前面array[1]在后面,所以无论是用指针指向array的最后一个单元还是直接引用array[1]的值,其所指的都是同一个值。

阅读全文 »

利用autorun.inf预防自动运行病毒及个性化磁盘图标

发表于 2018-08-13

AutoRun简介

AutoRun和AutoPlay是微软窗口系统的组件,其内容标示着系统在搜索到设备时可采取的行动。

AutoRun在Windows 95时首度露面,目的是帮助用户正确运行光盘上制作者想要运行的文件,另外AutoRun也能透过双击我的计算机内的设备图标启动AutoRun。但后来U盘病毒横行,微软发布更新关闭非光盘驱动器的AutoRun。

在Windows XP之后,微软让用户方便选择相关应用程序,制作出如图形化接口方式让用户选择如何处理设备中的文件。

AutoRun.inf文件

autrun.inf是我们电脑使用中比较常见的文件之一 ,其作用是允许在双击磁盘时自动运行指定的某个文件。但是近几年出现了用autorun.inf文件传播木马或病毒,它通过使用者的误操作让目标程序执行,达到侵入电脑的目的,带来了很大的负面影响。

AutoRun.inf的示例

[autorun] 
open=setup.exe 
icon=setup.exe,0
label=My install CD

双击盘符时会运行setup.exe,而显示图标为setup.exe中第0个图标(即第1个图标),标签是My install CD。

AutoRun.inf的默认激活

  • 插入设备时启动。
  • 双击我的计算机设备时启动。
  • 对我的计算机设备点击右键菜单中 “AutoRun” 项目时启动。
  • 其他(如点击根目录文件夹)则不会启动。

    windows XP 以前

  • 所有设备都会依照 Autorun.inf 启动。

    Windows 7

  • 只有光盘会先运行 autorun.inf

利用autorun.inf给硬盘改图标及简易防病毒

个性化磁盘—改图标

在对应磁盘的根目录新建一个记事本,然后修改里面内容

[AUTORUN]
ICON=drag0n.ico

然后将其保存为autorun.inf(注意ico的文件名字符不要超过6位)

阅读全文 »
123…5
FDrag0n

FDrag0n

菜鸡安全狗

22 日志
2 分类
5 标签
RSS
GitHub
0%
© 2020 FDrag0n
由 Hexo 强力驱动
|
主题 — NexT.Gemini v6.0.1