Hola roadd,
se puede hacer fuzzing en Windows? Porque no encuentro fuzz(Un fuzeador) para Windows.
Gracias y saludos
se puede hacer fuzzing en Windows? Porque no encuentro fuzz(Un fuzeador) para Windows.
Gracias y saludos
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
package anuMidSub;
import anuThreadSub.MessageReceiver;
import anuThreadSub.MessageSender;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import javax.microedition.io.Connector;
import javax.microedition.io.ServerSocketConnection;
import javax.microedition.io.SocketConnection;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Gauge;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.ItemCommandListener;
import javax.microedition.lcdui.Spacer;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
/**
* @author Anuja
*/
public class Friends connecter extends MIDlet implements CommandListener, ItemCommandListener, Runnable {
private Display display;
private Form chatServerForm;
private Command exitCmd;
private StringItem ipStrItem;
private StringItem startServerStrItem;
private Command startCmd;
private Form showIpForm;
private Gauge gaugeItem;
private Spacer spacerItem;
private ServerSocketConnection serSocCon;
private String deviceIp;
private SocketConnection socCon;
private DataInputStream is;
private DataOutputStream os;
private Form srvChattingFrm;
private TextField chatTxtFld;
private Alert infoAlert;
private Command sendCmd;
private String srvChatMsg;
private MessageSender msgSenderClass;
public void startApp() {
display = Display.getDisplay(this);
//-------------------------- Start chat server form --------------------
chatServerForm = new Form("Chat Server");
// \t use for getting tab space
startServerStrItem = new StringItem("Start Chat Server \t", "Start", Item.BUTTON);
chatServerForm.append(startServerStrItem);
startCmd = new Command("Start", Command.ITEM, 8);
startServerStrItem.setDefaultCommand(startCmd);
startServerStrItem.setItemCommandListener(this);
// Provide space as developer defined minWidth and minHeight
spacerItem = new Spacer(200, 50);
chatServerForm.append(spacerItem);
// Continuous-running state of a non-interactive Gauge with indefinite range
gaugeItem = new Gauge("Waiting for client... \n", false, Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING);
// Set layout position for this gauge item
gaugeItem.setLayout(Item.LAYOUT_CENTER);
chatServerForm.append(gaugeItem);
exitCmd = new Command("Exit", Command.EXIT, 7);
chatServerForm.addCommand(exitCmd);
chatServerForm.setCommandListener(this);
display.setCurrent(chatServerForm);
// ----------------------- Show IP form --------------------------------
showIpForm = new Form("Chat Server");
ipStrItem = new StringItem("Client must connect to this IP: \n\n", "My IP \n");
ipStrItem.setLayout(Item.LAYOUT_CENTER);
// setFont() sets the application's preferred font for rendering this StringItem.
ipStrItem.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
showIpForm.append(ipStrItem);
showIpForm.addCommand(exitCmd);
showIpForm.setCommandListener(this);
//------------------- Server chatting form -----------------------------
srvChattingFrm = new Form("Server Chatting...");
chatTxtFld = new TextField("Enter Chat", "", 160, TextField.ANY);
srvChattingFrm.append(chatTxtFld);
sendCmd = new Command("Send", Command.OK, 4);
srvChattingFrm.addCommand(sendCmd);
srvChattingFrm.addCommand(exitCmd);
srvChattingFrm.setCommandListener(this);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable d) {
if(c == exitCmd){
notifyDestroyed();
}else if(c == sendCmd){
// getString() gets the contents of the TextField as a string value.
srvChatMsg = chatTxtFld.getString();
// Send the chat to send() in MessageSender class
msgSenderClass.send(srvChatMsg);
}
}
public void commandAction(Command c, Item item) {
if(c == startCmd){
new Thread(this).start();
//Alert alert = new Alert("Working");
//display.setCurrent(alert);
}
}
public void run() {
System.out.println("Runnig");
try {
// ServerSocketConnection interface defines the server socket stream connection.
// Create the server listening socket for port 60000
serSocCon = (ServerSocketConnection) Connector.open("socket://:60000");
System.out.println("Open the socket...");
} catch (IOException ex) {
ex.printStackTrace();
}
try {
// Gets the local address to which the socket is bound.
// The host address(IP number) that can be used to connect to this end of the socket connection from an external system.
deviceIp = serSocCon.getLocalAddress();
System.out.println("Get device IP...");
} catch (IOException ex) {
ex.printStackTrace();
}
showIpForm.append(deviceIp);
display.setCurrent(showIpForm);
try {
System.out.println("Waiting for client request...");
// Wait for a connection.
// A socket is accessed using a generic connection string with an explicit host and port number.
// acceptAndOpen() inherited from interface javax.microedition.io.StreamConnectionNotifier
// Returns a StreamConnection object that represents a server side socket connection.
// The method blocks until a connection is made.
socCon = (SocketConnection) serSocCon.acceptAndOpen();
System.out.println("Accepted and open the connection...");
} catch (IOException ex) {
ex.printStackTrace();
}
try {
// InputStream is an abstract class and it is the superclass of all classes representing an input stream of bytes.
// openDataInputStream() inherited from interface javax.microedition.io.InputConnection
// openDataInputStream() Open and return an input stream for a connection.
is = socCon.openDataInputStream();
} catch (IOException ex) {
ex.printStackTrace();
}
try {
// OutputStream is an abstract class and it is the superclass of all classes representing an output stream of bytes.
// An output stream accepts output bytes and sends them to some sink.
// openDataOutputStream() inherited from interface javax.microedition.io.OutputConnection
// openDataOutputStream() open and return a data output stream for a connection.
os = socCon.openDataOutputStream();
} catch (IOException ex) {
ex.printStackTrace();
}
// Send our chat to other party
// Initialization part have to doen begining caz Send command want to use the send() in MessageSender class
// We pass the TextField as argement caz we want to clear the field before sent another chat
msgSenderClass = new MessageSender(os, chatTxtFld);
msgSenderClass.start();
//clear();
// Receive other party's chat and load our chatting interface
MessageReceiver msgReceiverClass = new MessageReceiver(is, srvChattingFrm);
msgReceiverClass.start();
infoAlert = new Alert("Client connected successfully.");
display.setCurrent(infoAlert, srvChattingFrm);
}
public void clear(){
chatTxtFld.setString("");
//msgSenderClass.start();
}
public TextField getChatTxtFld() {
return chatTxtFld;
}
}
using System;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Text;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
System.Net.Sockets.TcpClient clientSocket = new System.Net.Sockets.TcpClient();
NetworkStream serverStream;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
msg("Client Started");
clientSocket.Connect("127.0.0.1", 8888);
label1.Text = "Client Socket Program - Server Connected ...";
}
private void button1_Click(object sender, EventArgs e)
{
NetworkStream serverStream = clientSocket.GetStream();
byte[] outStream = System.Text.Encoding.ASCII.GetBytes("Message from Client$");
serverStream.Write(outStream, 0, outStream.Length);
serverStream.Flush();
byte[] inStream = new byte[10025];
serverStream.Read(inStream, 0, (int)clientSocket.ReceiveBufferSize);
string returndata = System.Text.Encoding.ASCII.GetString(inStream);
msg("Data from Server : " + returndata);
}
public void msg(string mesg)
{
textBox1.Text = textBox1.Text + Environment.NewLine + " >> " + mesg;
}
}
}
using System;
using System.Threading;
using System.Net.Sockets;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
TcpListener serverSocket = new TcpListener(8888);
TcpClient clientSocket = default(TcpClient);
int counter = 0;
serverSocket.Start();
Console.WriteLine(" >> " + "Server Started");
counter = 0;
while (true)
{
counter += 1;
clientSocket = serverSocket.AcceptTcpClient();
Console.WriteLine(" >> " + "Client No:" + Convert.ToString(counter) + " started!");
handleClinet client = new handleClinet();
client.startClient(clientSocket, Convert.ToString(counter));
}
clientSocket.Close();
serverSocket.Stop();
Console.WriteLine(" >> " + "exit");
Console.ReadLine();
}
}
//Class to handle each client request separatly
public class handleClinet
{
TcpClient clientSocket;
string clNo;
public void startClient(TcpClient inClientSocket, string clineNo)
{
this.clientSocket = inClientSocket;
this.clNo = clineNo;
Thread ctThread = new Thread(doChat);
ctThread.Start();
}
private void doChat()
{
int requestCount = 0;
byte[] bytesFrom = new byte[10025];
string dataFromClient = null;
Byte[] sendBytes = null;
string serverResponse = null;
string rCount = null;
requestCount = 0;
while ((true))
{
try
{
requestCount = requestCount + 1;
NetworkStream networkStream = clientSocket.GetStream();
networkStream.Read(bytesFrom, 0, (int)clientSocket.ReceiveBufferSize);
dataFromClient = System.Text.Encoding.ASCII.GetString(bytesFrom);
dataFromClient = dataFromClient.Substring(0, dataFromClient.IndexOf("$"));
Console.WriteLine(" >> " + "From client-" + clNo + dataFromClient);
rCount = Convert.ToString(requestCount);
serverResponse = "Server to clinet(" + clNo + ") " + rCount;
sendBytes = Encoding.ASCII.GetBytes(serverResponse);
networkStream.Write(sendBytes, 0, sendBytes.Length);
networkStream.Flush();
Console.WriteLine(" >> " + serverResponse);
}
catch (Exception ex)
{
Console.WriteLine(" >> " + ex.ToString());
}
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Sockets;
//code chat-bot by mauro & demon ares chat
namespace chat_bot_ares_by_mauro
{
public partial class Form1 : Form
{
public Socket Socket;
public System.Net.Sockets.NetworkStream Stream;
public byte[] AvatarStream;
public Form1()
{
InitializeComponent();
}
//
public void ConectarB0t(IPAddress ip, int puerto)
{
Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
label1.Text = "Conectando por favor espera";
try
{
Socket.Connect(new IPEndPoint(ip, Convert.ToInt32(puerto)));
}
catch (Exception ex)
{
}
if (Socket.Connected == true)
{
label1.Text = "Conectando iniciando protocolo";
Socket.Send(MSG_CHAT_CLIENT_LOGIN());
label1.Text = "Autenticado, chat bot conectado!";
}
else
{
}
}
private string GetLocalIpAddress()
{
throw new NotImplementedException();
}
private string Encriptar()
{
throw new NotImplementedException();
}
//
public byte[] MSG_CHAT_CLIENT_LOGIN()
{
//Aclaracion Este codigo no es de cb0t ni nada parecido!!!
List<byte> buffer = new List<byte>();
//nueva cadena de bytes
//id 2
buffer.AddRange(new byte[] { 2 });
buffer.AddRange(Guid.NewGuid().ToByteArray());
//guid 16 bytes
buffer.AddRange(BitConverter.GetBytes(Convert.ToInt16(666)));
//Numero de archivos
//Null 1byte
buffer.AddRange(new byte[] { 0 });
buffer.AddRange(BitConverter.GetBytes(Convert.ToInt16(5555)));
//puerto DC
//nueva cadena de bytes
//Nodos ip. 4bytes
//Nodos puerto 2 bytes
//4bytes Null.
buffer.AddRange(new byte[] {
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
});
buffer.AddRange(Encoding.UTF8.GetBytes(Nombre.Text));
//Nick x bytes
//Null 1byte
buffer.AddRange(new byte[] { 0 });
buffer.AddRange(Encoding.UTF8.GetBytes("chat bot c# by mauro - 1"));
//cliente version xbyte
//nueva cadena de bytes
//1byte Null.
//Local IpAdress 4 bytes
//External IpAdress Null. 4bytes
//client features 1 byte
//current upload 1byte
//maximum uploads allowed 1byte
//current queued users
//User años 1byte, User sexo 1byte, User country 1byte
buffer.AddRange(new byte[] {
0,
127,
0,
0,
1,
6,
6,
6,
6,
0,
0,
0,
0,
20,
1,
69
});
buffer.AddRange(Encoding.UTF8.GetBytes("Ares"));
//User location xbyte
//Null 1byte
buffer.AddRange(new byte[] { 0 });
buffer.InsertRange(0, BitConverter.GetBytes(Convert.ToInt16(buffer.Count - 1)));
return buffer.ToArray();
}
//
private void button1_Click(object sender, System.EventArgs e)
{
string i = IP.Text;
string p = Puerto.Text;
ConectarB0t(System.Net.IPAddress.Parse(i), int.Parse(p));
}
private void button2_Click(object sender, EventArgs e)
{
//Enviamos el texto a la sala
//Utilizamos este metodo para no agregar la clase AresPacket
// en la version 2 agregaremos como enviar avatar en esta version
List<byte> buffer = new List<byte>();
//nueva cadena de bytes
buffer.AddRange(new byte[] { 10 });
//Public chat 10
buffer.AddRange(Encoding.UTF8.GetBytes((textBox1.Text)));
//xbytes
buffer.InsertRange(0, BitConverter.GetBytes(Convert.ToInt16(buffer.Count - 1)));
Socket.Send(buffer.ToArray());
textBox1.Clear();
//
}
}
}
public static string Encriptar(this string _cadenaAencriptar)
{
string result = string.Empty;
byte[] encryted = System.Text.Encoding.Unicode.GetBytes(_cadenaAencriptar);
result = Convert.ToBase64String(encryted);
return result;
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Net;
using iconnect;
namespace commands
{
class Bans
{
private class Item
{
public IPAddress IP { get; set; }
public Guid Guid { get; set; }
public uint Time { get; set; }
public BanDuration Duration { get; set; }
public String Name { get; set; }
}
public static void AddBan(IUser client, BanDuration duration)
{
if (list.Find(x => x.IP.Equals(client.ExternalIP) || x.Guid.Equals(client.Guid)) == null)
{
list.Add(new Item
{
Guid = client.Guid,
IP = client.ExternalIP,
Time = Server.Time,
Duration = duration,
Name = client.Name
});
Save();
}
}
public static void RemoveBan(String name)
{
list.RemoveAll(x => x.Name == name);
Save();
}
private static List<Item> list { get; set; }
public static void Tick(uint time)
{
for (int i = (list.Count - 1); i > -1; i--)
{
Item m = list[i];
if ((time - m.Time) > (uint)m.Duration)
{
list.RemoveAt(i);
Server.Print(Template.Text(Category.Timeouts, 2).Replace("+n", m.Name), true);
Server.Users.Banned(x =>
{
if (x.ExternalIP.Equals(m.IP) || x.Guid.Equals(m.Guid))
x.Unban();
});
}
}
}
public static void Clear()
{
list = new List<Item>();
Save();
}
private static void Save()
{
XmlDocument xml = new XmlDocument();
xml.PreserveWhitespace = true;
xml.AppendChild(xml.CreateXmlDeclaration("1.0", null, null));
XmlNode root = xml.AppendChild(xml.CreateElement("bans"));
foreach (Item i in list)
{
XmlNode item = root.OwnerDocument.CreateNode(XmlNodeType.Element, "item", root.BaseURI);
root.AppendChild(item);
XmlNode ip = item.OwnerDocument.CreateNode(XmlNodeType.Element, "ip", item.BaseURI);
item.AppendChild(ip);
ip.InnerText = i.IP.ToString();
XmlNode guid = item.OwnerDocument.CreateNode(XmlNodeType.Element, "guid", item.BaseURI);
item.AppendChild(guid);
guid.InnerText = i.Guid.ToString();
XmlNode time = item.OwnerDocument.CreateNode(XmlNodeType.Element, "time", item.BaseURI);
item.AppendChild(time);
time.InnerText = i.Time.ToString();
XmlNode duration = item.OwnerDocument.CreateNode(XmlNodeType.Element, "duration", item.BaseURI);
item.AppendChild(duration);
duration.InnerText = ((uint)i.Duration).ToString();
XmlNode name = item.OwnerDocument.CreateNode(XmlNodeType.Element, "name", item.BaseURI);
item.AppendChild(name);
name.InnerText = i.Name;
}
try { xml.Save(Path.Combine(Server.DataPath, "bans.xml")); }
catch { }
}
public static void Load()
{
list = new List<Item>();
try
{
XmlDocument xml = new XmlDocument();
xml.PreserveWhitespace = true;
xml.Load(Path.Combine(Server.DataPath, "bans.xml"));
XmlNodeList nodes = xml.GetElementsByTagName("item");
foreach (XmlElement e in nodes)
list.Add(new Item
{
IP = IPAddress.Parse(e.GetElementsByTagName("ip")[0].InnerText),
Guid = new Guid(e.GetElementsByTagName("guid")[0].InnerText),
Time = uint.Parse(e.GetElementsByTagName("time")[0].InnerText),
Duration = e.GetElementsByTagName("duration")[0].InnerText == "600" ? BanDuration.Ten : BanDuration.Sixty,
Name = e.GetElementsByTagName("name")[0].InnerText
});
}
catch { }
}
}
enum BanDuration : uint
{
Ten = 600,
Sixty = 3600
}
}