Kali笔记

Posted by wsxq2 on 2018-06-01
TAGS:  noteLinuxKaliTODO

本文最后一次编辑时间:2019-09-28 09:40:44 +0800

updateToKaliLinux2017.1Release: apt update apt dist-upgrade reboot

#linux journalctl: journalctl journalctl –utc journalctl -b mkdir -p /var/log/journalctl or vi /etc/systemd/journald.conf: storage=persistent journalctl –list-boots journalctl -b -1 journalctl –since “2015-01-10 17:15:00” –until “2015-01-11” journalctl –since yesterday journalctl –since 09:00 –until “1 hour ago” journalctl -u nginx.service -u php-fpm.service –since today journalctl _PID=8088 journalctl _UID=0 –since today man systemd.journal-fields journalctl -F _GID journalctl /usr/bin/bash journalctl -k -b -5 journalctl -p err -b journalctl –no-full journalctl -a journalctl –no-pager journalctl -b -u nginx -o json-pretty journalctl -n 20 journalctl -f journalctl –disk-usage journalctl –vacuum-time=1years vi /etc/systemd/journald.conf: SystemMaxUse=?…

pppoe: apt install ppp pppoe pppoeconf pppoeconf /etc/ppp/peers/dsl-provider

ipv6: noipdefault nodefaultroute hide-password noauth persist plugin rp-pppoe.so nic-eth0 +ipv6 usepeerdns user “USERNAME” #from xidian wiki ping6 google.com vi /etc/resolv.conf family inet6 inet4 /etc/network/interfaces /etc/ppp/*-secrets /etc/resolv.conf pon poff plog ip a s ppp0

输入 export LANG=c (中文)或者 export LANG=en (英文) 其他 如 export LANG=zh_CN.UTF-8 export LANG=zh_CN.GBK export LANG=en_US.UTF-8

look a picture: eog o.png apt install imagemagick

pdf: eog 图片查看器 evince 文档查看器 nautilus 文件管理 totem 视频 gnome-tweak-tool 优化工具 florence 虚拟键盘 dconf-editor gnome-disks baobab 磁盘管理 file-roller 压缩文件管理器 gnome-calculator file 查看文件类型 goldendict

grub-install vi /etc/default/grub update-grub

kali boot resolv.conf disappear: sed -i ‘/plugins/s/$/,ofono/’ /etc/NetworkManager/NetworkManager.conf solve weitoguan: sed -i ‘/managed/s/false/true/’ /etc/NetworkManager/NetworkManager.conf reboot

install a new clipboard: sudo apt-get install parcellite

add new user: useradd -m -G video,audio,cdrom,sudo -s /bin/bash 用户名 passwd 用户名 enable automaticlogin: sed -i -e ‘/AutomaticLogin/s/^#//’ -e ‘/AutomaticLogin\b/s/root/sky/’ /etc/gdm3/daemon.conf

env: PWD OLDPWD PATH 决定了shell将到哪些目录中寻找命令或程序 HOME 当前用户主目录 HISTSIZE 历史记录数 LOGNAME 当前用户的登录名 HOSTNAME 指主机的名称 SHELL 当前用户Shell类型 LANGUGE  语言相关的环境变量,多语言可以修改此环境变量 MAIL 当前用户的邮件存放目录 PS1 基本提示符,对于root用户是#,对于普通用户是$

disk: blkid e2label

install monaco: fc-list:lang=zh mkdir /usr/share/fonts/my_fonts cp ./MONACO.TTF /usr/share/fonts/my_fonts cd /usr/share/fonts/my_fonts mkfontscale mdfontdir git clone https://github.com/cstrap/monaco-font ./monaco-font/install-font-ubuntu.sh https://raw.githubusercontent.com/todylu/monaco.ttf/master/monaco.ttf rm -rf monaco-font

apt install cmus

Network: vi /etc/network/interfaces vi /etc/resolv.conf

iptables: vi /etc/iptables/rules.v4 iptables -nvL

xxd: xxd a.txt xxd a.txt a

nc: nc 192.168.1.100 1080 -vvv nc -lvvvp 33389|xxd

type: typespeed ktouch

