跳至主要内容

博文

目前显示的是 2015的博文

tcpdump基本用法

用法示例: tcpdump -nn -vvv -X host 192.168.0.138 and port 80 tcpdump host sundown tcpdump host helios and \( hot or ace \) tcpdump ip host ace and not helios tcpdump net ucb-ether tcpdump ’gateway snup and (port ftp or ftp-data)’ tcpdump ip and not net localnet tcpdump ’tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net localnet’ tcpdump ’tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)’ tcpdump ’gateway snup and ip[2:2] > 576’ tcpdump ’ether[0] & 1 = 0 and ip[16] >= 224’ tcpdump ’icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply’ 常用参数: −c count 捕获制定数目的包后退出 -nn 不转化IP和端口号 -vvv 输出详细信息 -X 以16进制和ASCII码同时显示包信息 -w 保存为PCAP格式文件 -r 从保存的PCAP文件读取信息

selinux-samba

samba_selinux(8)      Samba Selinux Policy documentation      samba_selinux(8) NAME        samba_selinux - Security Enhanced Linux Policy for Samba DESCRIPTION        Security-Enhanced Linux secures the Samba server via flexible mandatory        access control. FILE_CONTEXTS        SELinux requires files to have an extended attribute to define the file        type.   Policy  governs the access daemons have to these files.  If you        want to share files other than home directories, those  files  must  be        labeled samba_share_t.  So if you created a special directory /var/eng,        you would need to label the directory with the chcon tool.         chcon -t samba_share_t /var/eng        To make this ...

obfsproxy 混淆代理

1、安装2.7以上版本python 2、pip install obfsproxy 如果顺利的话,自动安装完成。 如果失败可以在Pypi官网手动下载包,解压后运行:setup.py install 3、执行服务端命令 setsid obfsproxy --data-dir ~/.obfs/ scramblesuit --dest 127.0.0.1:8388 --password 密码 server 0.0.0.0:443 > ~/.obfs/log 2>&1 & 注:密码由32位的大写字母和数字组成 4、客户端运行 obfsproxy scramblesuit --dest X.X.X.X:443 --password 密码 client 127.0.0.1:8443 混淆代理完成。

基于ss-redir的全局代理设置

# Create new chain iptables -t nat -N SHADOWSOCKS # Ignore your shadowsocks server's addresses # It's very IMPORTANT, just be careful. iptables -t nat -A SHADOWSOCKS -d xxx.xxx.xxx.xxx -j RETURN # 这一步非常重要!到服务端的出口数据不要再进行重定向,否则进入死循环 # Ignore LANs and any other addresses you'd like to bypass the proxy # See Wikipedia and RFC5735 for full list of reserved networks. # See ashi009/bestroutetb for a highly optimized CHN route list. iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN # Anything else should be redirected to shadowsocks's local port iptables -t nat...

基于SOCAT的安全转发

-- SOCAT安全转发代理 -- 软件官网:http://www.dest-unreach.org/socat/ 1、生成服务器和客户端证书 生成证书脚本如下: socat_cert.sh ****************************************************************************** #!/bin/bash if [ -z "$1"] ; then         echo "usage: socat_cert.sh <server/client name>"         exit 1 fi FILENAME=$1 openssl genrsa -out $FILENAME.key 1024 openssl req -new -key $FILENAME.key -x509 -days 3653 -out $FILENAME.crt cat $FILENAME.key $FILENAME.crt >$FILENAME.pem chmod 600 $FILENAME.key $FILENAME.pem ****************************************************************************** 将生成的证书分别复制到服务器和客户机的$HOME/etc目录下。 注: 服务器端需要的文件为:server.pem,client.crt 客户机需要的文件为:server.crt,client.pem 2、启动服务器端,例如(转发至SOCKS5的代理示例): nohup socat -d -d -d -d openssl-listen:4433,reuseaddr,fork,cert=$HOME/etc/server.pem,cafile=$HOME/etc/client.crt TCP4:127.0.0.1:2080 >socat.log 2>&1 3、启动客户端程序: nohup socat -d -d -d -d TCP4-LISTEN:4433,reuseaddr,fork...

IRSSI自动登录和加入频道

1、安装Authenticating with SASL并执行命令保存登录信息 下载cap_sasl.pl 安装脚本: mkdir -p ~/.irssi/scripts/autorun cd ~/.irssi/scripts/autorun ln -s /usr/share/irssi/scripts/cap_sasl.pl cap_sasl.pl 执行irssi -n 昵称 在irssi中输入命令: /RUN cap_sasl.pl /sasl set freenode 昵称 密码 认证模式(通常为:PLAIN) /sasl save /save 2、加入自动登录功能 定义网络名称,以后的操作均基于此网络名称 /NETWORK ADD freenode 添加服务器定义 /SERVER ADD -auto -network freenode chat.freenode.net 7070 添加聊天频道 /CHANNEL ADD -auto #go-nuts freenode 注:如果已存的预定名称可能导致登录失败,可以用/NETWORK REMOVE或/SERVER REMOVE命令删除后重新添加