Probleme d'importation java
samsoumaton
Messages postés
21
Statut
Membre
-
samsoumaton Messages postés 21 Statut Membre -
samsoumaton Messages postés 21 Statut Membre -
Bonjour,
c mon code
lors de compilation il affiche les erreur
merci pour toute reponce
c mon code
package tcpipattacker.modules;
import net.sourceforge.jpcap.capture.*;
import net.sourceforge.jpcap.net.*;
import tcpipattacker.*;
//import tcpipattacker.;
public class sniff
extends Module {
public String getName() {
return "sniff";
}
public String getHelp() {
return "SYNOPSIS : sniff\n" +
"DESCRIPTION : Sniff the network. This module is entirely assisted.\n" +
"Written by Julien CHABLE (jchable@itin.fr)\n";
}
public String run(String[] arguments) {
// Console d'affichage
Console console = new Console("sniff");
// Paramètres de la capture
int packetCount;
String filter = "";
String device;
try {
console.println("Instantiate Capturing Engine");
PacketCapture pcap = new PacketCapture();
console.println("Check for devices");
console.println("Available network devices on your machine :");
String[] devices = PacketCapture.lookupDevices();
// Affiche tous les accès réseau
for (int i = 0; i < devices.length; ++i)
console.println("\t " + i + " : " + devices[i]);
console.println("Use network device :");
device = pcap.findDevice();
console.println(device);
console.println("Open device to capturing (requires root)");
device=" \\Device\\NPF_{67A959FB-3D4C-463D-B1BD-92012FE5CDFE}";
pcap.open(device, true);
console.println("BPF filter (see pcap help) :");
//filter = console.prompt();
pcap.setFilter("", true);
console.println("Register a listener for packets");
pcap.addPacketListener(new PacketHandler());
console.println("How many packets to capture :");
packetCount = console.promptInt();
console.println("Capturing packets ...");
pcap.capture(1000);
}
catch (Exception e) {
return "Module " + getName() + " error : " + e.getMessage();
}
return "Succesfull execution of " + getName() + "!";
}
}
final class PacketHandler
implements PacketListener {
private String sourceAddress;
private String destinationAddress;
private String dataPacket;
private Console console = new Console();
public void packetArrived(Packet packet) {
try {
// Trame Ethernet
if (packet instanceof EthernetPacket) {
EthernetPacket ethernetPacket = (EthernetPacket) packet;
sourceAddress = ethernetPacket.getSourceHwAddress();
destinationAddress = ethernetPacket.getDestinationHwAddress();
console.println("[Ethernet] : from <" + sourceAddress + "> to <" +
destinationAddress + ">");
}
// Paquet ARP
if (packet instanceof ARPPacket) {
ARPPacket arpPacket = (ARPPacket) packet;
byte[] data = arpPacket.getARPHeader();
console.print("\t[ARP] : " +
(arpPacket.getOperation() == ARPFields.ARP_OP_REQ_CODE ?
"Request" : "Reply"));
console.print(" from " + arpPacket.getSourceProtoAddress() + " to " +
arpPacket.getDestinationProtoAddress());
console.println(" - Header length : " + arpPacket.getHeader().length +
" - Data Length : " + arpPacket.getData().length);
}
// Paquet IP
if (packet instanceof IPPacket) {
IPPacket ipPacket = (IPPacket) packet;
byte[] data = ipPacket.getIPData();
sourceAddress = ipPacket.getSourceAddress();
destinationAddress = ipPacket.getDestinationAddress();
dataPacket = new String(data, "ISO-8859-1");
console.println("\t[IP] : from <" + sourceAddress + "> to <" +
destinationAddress + ">\n\t\t" +
dataPacket);
}
// Paquet ICMP
if (packet instanceof ICMPPacket) {
ICMPPacket icmpPacket = (ICMPPacket) packet;
byte[] data = icmpPacket.getICMPData();
sourceAddress = icmpPacket.getSourceAddress();
destinationAddress = icmpPacket.getDestinationAddress();
dataPacket = new String(data, "ISO-8859-1");
console.println("\t[ICMP] : " +
ICMPMessage.getDescription(icmpPacket.getMessageCode()) +
"\n\t\tData : " + dataPacket);
}
// Paquet IGMP
if (packet instanceof IGMPPacket) {
IGMPPacket igmpPacket = (IGMPPacket) packet;
byte[] data = igmpPacket.getData();
sourceAddress = igmpPacket.getSourceAddress();
destinationAddress = igmpPacket.getDestinationAddress();
dataPacket = new String(data, "ISO-8859-1");
console.println("\t[IGMP] : " +
IGMPMessage.getDescription(igmpPacket.getMessageType()) +
" " + igmpPacket.getGroupAddress() + "\n\t\tData : " +
dataPacket);
}
// Paquet TCP
if (packet instanceof TCPPacket) {
TCPPacket tcpPacket = (TCPPacket) packet;
byte[] data = tcpPacket.getTCPData();
dataPacket = new String(data, "ISO-8859-1");
console.print("\t[TCP] - Port source : " +
String.valueOf(tcpPacket.getSourcePort()) +
" (" + IPPort.getName(tcpPacket.getSourcePort()) +
") Destination port : " +
String.valueOf(tcpPacket.getDestinationPort()) +
" (" + IPPort.getName(tcpPacket.getDestinationPort()) +
")\n\tSequence Number : " +
String.valueOf(tcpPacket.getSequenceNumber()) +
"\n\tAcknowledgment Number : " +
String.valueOf(tcpPacket.getAcknowledgmentNumber()) +
"\n\tHeader Length : " +
String.valueOf(tcpPacket.getTCPHeaderLength()));
// Flags
if (tcpPacket.isUrg())
console.println("\n\tURG[0x" + Integer.toHexString(tcpPacket.getUrgentPointer()) + "]");
if (tcpPacket.isAck())
console.println("\n\tACK[0x" + Long.toHexString(tcpPacket.getAcknowledgmentNumber()) + "]");
if (tcpPacket.isPsh())
console.println("\n\tPSH");
if (tcpPacket.isRst())
console.println("\n\tRST");
if (tcpPacket.isSyn())
console.println("\n\tSYN[0x" + Long.toHexString(tcpPacket.getSequenceNumber()) + "]");
if (tcpPacket.isFin())
console.println("\n\tFIN");
console.println("\tData : " + dataPacket);
}
// Paquet UDP
if (packet instanceof UDPPacket) {
UDPPacket udpPacket = (UDPPacket) packet;
byte[] data = udpPacket.getData();
dataPacket = new String(data, "ISO-8859-1");
console.print("\t[UDP] - Port source : " +
String.valueOf(udpPacket.getSourcePort()) +
" (" + IPPort.getName(udpPacket.getSourcePort()) +
") Destination port : " +
String.valueOf(udpPacket.getDestinationPort()) +
" (" + IPPort.getName(udpPacket.getDestinationPort()));
}
console.println("");
}
catch (Exception e) {
e.printStackTrace();
}
}
}
lors de compilation il affiche les erreur
"Compilation de TCP/IP Attacker en cours ..."
modules\sniff.java:7: cannot find symbol
symbol: class Module
extends Module {
^
modules\sniff.java:65: cannot find symbol
symbol : class Console
location: class tcpipattacker.modules.PacketHandler
private Console console = new Console();
^
modules\sniff.java:21: cannot find symbol
symbol : class Console
location: class tcpipattacker.modules.sniff
Console console = new Console("sniff");
^
modules\sniff.java:21: cannot find symbol
symbol : class Console
location: class tcpipattacker.modules.sniff
Console console = new Console("sniff");
^
modules\sniff.java:65: cannot find symbol
symbol : class Console
location: class tcpipattacker.modules.PacketHandler
private Console console = new Console();
^
5 errors
"Erreur de compilation !"
Press any key to continue . . .
merci pour toute reponce
A voir également:
- Probleme d'importation java
- Jeux java itel - Télécharger - Jeux vidéo
- Waptrick java football - Télécharger - Jeux vidéo
- Waptrick java voiture - Télécharger - Jeux vidéo
- Eclipse java - Télécharger - Langages
- Java apk - Télécharger - Langages
4 réponses
BONJOUR,
merci pour votre reponce
dans mon exemple tous les fichiers a importer se trouve directement sur tcpipattaker
mais je ne sais pas pourquoiil n'a pas les reconnu
en attandant d'autres soution et merci
merci pour votre reponce
dans mon exemple tous les fichiers a importer se trouve directement sur tcpipattaker
mais je ne sais pas pourquoiil n'a pas les reconnu
en attandant d'autres soution et merci
Plus d'erreurs
"Compilation de TCP/IP Attacker en cours ..."
modules\sniff.java:6: cannot find symbol
symbol : class Console
location: package tcpipattacker
import tcpipattacker.Console;
^
modules\sniff.java:7: cannot find symbol
symbol : class Module
location: package tcpipattacker
import tcpipattacker.Module;
^
modules\sniff.java:11: cannot find symbol
symbol: class Module
extends Module {
^
modules\sniff.java:69: cannot find symbol
symbol : class Console
location: class tcpipattacker.modules.PacketHandler
private Console console = new Console();
^
modules\sniff.java:25: cannot find symbol
symbol : class Console
location: class tcpipattacker.modules.sniff
Console console = new Console("sniff");
^
modules\sniff.java:25: cannot find symbol
symbol : class Console
location: class tcpipattacker.modules.sniff
Console console = new Console("sniff");
^
modules\sniff.java:69: cannot find symbol
symbol : class Console
location: class tcpipattacker.modules.PacketHandler
private Console console = new Console();
^
7 errors
"Erreur de compilation !"
Press any key to continue . . .