installPinYinInputMethod: apt install fcitx-googlepinyin im-config wget -O sogoupinyin64.deb “http://pinyin.sogou.com/linux/download.php?f=linux&bit=64” dpkg -i sogoupinyin64.deb apt -f -y install dpkg -i sogoupinyin64.deb echo “sogoupinyin hold” | dpkg –set-selections

solve “a job is …”: vi /etc/systemd/system.conf vi /etc/systemd/system/network-online.target.wants/networking.service systemctl daemon-reload

installVBoxadditionalfunctions: apt-cache search linux-headers apt-get install linux-headers-4.9.0-kali1-amd64 apt-cache search linux-image apt-get install linux-image-4.9.0-kali1-amd64 apt install module-assistant apt install gcc make reboot cp /media/cdrom0/VBoxLinuxAdditions.run ~/ chmod a+x VBoxLinuxAdditions.run ./VBoxLinuxAdditions.run reboot

getTheNetip: curl ifconfig.me curl http://members.3322.org/dyndns/getip wget http://ifconfig.me/ip wget http://members.3322.org/dyndns/getip

about apt: apt, apt-get, apt-cache, apt-file dpkg, dpkg-query apt list, apt show, apt search apt-file list ibus| grep conf dpkg -L ibus|grep conf yum whatprovides *netstat rpm -qf which ls dpkg -S which scp dpkg -S scp|grep ssh apt-file search mkdosfs | egrep mkdosfs dpkg -L openssh-client |grep bin

mailx: wget -O mailx.tar.bz2 http://sourceforge.net/projects/heirloom/files/latest/download?source=files cd mailx* make make install UCBINSTALL=/usr/bin/install vi /etc/nail.rc

netstat: netstat -atu netstat -r netstat -nutlpe netstat -a|grep ssh

git: apt install git ./config, make, make install git config –global user.name “your name” git config –global user.email “your email” mkdir learngit cd learngit git init 只能跟踪文本文件的改动,对于二进制文件只能把每次改动串起来,而word是二进制文件 git add readme.txt git commit -m “wrote a readme file” git status git diff readme.txt git log git log –pretty=oneline git reset –hard HEAD^ git reset –hard 3628164 git reflog git diff HEAD – readme.txt *git checkout – readme.txt git reset HEAD readme.txt git rm test.txt ssh-keygen -t rsa -C “your email” paste id_rsa.pub to gihub accounts create a new repository learngit git remote add origin git@github.com:michaelliao/learngit.git git push -u origin master git push origin master git clone git@github.com:michaelliao/gitskills.git git https://github.com/michaelliao/gitskills.git git checkout -b dev(or git branch dev && git checkout dev) git branch git merge dev git branch -d dev git log –graph –pretty=oneline –abbrev-commit git log –graph git merge –no-ff -m “merge with no-ff” dev git stash git stash list git stash pop(or git stash apply && git stash drop) git stash apply stash@{0} git checkout -b feature git branch -D feature git remote -v git push origin dev/master git checkout -b branch-name orgin/branch-name git pull git branch –set-upstream dev origin/dev git tag -a v1.0 -m “version 1.0 released” 6224937 git show v1.0 git tag -s v0.2 -m “signed version 0.2 released” fec145a git push origin v0.2 git push origin –tags git tag -d v0.2 git push origin :refs/tags/v0.2 git clone git@github.com:michaelliao/bootstrap.git git remote add github git@github.com:michaelliao/learngit.git git config –global color.ui true .gitignore: git根目录 https://github.com/github/gitignore git add -f app.class git check-ignore -v app.class git config –global alias.st status git st git config –global alias.unstage ‘reset HEAD’ git unstage test.py git config –global alias.last ‘log -1’ git config –global alias.lg “log –color –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit” vi .git/config 搭建git服务器 apt install git useradd git 导入所有需要登录的用户的id_rsa.pub到/home/git/.ssh/authorized_keys git init –bare /srv/sample.git chown -R git:git sample.git vi /etc/passwd git:x:1001:1001:,,,:/home/git:/usr/bin/git-shell git clone git@server:/srv/sample.git ssh公钥管理:gitosis git管理权限:gitolite

md: # ## ###

abc abc

I get 10 times more traffic from Google than from Yahoo or MSN.

alt text

alt text

#include <stdio.h>

If you want your page to validate under XHTML 1.0 Strict, you’ve got to put paragraph tags in your blockquotes:

For example.

kill: ps -ef|grep firefox ;kill -s 9 1827 kill -s 9 pgrep firefox pkill -9 firefox

firefox: about:config layout.css.devPixelsPerP 1.2

gpg: gpg –keyserver keyserver.ubuntu.com –recv 6AF0E1940624A220 gpg –export –armor 6AF0E1940624A220 | sudo apt-key add -

ss: deb http://ppa.launchpad.net/hzwhuang/ss-qt5/ubuntu devel main apt update gpg –keyserver keyserver.ubuntu.com –recv 6DA746A05F00FA99 gpg –export –armor 6DA746A05F00FA99 | sudo apt-key add - apt-get update&&apt-get install shadowsocks-qt5 pip install genpac pip install –upgrade genpac mkdir vpnPAC cd vpnPAC touch user-rules.txt genpac -p “SOCKS5 127.0.0.1:1080” –gfwlist-proxy=”SOCKS5 127.0.0.1:1080” –output=”autoproxy.pac” –gfwlist-url=”https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt” –user-rule-from=”user-rules.txt” 系统设置自动代理file:///home/{user}/vpnPAC/autoproxy.pac … apt-get install python-pip && pip install shadowsocks vi /etc/ss.json sslocal -c /etc/ss.json -d start apt install proxychains vi /etc/proxychains.conf socks5 127.0.0.1 xxxx &&去掉dynamic_chain前面的注释符 /usr/lib/proxychains3/proxyresolv google.com proxychains firefox

gdebi: apt install gdebi gdebi youdao.deb

crontab: man crontab crontab -e 0 20 * * * /usr/local/bin/put

python: 在默认情况下,Python的module的默认安装目录是 /usr/local/lib/pythonX.Y/site-packages pip install module

vi /etc/init.d/rc.local chmod u+x /etc/init.d/rc.local update-rc.d rc.local start 99 2 3 4 5 . stop 01 0 1 6 . update-rc.d -f rc.local remove

source /etc/profile (或者source .profile)

ctrl+左移动到词的开头,shift+ctrl+方向键选定这个词。 ctrl+delete 删除一个词 想删除两个,ctrl+delete ctrl+delete 删除一行:home移动到行首,shift+下,delete。

command: xdg-open

shortcut keys: Ctrl+Alt+C Super+I Ctrl+M Ctrl+Alt+Tab Alt+Tab Super+Up Super+Down Super+D Ctrl+Print Ctrl+Alt+Print Shift+Ctrl+Print Print Alt+Print Shift+Print Shift+Ctrl+Alt+R Alt+F4 Alt+F7 Alt+F8 Super+Up Super+Down Super+H Super+F10 Super+A Alt+F1 Alt+F2 Super+V Ctrl+Alt+Delete Super+L Ctrl+Alt+P Ctrl+Alt+K Super+Home Super+End

last(/var/log/wtmp) lastlog(/var/log/lastlog) w mount -t vfat /dev/sdc1 /mnt/usb runlevel shutdown -chr 3:00 reboot tar tf a.tar.gz man -f|k passwd man 5 passwd whatis apropos greb -vi “find /etc -size +20k -a -size -50k -exec ls -lh {} \;” which whereis locate(/var/lib/mlocate/mlocate) updatedb(/etc/updatedb.conf) service networking restart netstat -nutlp|-an

cat > a.txt «EOF cat » a.txt «EOF cat a1.txt a2.txt > a.txt echo ‘

chown -R sky:sky note/ zip -r kali.zip ~/{note,workspace,default-conf,custom-conf} diff

auestion: 1.sed:”lalala124,412123afsda 3 2.1.4.24d kasfa 1.2.3.4” ->”1.2.3.4”

sed: sed ‘/.abc/!p’ test sed ‘s/unix/#/g;s/[^#]//g;s/#/unix/g’ test echo 02188888888 | sed ‘s/^/(./)$/t/1/’ | sed ‘s/^t_021/021/’ | sed ‘s/^_t.*$/bar/’